Exemple #1
0
        private void RunAssertionOutputLimitJoin(SupportSubscriberRowByRowSpecificBase subscriber)
        {
            var stmt = _epService.EPAdministrator.CreateEPL("select TheString, IntPrimitive from SupportBean#keepall, SupportMarketDataBean#keepall() where Symbol = TheString output every 2 events");

            stmt.Subscriber = subscriber;

            _epService.EPRuntime.SendEvent(new SupportMarketDataBean("E1", 0, 1L, ""));
            _epService.EPRuntime.SendEvent(new SupportBean("E1", 1));
            subscriber.AssertNoneReceived();

            _epService.EPRuntime.SendEvent(new SupportBean("E1", 2));
            subscriber.AssertMultipleReceivedAndReset(stmt, new object[][] { new object[] { "E1", 1 }, new object[] { "E1", 2 } });
            stmt.Dispose();
        }
Exemple #2
0
        private void RunAssertionRStreamSelect(SupportSubscriberRowByRowSpecificBase subscriber)
        {
            var stmt = _epService.EPAdministrator.CreateEPL("select rstream s0 from SupportBean#unique(TheString) as s0");

            stmt.Subscriber = subscriber;

            // send event
            var s0 = new SupportBean("E1", 100);

            _epService.EPRuntime.SendEvent(s0);
            subscriber.AssertNoneReceived();

            var s1 = new SupportBean("E2", 200);

            _epService.EPRuntime.SendEvent(s1);
            subscriber.AssertNoneReceived();

            var s2 = new SupportBean("E1", 300);

            _epService.EPRuntime.SendEvent(s2);
            subscriber.AssertOneReceivedAndReset(stmt, new object[] { s0 });

            stmt.Dispose();
        }
Exemple #3
0
        private void RunAssertionOutputLimitNoJoin(EventRepresentationChoice eventRepresentationEnum, SupportSubscriberRowByRowSpecificBase subscriber)
        {
            var stmt = _epService.EPAdministrator.CreateEPL(eventRepresentationEnum.GetAnnotationText() + " select TheString, IntPrimitive from SupportBean output every 2 events");

            stmt.Subscriber = subscriber;
            Assert.IsTrue(eventRepresentationEnum.MatchesClass(stmt.EventType.UnderlyingType));

            _epService.EPRuntime.SendEvent(new SupportBean("E1", 1));
            subscriber.AssertNoneReceived();

            _epService.EPRuntime.SendEvent(new SupportBean("E2", 2));
            subscriber.AssertMultipleReceivedAndReset(stmt, new object[][] { new object[] { "E1", 1 }, new object[] { "E2", 2 } });

            stmt.Dispose();
        }