コード例 #1
0
  public void testSchemaXMLWSchemaWithRestriction() throws Exception {
    Configuration config = SupportConfigFactory.getConfiguration();
    ConfigurationEventTypeXMLDOM eventTypeMeta = new ConfigurationEventTypeXMLDOM();
    eventTypeMeta.setRootElementName("order");
    InputStream schemaStream =
        TestSchemaXMLEvent.class
            .getClassLoader()
            .getResourceAsStream(CLASSLOADER_SCHEMA_WITH_RESTRICTION_URI);
    assertNotNull(schemaStream);
    String schemaText = ParserTool.linesToText(ParserTool.readFile(schemaStream));
    eventTypeMeta.setSchemaText(schemaText);
    config.addEventType("OrderEvent", eventTypeMeta);

    epService = EPServiceProviderManager.getProvider("TestSchemaXML", config);
    epService.initialize();
    updateListener = new SupportUpdateListener();

    String text = "select order_amount from OrderEvent";
    EPStatement stmt = epService.getEPAdministrator().createEPL(text);
    stmt.addListener(updateListener);

    SupportXML.sendEvent(
        epService.getEPRuntime(),
        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
            + "<order>\n"
            + "<order_amount>202.1</order_amount>"
            + "</order>");
    EventBean theEvent = updateListener.getLastNewData()[0];
    assertEquals(Double.class, theEvent.get("order_amount").getClass());
    assertEquals(202.1d, theEvent.get("order_amount"));
    updateListener.reset();
  }
コード例 #2
0
  public void testEngineMetrics() {
    epService = EPServiceProviderManager.getProvider("MyURI", getConfig(10000, -1, true));
    epService.initialize();

    String[] engineFields =
        "engineURI,timestamp,inputCount,inputCountDelta,scheduleDepth".split(",");
    sendTimer(1000);

    String text = "select * from " + EngineMetric.class.getName();
    EPStatement stmt = epService.getEPAdministrator().createEPL(text);
    stmt.addListener(listener);

    epService.getEPRuntime().sendEvent(new SupportBean());

    sendTimer(10999);
    assertFalse(listener.isInvoked());

    epService.getEPAdministrator().createEPL("select * from pattern[timer:interval(5 sec)]");

    sendTimer(11000);
    EventBean event = listener.assertOneGetNewAndReset();
    ArrayAssertionUtil.assertProps(event, engineFields, new Object[] {"MyURI", 11000L, 1L, 1L, 1L});

    epService.getEPRuntime().sendEvent(new SupportBean());
    epService.getEPRuntime().sendEvent(new SupportBean());

    sendTimer(20000);
    sendTimer(21000);
    event = listener.assertOneGetNewAndReset();
    ArrayAssertionUtil.assertProps(event, engineFields, new Object[] {"MyURI", 21000L, 4L, 3L, 0L});
  }
コード例 #3
0
ファイル: EPLTest.java プロジェクト: hancy2013/esper-practice
  @Before
  public void setup() {
    Configuration config = new Configuration();
    config.addEventType("StockTick", StockTick.class);
    epService = EPServiceProviderManager.getProvider("EPLTest", config);

    esperRunner = new EsperRunner(epService);
  }
