private void RunAssertionSensorPerEvent(EPServiceProvider epService) { string stmtString = "SELECT irstream * " + "FROM\n " + typeof(SupportSensorEvent).FullName + "#groupwin(type)#time(1 hour)#unique(device)#sort(1, measurement desc) as high "; EPStatement stmt = epService.EPAdministrator.CreateEPL(stmtString); var testListener = new SupportUpdateListener(); stmt.Events += testListener.Update; EPRuntime runtime = epService.EPRuntime; var eventOne = new SupportSensorEvent(1, "Temperature", "Device1", 5.0, 96.5); runtime.SendEvent(eventOne); EPAssertionUtil.AssertUnderlyingPerRow(testListener.AssertInvokedAndReset(), new object[] { eventOne }, null); var eventTwo = new SupportSensorEvent(2, "Temperature", "Device2", 7.0, 98.5); runtime.SendEvent(eventTwo); EPAssertionUtil.AssertUnderlyingPerRow(testListener.AssertInvokedAndReset(), new object[] { eventTwo }, new object[] { eventOne }); var eventThree = new SupportSensorEvent(3, "Temperature", "Device2", 4.0, 99.5); runtime.SendEvent(eventThree); EPAssertionUtil.AssertUnderlyingPerRow(testListener.AssertInvokedAndReset(), new object[] { eventThree }, new object[] { eventTwo }); SupportSensorEvent theEvent = (SupportSensorEvent)stmt.First().Underlying; Assert.AreEqual(3, theEvent.Id); stmt.Dispose(); }
private void RunAssertionLengthBatchSize1(EPServiceProvider epService, SupportBean[] events) { EPStatement stmt = epService.EPAdministrator.CreateEPL( "select irstream * from " + typeof(SupportBean).FullName + "#length_batch(1)"); var listener = new SupportUpdateListener(); stmt.Events += listener.Update; SendEvent(events[0], epService); EPAssertionUtil.AssertUnderlyingPerRow(listener.AssertInvokedAndReset(), new SupportBean[] { events[0] }, null); EPAssertionUtil.AssertEqualsExactOrderUnderlying(null, stmt.GetEnumerator()); SendEvent(events[1], epService); EPAssertionUtil.AssertUnderlyingPerRow(listener.AssertInvokedAndReset(), new SupportBean[] { events[1] }, new SupportBean[] { events[0] }); EPAssertionUtil.AssertEqualsExactOrderUnderlying(null, stmt.GetEnumerator()); SendEvent(events[2], epService); EPAssertionUtil.AssertUnderlyingPerRow(listener.AssertInvokedAndReset(), new SupportBean[] { events[2] }, new SupportBean[] { events[1] }); EPAssertionUtil.AssertEqualsExactOrderUnderlying(null, stmt.GetEnumerator()); stmt.Dispose(); }
private void RunAssertionMultipleParams(bool soda) { var text = "select irstream countboundary(1,10,IntPrimitive,*) as val from " + typeof(SupportBean).FullName; var statement = SupportModelHelper.CreateByCompileOrParse(_epService, soda, text); var listener = new SupportUpdateListener(); statement.AddListener(listener); var validContext = SupportPluginAggregationMethodThreeFactory.Contexts[0]; EPAssertionUtil.AssertEqualsExactOrder(new Type[] { typeof(int?), typeof(int?), typeof(int), typeof(SupportBean) }, validContext.ParameterTypes); EPAssertionUtil.AssertEqualsExactOrder(new object[] { 1, 10, null, null }, validContext.ConstantValues); EPAssertionUtil.AssertEqualsExactOrder(new bool[] { true, true, false, false }, validContext.IsConstantValue); var e1 = new SupportBean("E1", 5); _epService.EPRuntime.SendEvent(e1); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { 1 }, new object[] { 0 }); EPAssertionUtil.AssertEqualsExactOrder(new object[] { 1, 10, 5, e1 }, SupportPluginAggregationMethodThree.LastEnterParameters); _epService.EPRuntime.SendEvent(new SupportBean("E1", 0)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { 1 }, new object[] { 1 }); _epService.EPRuntime.SendEvent(new SupportBean("E1", 11)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { 1 }, new object[] { 1 }); _epService.EPRuntime.SendEvent(new SupportBean("E1", 1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { 2 }, new object[] { 1 }); _epService.EPAdministrator.DestroyAllStatements(); }
public void TestLengthBatchSize2() { EPStatement stmt = _epService.EPAdministrator.CreateEPL( "select irstream * from " + typeof(SupportBean).FullName + "#length_batch(2)"); stmt.Events += _listener.Update; SendEvent(_events[0]); Assert.IsFalse(_listener.IsInvoked); EPAssertionUtil.AssertEqualsExactOrderUnderlying(new SupportBean[] { _events[0] }, stmt.GetEnumerator()); SendEvent(_events[1]); EPAssertionUtil.AssertUnderlyingPerRow(_listener.AssertInvokedAndReset(), new SupportBean[] { _events[0], _events[1] }, null); EPAssertionUtil.AssertEqualsExactOrderUnderlying(null, stmt.GetEnumerator()); SendEvent(_events[2]); Assert.IsFalse(_listener.IsInvoked); EPAssertionUtil.AssertEqualsExactOrderUnderlying(new SupportBean[] { _events[2] }, stmt.GetEnumerator()); SendEvent(_events[3]); EPAssertionUtil.AssertUnderlyingPerRow(_listener.AssertInvokedAndReset(), new SupportBean[] { _events[2], _events[3] }, new SupportBean[] { _events[0], _events[1] }); EPAssertionUtil.AssertEqualsExactOrderUnderlying(null, stmt.GetEnumerator()); SendEvent(_events[4]); Assert.IsFalse(_listener.IsInvoked); EPAssertionUtil.AssertEqualsExactOrderUnderlying(new SupportBean[] { _events[4] }, stmt.GetEnumerator()); SendEvent(_events[5]); EPAssertionUtil.AssertUnderlyingPerRow(_listener.AssertInvokedAndReset(), new SupportBean[] { _events[4], _events[5] }, new SupportBean[] { _events[2], _events[3] }); EPAssertionUtil.AssertEqualsExactOrderUnderlying(null, stmt.GetEnumerator()); }
public void TestSensorPerEvent() { String stmtString = "SELECT irstream * " + "FROM\n " + typeof(SupportSensorEvent).FullName + "#groupwin(type)#time(1 hour)#unique(device)#sort(1, measurement desc) as high "; EPStatement stmt = _epService.EPAdministrator.CreateEPL(stmtString); stmt.Events += _testListener.Update; EPRuntime runtime = _epService.EPRuntime; SupportSensorEvent eventOne = new SupportSensorEvent(1, "Temperature", "Device1", 5.0, 96.5); runtime.SendEvent(eventOne); EPAssertionUtil.AssertUnderlyingPerRow(_testListener.AssertInvokedAndReset(), new Object[] { eventOne }, null); SupportSensorEvent eventTwo = new SupportSensorEvent(2, "Temperature", "Device2", 7.0, 98.5); runtime.SendEvent(eventTwo); EPAssertionUtil.AssertUnderlyingPerRow(_testListener.AssertInvokedAndReset(), new Object[] { eventTwo }, new Object[] { eventOne }); SupportSensorEvent eventThree = new SupportSensorEvent(3, "Temperature", "Device2", 4.0, 99.5); runtime.SendEvent(eventThree); EPAssertionUtil.AssertUnderlyingPerRow(_testListener.AssertInvokedAndReset(), new Object[] { eventThree }, new Object[] { eventTwo }); IEnumerator <EventBean> it = stmt.GetEnumerator(); SupportSensorEvent theEvent = (SupportSensorEvent)it.Advance().Underlying; Assert.AreEqual(3, theEvent.Id); }
public void TestNoSubnodesRuntimeAdd() { _epService.EPAdministrator.Configuration.AddPlugInAggregationFunctionFactory("countback", typeof(SupportPluginAggregationMethodOneFactory).FullName); var text = "select irstream countback() as val from " + typeof(SupportBean).FullName; var statement = _epService.EPAdministrator.CreateEPL(text); var listener = new SupportUpdateListener(); statement.AddListener(listener); _epService.EPRuntime.SendEvent(new SupportBean()); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[]{-1}, new object[]{0}); _epService.EPRuntime.SendEvent(new SupportBean()); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] {-2}, new object[] {-1}); }
private void RunAssertionNoSubnodesRuntimeAdd(EPServiceProvider epService) { string text = "select irstream countback() as val from " + typeof(SupportBean).FullName; EPStatement statement = epService.EPAdministrator.CreateEPL(text); var listener = new SupportUpdateListener(); statement.Events += listener.Update; epService.EPRuntime.SendEvent(new SupportBean()); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { -1 }, new object[] { 0 }); epService.EPRuntime.SendEvent(new SupportBean()); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { -2 }, new object[] { -1 }); statement.Dispose(); }
public void TestArrayParamsAndDotMethod() { _epService.EPAdministrator.Configuration.AddPlugInAggregationFunctionFactory("countback", typeof(SupportPluginAggregationMethodOneFactory).FullName); var text = "select irstream countback({1,2,IntPrimitive}) as val from " + typeof(SupportBean).FullName; var statement = _epService.EPAdministrator.CreateEPL(text); var listener = new SupportUpdateListener(); statement.AddListener(listener); _epService.EPRuntime.SendEvent(new SupportBean()); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { -1 }, new object[] { 0 }); // test dot-method _epService.EPAdministrator.Configuration.AddEventType(typeof(SupportBean_A)); _epService.EPAdministrator.Configuration.AddPlugInAggregationFunctionFactory("myagg", typeof(MyAggFuncFactory).FullName); var fields = "val0,val1".Split(','); _epService.EPAdministrator.CreateEPL("select (myagg(id)).get_TheString() as val0, (myagg(id)).get_IntPrimitive() as val1 from SupportBean_A").AddListener(listener); _epService.EPRuntime.SendEvent(new SupportBean_A("A1")); EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, new object[] { "XX", 1 }); Assert.AreEqual(1, MyAggFuncFactory.InstanceCount); _epService.EPRuntime.SendEvent(new SupportBean_A("A2")); EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, new object[] { "XX", 2 }); }
private void RunAssertionDistinctAndStarParam(EPServiceProvider epService) { epService.EPAdministrator.Configuration.AddEventType <SupportBean>(); // test *-parameter string textTwo = "select concatstring(*) as val from SupportBean"; EPStatement statementTwo = epService.EPAdministrator.CreateEPL(textTwo); var listenerTwo = new SupportUpdateListener(); statementTwo.Events += listenerTwo.Update; epService.EPRuntime.SendEvent(new SupportBean("d", -1)); EPAssertionUtil.AssertProps(listenerTwo.AssertOneGetNewAndReset(), "val".Split(','), new object[] { "SupportBean(d, -1)" }); epService.EPRuntime.SendEvent(new SupportBean("e", 2)); EPAssertionUtil.AssertProps(listenerTwo.AssertOneGetNewAndReset(), "val".Split(','), new object[] { "SupportBean(d, -1) SupportBean(e, 2)" }); try { epService.EPAdministrator.CreateEPL("select concatstring(*) as val from SupportBean#lastevent, SupportBean unidirectional"); } catch (EPStatementException ex) { SupportMessageAssertUtil.AssertMessage(ex, "Error starting statement: Failed to validate select-clause expression 'concatstring(*)': The 'concatstring' aggregation function requires that in joins or subqueries the stream-wildcard (stream-alias.*) syntax is used instead"); } // test distinct string text = "select irstream concatstring(distinct TheString) as val from SupportBean"; EPStatement statement = epService.EPAdministrator.CreateEPL(text); var listener = new SupportUpdateListener(); statement.Events += listener.Update; epService.EPRuntime.SendEvent(new SupportBean("a", -1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { "a" }, new object[] { "" }); epService.EPRuntime.SendEvent(new SupportBean("b", -1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { "a b" }, new object[] { "a" }); epService.EPRuntime.SendEvent(new SupportBean("b", -1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { "a b" }, new object[] { "a b" }); epService.EPRuntime.SendEvent(new SupportBean("c", -1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { "a b c" }, new object[] { "a b" }); epService.EPRuntime.SendEvent(new SupportBean("a", -1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { "a b c" }, new object[] { "a b c" }); epService.EPAdministrator.DestroyAllStatements(); }
public void TestMappedPropertyLookAlike() { var text = "select irstream concatstring('a') as val from " + typeof(SupportBean).FullName; var statement = _epService.EPAdministrator.CreateEPL(text); var listener = new SupportUpdateListener(); statement.AddListener(listener); Assert.AreEqual(typeof(string), statement.EventType.GetPropertyType("val")); _epService.EPRuntime.SendEvent(new SupportBean()); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[]{"a"}, new object[]{""}); _epService.EPRuntime.SendEvent(new SupportBean()); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] {"a a"}, new object[] {"a"}); _epService.EPRuntime.SendEvent(new SupportBean()); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] {"a a a"}, new object[] {"a a"}); }
public void TestSubqueryAgainstNamedWindowInUDFInPattern() { _epService.EPAdministrator.Configuration.AddPlugInSingleRowFunction("supportSingleRowFunction", typeof(TestSubselectWithinPattern).FullName, "SupportSingleRowFunction"); _epService.EPAdministrator.CreateEPL("create window MyWindow#unique(p00)#keepall as S0"); EPStatement stmt = _epService.EPAdministrator.CreateEPL("select * from pattern[S1(SupportSingleRowFunction((select * from MyWindow)))]"); stmt.Events += _listener.Update; _epService.EPRuntime.SendEvent(new SupportBean_S1(1)); _listener.AssertInvokedAndReset(); }
private void RunAssertionSubqueryAgainstNamedWindowInUDFInPattern(EPServiceProvider epService) { epService.EPAdministrator.Configuration.AddPlugInSingleRowFunction("supportSingleRowFunction", typeof(ExecSubselectWithinPattern), "SupportSingleRowFunction"); epService.EPAdministrator.CreateEPL("create window MyWindowSNW#unique(p00)#keepall as S0"); EPStatement stmt = epService.EPAdministrator.CreateEPL("select * from pattern[S1(supportSingleRowFunction((select * from MyWindowSNW)))]"); var listener = new SupportUpdateListener(); stmt.Events += listener.Update; epService.EPRuntime.SendEvent(new SupportBean_S1(1)); listener.AssertInvokedAndReset(); }
private void RunAssertionMappedPropertyLookAlike(EPServiceProvider epService) { string text = "select irstream concatstring('a') as val from " + typeof(SupportBean).FullName; EPStatement statement = epService.EPAdministrator.CreateEPL(text); var listener = new SupportUpdateListener(); statement.Events += listener.Update; Assert.AreEqual(typeof(string), statement.EventType.GetPropertyType("val")); epService.EPRuntime.SendEvent(new SupportBean()); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { "a" }, new object[] { "" }); epService.EPRuntime.SendEvent(new SupportBean()); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { "a a" }, new object[] { "a" }); epService.EPRuntime.SendEvent(new SupportBean()); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { "a a a" }, new object[] { "a a" }); statement.Dispose(); }
public void TestWindow() { var text = "select irstream concatstring(TheString) as val from " + typeof(SupportBean).FullName + ".win:length(2)"; var statement = _epService.EPAdministrator.CreateEPL(text); var listener = new SupportUpdateListener(); statement.AddListener(listener); _epService.EPRuntime.SendEvent(new SupportBean("a", -1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] {"a"}, new object[] {""}); _epService.EPRuntime.SendEvent(new SupportBean("b", -1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] {"a b"}, new object[] {"a"}); _epService.EPRuntime.SendEvent(new SupportBean("c", -1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] {"b c"}, new object[] {"a b"}); _epService.EPRuntime.SendEvent(new SupportBean("d", -1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] {"c d"}, new object[] {"b c"}); _epService.EPAdministrator.DestroyAllStatements(); }
private void RunAssertionLengthBatchSize3And2Staggered(EPServiceProvider epService, SupportBean[] events) { if (SupportConfigFactory.SkipTest(typeof(ExecViewLengthBatch))) { return; } EPStatement stmt = epService.EPAdministrator.CreateEPL( "select irstream * from " + typeof(SupportBean).FullName + "#length_batch(3)#length_batch(2)"); var listener = new SupportUpdateListener(); stmt.Events += listener.Update; SendEvent(events[0], epService); Assert.IsFalse(listener.IsInvoked); EPAssertionUtil.AssertEqualsExactOrderUnderlying(null, stmt.GetEnumerator()); SendEvent(events[1], epService); Assert.IsFalse(listener.IsInvoked); EPAssertionUtil.AssertEqualsExactOrderUnderlying(null, stmt.GetEnumerator()); SendEvent(events[2], epService); EPAssertionUtil.AssertUnderlyingPerRow(listener.AssertInvokedAndReset(), new SupportBean[] { events[0], events[1], events[2] }, null); EPAssertionUtil.AssertEqualsExactOrderUnderlying(null, stmt.GetEnumerator()); SendEvent(events[3], epService); Assert.IsFalse(listener.IsInvoked); EPAssertionUtil.AssertEqualsExactOrderUnderlying(null, stmt.GetEnumerator()); SendEvent(events[4], epService); Assert.IsFalse(listener.IsInvoked); EPAssertionUtil.AssertEqualsExactOrderUnderlying(null, stmt.GetEnumerator()); SendEvent(events[5], epService); EPAssertionUtil.AssertUnderlyingPerRow(listener.AssertInvokedAndReset(), new SupportBean[] { events[3], events[4], events[5] }, new SupportBean[] { events[0], events[1], events[2] }); EPAssertionUtil.AssertEqualsExactOrderUnderlying(null, stmt.GetEnumerator()); stmt.Dispose(); }
private void TryGrouped(string text, EPStatementObjectModel model) { EPStatement statement; if (model != null) { statement = _epService.EPAdministrator.Create(model); } else { statement = _epService.EPAdministrator.CreateEPL(text); } var listener = new SupportUpdateListener(); statement.AddListener(listener); _epService.EPRuntime.SendEvent(new SupportBean("a", 1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] {"a"}, new object[] {""}); _epService.EPRuntime.SendEvent(new SupportBean("b", 2)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] {"b"}, new object[] {""}); _epService.EPRuntime.SendEvent(new SupportBean("c", 1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] {"a c"}, new object[] {"a"}); _epService.EPRuntime.SendEvent(new SupportBean("d", 2)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] {"b d"}, new object[] {"b"}); _epService.EPRuntime.SendEvent(new SupportBean("e", 1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] {"a c e"}, new object[] {"a c"}); _epService.EPRuntime.SendEvent(new SupportBean("f", 2)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] {"b d f"}, new object[] {"b d"}); listener.Reset(); }
private void RunAssertionWindow(EPServiceProvider epService) { string text = "select irstream concatstring(TheString) as val from " + typeof(SupportBean).FullName + "#length(2)"; EPStatement statement = epService.EPAdministrator.CreateEPL(text); var listener = new SupportUpdateListener(); statement.Events += listener.Update; epService.EPRuntime.SendEvent(new SupportBean("a", -1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { "a" }, new object[] { "" }); epService.EPRuntime.SendEvent(new SupportBean("b", -1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { "a b" }, new object[] { "a" }); epService.EPRuntime.SendEvent(new SupportBean("c", -1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { "b c" }, new object[] { "a b" }); epService.EPRuntime.SendEvent(new SupportBean("d", -1)); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "val", new object[] { "c d" }, new object[] { "b c" }); epService.EPAdministrator.DestroyAllStatements(); }
private void TryAssertionWithRefTime(EPServiceProvider epService, string epl) { string[] fields = "id".Split(','); EPStatement stmt = epService.EPAdministrator.CreateEPL(epl); var listener = new SupportUpdateListener(); stmt.Events += listener.Update; epService.EPRuntime.SendEvent(MyEvent.MakeTime("E1", "8:00:00.000")); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E2", "8:00:04.999")); Assert.IsFalse(listener.IsInvoked); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E3", "8:00:05.000")); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), fields, new object[][] { new object[] { "E1" }, new object[] { "E2" } }, null); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E4", "8:00:04.000")); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E5", "7:00:00.000")); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E6", "8:01:04.999")); Assert.IsFalse(listener.IsInvoked); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E7", "8:01:05.000")); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), fields, new object[][] { new object[] { "E3" }, new object[] { "E4" }, new object[] { "E5" }, new object[] { "E6" } }, new object[][] { new object[] { "E1" }, new object[] { "E2" } }); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E8", "8:03:55.000")); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), fields, new object[][] { new object[] { "E7" } }, new object[][] { new object[] { "E3" }, new object[] { "E4" }, new object[] { "E5" }, new object[] { "E6" } }); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E9", "0:00:00.000")); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E10", "8:04:04.999")); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E11", "8:04:05.000")); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), fields, new object[][] { new object[] { "E8" }, new object[] { "E9" }, new object[] { "E10" } }, new object[][] { new object[] { "E7" } }); stmt.Dispose(); }
private void RunAssertionExtBatchedNoReference(EPServiceProvider epService) { string[] fields = "id".Split(','); EPStatement stmt = epService.EPAdministrator.CreateEPL("select irstream * from MyEvent#ext_timed_batch(mytimestamp, 1 minute)"); var listener = new SupportUpdateListener(); stmt.Events += listener.Update; epService.EPRuntime.SendEvent(MyEvent.MakeTime("E1", "8:00:00.000")); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E2", "8:00:30.000")); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E3", "8:00:59.999")); Assert.IsFalse(listener.IsInvoked); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E4", "8:01:00.000")); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), fields, new object[][] { new object[] { "E1" }, new object[] { "E2" }, new object[] { "E3" } }, (object[][])null); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E5", "8:01:02.000")); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E6", "8:01:05.000")); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E7", "8:02:00.000")); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), fields, new object[][] { new object[] { "E4" }, new object[] { "E5" }, new object[] { "E6" } }, new object[][] { new object[] { "E1" }, new object[] { "E2" }, new object[] { "E3" } }); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E8", "8:03:59.000")); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), fields, new object[][] { new object[] { "E7" } }, new object[][] { new object[] { "E4" }, new object[] { "E5" }, new object[] { "E6" } }); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E9", "8:03:59.000")); Assert.IsFalse(listener.IsInvoked); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E10", "8:04:00.000")); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), fields, new object[][] { new object[] { "E8" }, new object[] { "E9" } }, new object[][] { new object[] { "E7" } }); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E11", "8:06:30.000")); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), fields, new object[][] { new object[] { "E10" } }, new object[][] { new object[] { "E8" }, new object[] { "E9" } }); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E12", "8:06:59.999")); Assert.IsFalse(listener.IsInvoked); epService.EPRuntime.SendEvent(MyEvent.MakeTime("E13", "8:07:00.001")); EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), fields, new object[][] { new object[] { "E11" }, new object[] { "E12" } }, new object[][] { new object[] { "E10" } }); stmt.Dispose(); }
private void AssertSize(SupportUpdateListener listener, long newSize, long oldSize) { EPAssertionUtil.AssertPropsPerRow(listener.AssertInvokedAndReset(), "size", new object[] { newSize }, new object[] { oldSize }); }
private void RunAssertionWithRefTime(String epl) { String[] fields = "id".Split(','); EPStatement stmt = _epService.EPAdministrator.CreateEPL(epl); stmt.Events += _listener.Update; _epService.EPRuntime.SendEvent(MyEvent.MakeTime("E1", "08:00:00.000")); _epService.EPRuntime.SendEvent(MyEvent.MakeTime("E2", "08:00:04.999")); Assert.IsFalse(_listener.IsInvoked); _epService.EPRuntime.SendEvent(MyEvent.MakeTime("E3", "08:00:05.000")); EPAssertionUtil.AssertPropsPerRow( _listener.AssertInvokedAndReset(), fields, new Object[][] { new Object[] { "E1" }, new Object[] { "E2" } }, null); _epService.EPRuntime.SendEvent(MyEvent.MakeTime("E4", "08:00:04.000")); _epService.EPRuntime.SendEvent(MyEvent.MakeTime("E5", "07:00:00.000")); _epService.EPRuntime.SendEvent(MyEvent.MakeTime("E6", "08:01:04.999")); Assert.IsFalse(_listener.IsInvoked); _epService.EPRuntime.SendEvent(MyEvent.MakeTime("E7", "08:01:05.000")); EPAssertionUtil.AssertPropsPerRow( _listener.AssertInvokedAndReset(), fields, new Object[][] { new Object[] { "E3" }, new Object[] { "E4" }, new Object[] { "E5" }, new Object[] { "E6" } }, new Object[][] { new Object[] { "E1" }, new Object[] { "E2" } }); _epService.EPRuntime.SendEvent(MyEvent.MakeTime("E8", "08:03:55.000")); EPAssertionUtil.AssertPropsPerRow( _listener.AssertInvokedAndReset(), fields, new Object[][] { new Object[] { "E7" } }, new Object[][] { new Object[] { "E3" }, new Object[] { "E4" }, new Object[] { "E5" }, new Object[] { "E6" } }); _epService.EPRuntime.SendEvent(MyEvent.MakeTime("E9", "00:00:00.000")); _epService.EPRuntime.SendEvent(MyEvent.MakeTime("E10", "08:04:04.999")); _epService.EPRuntime.SendEvent(MyEvent.MakeTime("E11", "08:04:05.000")); EPAssertionUtil.AssertPropsPerRow( _listener.AssertInvokedAndReset(), fields, new Object[][] { new Object[] { "E8" }, new Object[] { "E9" }, new Object[] { "E10" } }, new Object[][] { new Object[] { "E7" } }); stmt.Dispose(); }
private void AssertSize(long newSize, long oldSize) { EPAssertionUtil.AssertPropsPerRow(_listener.AssertInvokedAndReset(), "size", new Object[] { newSize }, new Object[] { oldSize }); }
private void AssertReceived(long?newTrendCount, long?oldTrendCount) { EPAssertionUtil.AssertPropsPerRow(_testListener.AssertInvokedAndReset(), "trendcount", new Object[] { newTrendCount }, new Object[] { oldTrendCount }); }
private void AssertReceived(SupportUpdateListener testListener, long newTrendCount, long?oldTrendCount) { EPAssertionUtil.AssertPropsPerRow(testListener.AssertInvokedAndReset(), "trendcount", new object[] { newTrendCount }, new object[] { oldTrendCount }); }