Exemplo n.º 1
0
        private void RunAssertionJustWildcard(EPStatement stmt, SupportSubscriberRowByRowSpecificBase subscriber)
        {
            stmt.Subscriber = subscriber;
            var theEvent = new SupportBean("E2", 1);

            _epService.EPRuntime.SendEvent(theEvent);
            subscriber.AssertOneReceivedAndReset(stmt, new object[] { theEvent });
        }
Exemplo n.º 2
0
        private void RunAssertionWildcardWProps(EPStatement stmt, SupportSubscriberRowByRowSpecificBase subscriber)
        {
            stmt.Subscriber = subscriber;

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

            _epService.EPRuntime.SendEvent(s0);
            subscriber.AssertOneReceivedAndReset(stmt, new object[] { s0, 102, "xE1x" });
        }
Exemplo n.º 3
0
        private void RunAssertionEnum(EPStatement stmtEnum, SupportSubscriberRowByRowSpecificBase subscriber)
        {
            stmtEnum.Subscriber = subscriber;

            var theEvent = new SupportBeanWithEnum("abc", SupportEnum.ENUM_VALUE_1);

            _epService.EPRuntime.SendEvent(theEvent);
            subscriber.AssertOneReceivedAndReset(stmtEnum, new object[] { theEvent.TheString, theEvent.SupportEnum });
        }
Exemplo n.º 4
0
        private void RunAssertionNested(EPStatement stmt, SupportSubscriberRowByRowSpecificBase subscriber)
        {
            stmt.Subscriber = subscriber;

            var theEvent = SupportBeanComplexProps.MakeDefaultBean();

            _epService.EPRuntime.SendEvent(theEvent);
            subscriber.AssertOneReceivedAndReset(stmt, new object[] { theEvent.Nested, theEvent.Nested.NestedNested });
        }
Exemplo n.º 5
0
        private void RunAssertionStreamWildcardJoin(SupportSubscriberRowByRowSpecificBase subscriber)
        {
            var stmt = _epService.EPAdministrator.CreateEPL("select TheString || '<', s1.* as s1, s0.* as s0 from SupportBean#keepall as s0, SupportMarketDataBean#keepall as s1 where s0.TheString = s1.Symbol");

            stmt.Subscriber = subscriber;

            var s0 = new SupportBean("E1", 100);
            var s1 = new SupportMarketDataBean("E1", 0, 0L, "");

            _epService.EPRuntime.SendEvent(s0);
            _epService.EPRuntime.SendEvent(s1);
            subscriber.AssertOneReceivedAndReset(stmt, new object[] { "E1<", s1, s0 });

            stmt.Dispose();
        }
Exemplo n.º 6
0
        private void TryAssertionBindWildcardJoin(EPServiceProvider epService, SupportSubscriberRowByRowSpecificBase subscriber)
        {
            EPStatement stmt = epService.EPAdministrator.CreateEPL("select * from SupportBean#keepall as s0, SupportMarketDataBean#keepall as s1 where s0.TheString = s1.symbol");

            stmt.Subscriber = subscriber;

            var s0 = new SupportBean("E1", 100);
            var s1 = new SupportMarketDataBean("E1", 0, 0L, "");

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

            stmt.Dispose();
        }
Exemplo n.º 7
0
        private void RunAssertionWidening(EventRepresentationChoice eventRepresentationEnum, SupportSubscriberRowByRowSpecificBase subscriber)
        {
            var stmt = _epService.EPAdministrator.CreateEPL(eventRepresentationEnum.GetAnnotationText() + " select BytePrimitive, IntPrimitive, LongPrimitive, FloatPrimitive from SupportBean(TheString='E1')");

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

            var bean = new SupportBean();

            bean.TheString      = "E1";
            bean.BytePrimitive  = (byte)1;
            bean.IntPrimitive   = 2;
            bean.LongPrimitive  = 3;
            bean.FloatPrimitive = 4;
            _epService.EPRuntime.SendEvent(bean);
            subscriber.AssertOneReceivedAndReset(stmt, new object[] { 1, 2L, 3d, 4d });

            stmt.Dispose();
        }
Exemplo n.º 8
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();
        }
Exemplo n.º 9
0
 private void RunAssertionNullSelected(EPStatement stmt, SupportSubscriberRowByRowSpecificBase subscriber)
 {
     stmt.Subscriber = subscriber;
     _epService.EPRuntime.SendEvent(new SupportBean());
     subscriber.AssertOneReceivedAndReset(stmt, new object[] { null, null });
 }