コード例 #4
0
  public void testSchemaXMLWSchemaWithAll() throws Exception {
    Configuration config = SupportConfigFactory.getConfiguration();
    ConfigurationEventTypeXMLDOM eventTypeMeta = new ConfigurationEventTypeXMLDOM();
    eventTypeMeta.setRootElementName("event-page-visit");
    String schemaUri =
        TestSchemaXMLEvent.class
            .getClassLoader()
            .getResource(CLASSLOADER_SCHEMA_WITH_ALL_URI)
            .toString();
    eventTypeMeta.setSchemaResource(schemaUri);
    eventTypeMeta.addNamespacePrefix("ss", "samples:schemas:simpleSchemaWithAll");
    eventTypeMeta.addXPathProperty("url", "/ss:event-page-visit/ss:url", XPathConstants.STRING);
    config.addEventType("PageVisitEvent", eventTypeMeta);

    epService = EPServiceProviderManager.getProvider("TestSchemaXML", config);
    epService.initialize();
    updateListener = new SupportUpdateListener();

    // url='page4'
    String text = "select a.url as sesja from pattern [ every a=PageVisitEvent(url='page1') ]";
    EPStatement stmt = epService.getEPAdministrator().createEPL(text);
    stmt.addListener(updateListener);

    SupportXML.sendEvent(
        epService.getEPRuntime(),
        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
            + "<event-page-visit xmlns=\"samples:schemas:simpleSchemaWithAll\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"samples:schemas:simpleSchemaWithAll simpleSchemaWithAll.xsd\">\n"
            + "<url>page1</url>"
            + "</event-page-visit>");
    EventBean theEvent = updateListener.getLastNewData()[0];
    assertEquals("page1", theEvent.get("sesja"));
    updateListener.reset();

    SupportXML.sendEvent(
        epService.getEPRuntime(),
        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
            + "<event-page-visit xmlns=\"samples:schemas:simpleSchemaWithAll\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"samples:schemas:simpleSchemaWithAll simpleSchemaWithAll.xsd\">\n"
            + "<url>page2</url>"
            + "</event-page-visit>");
    assertFalse(updateListener.isInvoked());

    EventType type =
        epService.getEPAdministrator().createEPL("select * from PageVisitEvent").getEventType();
    EPAssertionUtil.assertEqualsAnyOrder(
        new Object[] {
          new EventPropertyDescriptor(
              "sessionId", Node.class, null, false, false, false, false, true),
          new EventPropertyDescriptor(
              "customerId", Node.class, null, false, false, false, false, true),
          new EventPropertyDescriptor("url", String.class, null, false, false, false, false, false),
          new EventPropertyDescriptor("method", Node.class, null, false, false, false, false, true),
        },
        type.getPropertyDescriptors());
  }
コード例 #5
0
  public void testEnabledDisableRuntime() {
    EPStatement[] statements = new EPStatement[5];
    Configuration config = getConfig(10000, 10000, true);
    epService = EPServiceProviderManager.getProvider("MyURI", config);
    epService.initialize();

    sendTimer(1000);

    statements[0] =
        epService
            .getEPAdministrator()
            .createEPL("select * from " + StatementMetric.class.getName(), "stmtmetric");
    statements[0].addListener(listenerStmtMetric);

    statements[1] =
        epService
            .getEPAdministrator()
            .createEPL("select * from " + EngineMetric.class.getName(), "enginemetric");
    statements[1].addListener(listenerEngineMetric);

    statements[2] =
        epService
            .getEPAdministrator()
            .createEPL(
                "select * from SupportBean(intPrimitive=1).win:keepall() where MyMetricFunctions.takeCPUTime(longPrimitive)");
    sendEvent("E1", 1, cpuGoalOneNano);

    sendTimer(11000);
    assertTrue(listenerStmtMetric.getAndClearIsInvoked());
    assertTrue(listenerEngineMetric.getAndClearIsInvoked());

    epService.getEPAdministrator().getConfiguration().setMetricsReportingDisabled();
    sendEvent("E2", 2, cpuGoalOneNano);
    sendTimer(21000);
    assertFalse(listenerStmtMetric.getAndClearIsInvoked());
    assertFalse(listenerEngineMetric.getAndClearIsInvoked());

    sendTimer(31000);
    sendEvent("E3", 3, cpuGoalOneNano);
    assertFalse(listenerStmtMetric.getAndClearIsInvoked());
    assertFalse(listenerEngineMetric.getAndClearIsInvoked());

    epService.getEPAdministrator().getConfiguration().setMetricsReportingEnabled();
    sendEvent("E4", 4, cpuGoalOneNano);
    sendTimer(41000);
    assertTrue(listenerStmtMetric.getAndClearIsInvoked());
    assertTrue(listenerEngineMetric.getAndClearIsInvoked());

    statements[2].destroy();
    sendTimer(51000);
    assertTrue(listenerStmtMetric.isInvoked()); // metrics statements reported themselves
    assertTrue(listenerEngineMetric.isInvoked());
  }
コード例 #6
0
  public void testInvalid() {
    epService = EPServiceProviderManager.getProvider("TestSchemaXML", getConfig(false));
    epService.initialize();

    try {
      epService
          .getEPAdministrator()
          .createEPL("select element1 from TestXMLSchemaType.win:length(100)");
      fail();
    } catch (EPStatementException ex) {
      assertEquals(
          "Error starting statement: Property named 'element1' is not valid in any stream [select element1 from TestXMLSchemaType.win:length(100)]",
          ex.getMessage());
    }
  }
コード例 #7
0
  public void testAddRemoveType() {
    epService = EPServiceProviderManager.getProvider("TestSchemaXML", getConfig(false));
    epService.initialize();
    updateListener = new SupportUpdateListener();
    ConfigurationOperations configOps = epService.getEPAdministrator().getConfiguration();

    // test remove type with statement used (no force)
    configOps.addEventType("MyXMLEvent", getConfigTestType("p01", false));
    EPStatement stmt =
        epService.getEPAdministrator().createEPL("select p01 from MyXMLEvent", "stmtOne");
    EPAssertionUtil.assertEqualsExactOrder(
        configOps.getEventTypeNameUsedBy("MyXMLEvent").toArray(), new String[] {"stmtOne"});

    try {
      configOps.removeEventType("MyXMLEvent", false);
    } catch (ConfigurationException ex) {
      assertTrue(ex.getMessage().contains("MyXMLEvent"));
    }

    // destroy statement and type
    stmt.destroy();
    assertTrue(configOps.getEventTypeNameUsedBy("MyXMLEvent").isEmpty());
    assertTrue(configOps.isEventTypeExists("MyXMLEvent"));
    assertTrue(configOps.removeEventType("MyXMLEvent", false));
    assertFalse(configOps.removeEventType("MyXMLEvent", false)); // try double-remove
    assertFalse(configOps.isEventTypeExists("MyXMLEvent"));
    try {
      epService.getEPAdministrator().createEPL("select p01 from MyXMLEvent");
      fail();
    } catch (EPException ex) {
      // expected
    }

    // add back the type
    configOps.addEventType("MyXMLEvent", getConfigTestType("p20", false));
    assertTrue(configOps.isEventTypeExists("MyXMLEvent"));
    assertTrue(configOps.getEventTypeNameUsedBy("MyXMLEvent").isEmpty());

    // compile
    epService.getEPAdministrator().createEPL("select p20 from MyXMLEvent", "stmtTwo");
    EPAssertionUtil.assertEqualsExactOrder(
        configOps.getEventTypeNameUsedBy("MyXMLEvent").toArray(), new String[] {"stmtTwo"});
    try {
      epService.getEPAdministrator().createEPL("select p01 from MyXMLEvent");
      fail();
    } catch (EPException ex) {
      // expected
    }

    // remove with force
    try {
      configOps.removeEventType("MyXMLEvent", false);
    } catch (ConfigurationException ex) {
      assertTrue(ex.getMessage().contains("MyXMLEvent"));
    }
    assertTrue(configOps.removeEventType("MyXMLEvent", true));
    assertFalse(configOps.isEventTypeExists("MyXMLEvent"));
    assertTrue(configOps.getEventTypeNameUsedBy("MyXMLEvent").isEmpty());

    // add back the type
    configOps.addEventType("MyXMLEvent", getConfigTestType("p03", false));
    assertTrue(configOps.isEventTypeExists("MyXMLEvent"));

    // compile
    epService.getEPAdministrator().createEPL("select p03 from MyXMLEvent");
    try {
      epService.getEPAdministrator().createEPL("select p20 from MyXMLEvent");
      fail();
    } catch (EPException ex) {
      // expected
    }
  }
コード例 #8
0
  public void testSchemaXMLQuery_DOMGetterBacked() throws Exception {
    epService = EPServiceProviderManager.getProvider("TestSchemaXML", getConfig(false));
    epService.initialize();
    updateListener = new SupportUpdateListener();

    String stmtSelectWild = "select * from TestXMLSchemaType";
    EPStatement wildStmt = epService.getEPAdministrator().createEPL(stmtSelectWild);
    EventType type = wildStmt.getEventType();
    EventTypeAssertionUtil.assertConsistency(type);

    EPAssertionUtil.assertEqualsAnyOrder(
        new Object[] {
          new EventPropertyDescriptor(
              "nested1", Node.class, null, false, false, false, false, true),
          new EventPropertyDescriptor(
              "prop4", String.class, null, false, false, false, false, false),
          new EventPropertyDescriptor(
              "nested3", Node.class, null, false, false, false, false, true),
          new EventPropertyDescriptor(
              "customProp", Double.class, null, false, false, false, false, false),
        },
        type.getPropertyDescriptors());

    String stmt =
        "select nested1 as nodeProp,"
            + "prop4 as nested1Prop,"
            + "nested1.prop2 as nested2Prop,"
            + "nested3.nested4('a').prop5[1] as complexProp,"
            + "nested1.nested2.prop3[2] as indexedProp,"
            + "customProp,"
            + "prop4.attr2 as attrOneProp,"
            + "nested3.nested4[2].id as attrTwoProp"
            + " from TestXMLSchemaType.win:length(100)";

    EPStatement selectStmt = epService.getEPAdministrator().createEPL(stmt);
    selectStmt.addListener(updateListener);
    type = selectStmt.getEventType();
    EventTypeAssertionUtil.assertConsistency(type);
    EPAssertionUtil.assertEqualsAnyOrder(
        new Object[] {
          new EventPropertyDescriptor(
              "nodeProp", Node.class, null, false, false, false, false, true),
          new EventPropertyDescriptor(
              "nested1Prop", String.class, null, false, false, false, false, false),
          new EventPropertyDescriptor(
              "nested2Prop", Boolean.class, null, false, false, false, false, false),
          new EventPropertyDescriptor(
              "complexProp", String.class, null, false, false, false, false, false),
          new EventPropertyDescriptor(
              "indexedProp", Integer.class, null, false, false, false, false, false),
          new EventPropertyDescriptor(
              "customProp", Double.class, null, false, false, false, false, false),
          new EventPropertyDescriptor(
              "attrOneProp", Boolean.class, null, false, false, false, false, false),
          new EventPropertyDescriptor(
              "attrTwoProp", String.class, null, false, false, false, false, false),
        },
        type.getPropertyDescriptors());

    Document eventDoc = SupportXML.sendDefaultEvent(epService.getEPRuntime(), "test");

    assertNotNull(updateListener.getLastNewData());
    EventBean theEvent = updateListener.getLastNewData()[0];

    assertSame(eventDoc.getDocumentElement().getChildNodes().item(1), theEvent.get("nodeProp"));
    assertEquals("SAMPLE_V6", theEvent.get("nested1Prop"));
    assertEquals(true, theEvent.get("nested2Prop"));
    assertEquals("SAMPLE_V8", theEvent.get("complexProp"));
    assertEquals(5, theEvent.get("indexedProp"));
    assertEquals(3.0, theEvent.get("customProp"));
    assertEquals(true, theEvent.get("attrOneProp"));
    assertEquals("c", theEvent.get("attrTwoProp"));

    /**
     * Comment-in for performance testing long start = System.nanoTime(); for (int i = 0; i < 1000;
     * i++) { sendEvent("test"); } long end = System.nanoTime(); double delta = (end - start) /
     * 1000d / 1000d / 1000d; System.out.println(delta);
     */
  }
コード例 #9
0
  public void testEnabledDisableStatement() {
    String[] fields = new String[] {"statementName"};
    EPStatement[] statements = new EPStatement[5];
    Configuration config = getConfig(-1, 10000, true);

    ConfigurationMetricsReporting.StmtGroupMetrics configOne =
        new ConfigurationMetricsReporting.StmtGroupMetrics();
    configOne.setInterval(-1);
    configOne.addIncludeLike("%@METRIC%");
    config.getEngineDefaults().getMetricsReporting().addStmtGroup("metrics", configOne);

    epService = EPServiceProviderManager.getProvider("MyURI", config);
    epService.initialize();

    sendTimer(1000);

    statements[0] =
        epService
            .getEPAdministrator()
            .createEPL("select * from " + StatementMetric.class.getName(), "MyStatement@METRIC");
    statements[0].addListener(listenerStmtMetric);

    statements[1] =
        epService
            .getEPAdministrator()
            .createEPL(
                "select * from SupportBean(intPrimitive=1).win:keepall() where 2=2", "stmtone");
    sendEvent("E1", 1, cpuGoalOneNano);
    statements[2] =
        epService
            .getEPAdministrator()
            .createEPL(
                "select * from SupportBean(intPrimitive>0).std:lastevent() where 1=1", "stmttwo");
    sendEvent("E2", 1, cpuGoalOneNano);

    sendTimer(11000);
    ArrayAssertionUtil.assertPropsPerRow(
        listenerStmtMetric.getNewDataListFlattened(),
        fields,
        new Object[][] {{"stmtone"}, {"stmttwo"}});
    listenerStmtMetric.reset();

    sendEvent("E1", 1, cpuGoalOneNano);
    sendTimer(21000);
    ArrayAssertionUtil.assertPropsPerRow(
        listenerStmtMetric.getNewDataListFlattened(),
        fields,
        new Object[][] {{"stmtone"}, {"stmttwo"}});
    listenerStmtMetric.reset();

    epService.getEPAdministrator().getConfiguration().setMetricsReportingStmtDisabled("stmtone");

    sendEvent("E1", 1, cpuGoalOneNano);
    sendTimer(31000);
    ArrayAssertionUtil.assertPropsPerRow(
        listenerStmtMetric.getNewDataListFlattened(), fields, new Object[][] {{"stmttwo"}});
    listenerStmtMetric.reset();

    epService.getEPAdministrator().getConfiguration().setMetricsReportingStmtEnabled("stmtone");
    epService.getEPAdministrator().getConfiguration().setMetricsReportingStmtDisabled("stmttwo");

    sendEvent("E1", 1, cpuGoalOneNano);
    sendTimer(41000);
    ArrayAssertionUtil.assertPropsPerRow(
        listenerStmtMetric.getNewDataListFlattened(), fields, new Object[][] {{"stmtone"}});
    listenerStmtMetric.reset();
  }
コード例 #10
0
  public void testStatementMetrics() {
    Configuration config = getConfig(-1, -1, true);

    // report on all statements every 10 seconds
    ConfigurationMetricsReporting.StmtGroupMetrics configOne =
        new ConfigurationMetricsReporting.StmtGroupMetrics();
    configOne.setInterval(10000);
    configOne.addIncludeLike("%cpuStmt%");
    configOne.addIncludeLike("%wallStmt%");
    config.getEngineDefaults().getMetricsReporting().addStmtGroup("nonmetrics", configOne);

    // exclude metrics themselves from reporting
    ConfigurationMetricsReporting.StmtGroupMetrics configTwo =
        new ConfigurationMetricsReporting.StmtGroupMetrics();
    configTwo.setInterval(-1);
    configOne.addExcludeLike("%metrics%");
    config.getEngineDefaults().getMetricsReporting().addStmtGroup("metrics", configTwo);

    epService = EPServiceProviderManager.getProvider("MyURI", config);
    epService.initialize();

    sendTimer(1000);

    EPStatement[] statements = new EPStatement[5];
    statements[0] =
        epService
            .getEPAdministrator()
            .createEPL("select * from " + StatementMetric.class.getName(), "stmt_metrics");
    statements[0].addListener(listener);

    statements[1] =
        epService
            .getEPAdministrator()
            .createEPL(
                "select * from SupportBean(intPrimitive=1).win:keepall() where MyMetricFunctions.takeCPUTime(longPrimitive)",
                "cpuStmtOne");
    statements[1].addListener(listenerTwo);
    statements[2] =
        epService
            .getEPAdministrator()
            .createEPL(
                "select * from SupportBean(intPrimitive=2).win:keepall() where MyMetricFunctions.takeCPUTime(longPrimitive)",
                "cpuStmtTwo");
    statements[2].addListener(listenerTwo);
    statements[3] =
        epService
            .getEPAdministrator()
            .createEPL(
                "select * from SupportBean(intPrimitive=3).win:keepall() where MyMetricFunctions.takeWallTime(longPrimitive)",
                "wallStmtThree");
    statements[3].addListener(listenerTwo);
    statements[4] =
        epService
            .getEPAdministrator()
            .createEPL(
                "select * from SupportBean(intPrimitive=4).win:keepall() where MyMetricFunctions.takeWallTime(longPrimitive)",
                "wallStmtFour");
    statements[4].addListener(listenerTwo);

    sendEvent("E1", 1, cpuGoalOneNano);
    sendEvent("E2", 2, cpuGoalTwoNano);
    sendEvent("E3", 3, wallGoalOneMsec);
    sendEvent("E4", 4, wallGoalTwoMsec);

    sendTimer(10999);
    assertFalse(listener.isInvoked());

    sendTimer(11000);
    runAssertion(11000);

    sendEvent("E1", 1, cpuGoalOneNano);
    sendEvent("E2", 2, cpuGoalTwoNano);
    sendEvent("E3", 3, wallGoalOneMsec);
    sendEvent("E4", 4, wallGoalTwoMsec);

    sendTimer(21000);
    runAssertion(21000);

    // destroy all application stmts
    for (int i = 1; i < 5; i++) {
      statements[i].destroy();
    }
    sendTimer(31000);
    assertFalse(listener.isInvoked());
  }
コード例 #11
0
  public void testStatementGroups() {
    Configuration config = getConfig(-1, 7000, true);

    ConfigurationMetricsReporting.StmtGroupMetrics groupOne =
        new ConfigurationMetricsReporting.StmtGroupMetrics();
    groupOne.setInterval(8000);
    groupOne.addIncludeLike("%GroupOne%");
    groupOne.setReportInactive(true);
    config.getEngineDefaults().getMetricsReporting().addStmtGroup("GroupOneStatements", groupOne);

    ConfigurationMetricsReporting.StmtGroupMetrics groupTwo =
        new ConfigurationMetricsReporting.StmtGroupMetrics();
    groupTwo.setInterval(6000);
    groupTwo.setDefaultInclude(true);
    groupTwo.addExcludeLike("%Default%");
    groupTwo.addExcludeLike("%Metrics%");
    config
        .getEngineDefaults()
        .getMetricsReporting()
        .addStmtGroup("GroupTwoNonDefaultStatements", groupTwo);

    ConfigurationMetricsReporting.StmtGroupMetrics groupThree =
        new ConfigurationMetricsReporting.StmtGroupMetrics();
    groupThree.setInterval(-1);
    groupThree.addIncludeLike("%Metrics%");
    config.getEngineDefaults().getMetricsReporting().addStmtGroup("MetricsStatements", groupThree);

    epService = EPServiceProviderManager.getProvider("MyURI", config);
    epService.initialize();

    sendTimer(0);

    epService
        .getEPAdministrator()
        .createEPL("select * from SupportBean(intPrimitive = 1).win:keepall()", "GroupOne");
    EPStatement stmt =
        epService
            .getEPAdministrator()
            .createEPL("select * from SupportBean(intPrimitive = 2).win:keepall()", "GroupTwo");
    stmt.setSubscriber(new SupportSubscriber());
    epService
        .getEPAdministrator()
        .createEPL(
            "select * from SupportBean(intPrimitive = 3).win:keepall()", "Default"); // no listener

    stmt =
        epService
            .getEPAdministrator()
            .createEPL("select * from " + StatementMetric.class.getName(), "StmtMetrics");
    stmt.addListener(listener);

    sendTimer(6000);
    sendTimer(7000);
    assertFalse(listener.isInvoked());

    sendTimer(8000);
    String[] fields = "statementName,numOutputIStream,numInput".split(",");
    ArrayAssertionUtil.assertProps(
        listener.assertOneGetNewAndReset(), fields, new Object[] {"GroupOne", 0L, 0L});

    sendTimer(12000);
    sendTimer(14000);
    sendTimer(15999);
    assertFalse(listener.isInvoked());

    sendTimer(16000);
    ArrayAssertionUtil.assertProps(
        listener.assertOneGetNewAndReset(), fields, new Object[] {"GroupOne", 0L, 0L});

    // should report as groupTwo
    epService.getEPRuntime().sendEvent(new SupportBean("E1", 2));
    sendTimer(17999);
    assertFalse(listener.isInvoked());

    sendTimer(18000);
    ArrayAssertionUtil.assertProps(
        listener.assertOneGetNewAndReset(), fields, new Object[] {"GroupTwo", 1L, 1L});

    // should report as groupTwo
    epService.getEPRuntime().sendEvent(new SupportBean("E1", 3));
    sendTimer(20999);
    assertFalse(listener.isInvoked());

    sendTimer(21000);
    ArrayAssertionUtil.assertProps(
        listener.assertOneGetNewAndReset(), fields, new Object[] {"Default", 0L, 1L});

    // turn off group 1
    epService
        .getEPAdministrator()
        .getConfiguration()
        .setMetricsReportingInterval("GroupOneStatements", -1);
    sendTimer(24000);
    assertFalse(listener.isInvoked());

    // turn on group 1
    epService
        .getEPAdministrator()
        .getConfiguration()
        .setMetricsReportingInterval("GroupOneStatements", 1000);
    sendTimer(25000);
    ArrayAssertionUtil.assertProps(
        listener.assertOneGetNewAndReset(), fields, new Object[] {"GroupOne", 0L, 0L});
  }