public void start()
 {
     Configuration config = new Configuration();
     config.AddEventType(typeof(XtiveTag));
     this._epService = EPServiceProviderManager.GetDefaultProvider(config);
     this._epRuntime = this._epService.EPRuntime;
     this._epService.EPAdministrator.CreateEPL(this._epl1);
     try
     {
         this._statement = this._epService.EPAdministrator.CreateEPL(this._epl2);
     }
     catch (Exception e1)
     { }
     try
     {
         this._statement.AddEventHandlerWithReplay(new PrefilterListener(this._form).PrefilterEventHandler);
     }
     catch (Exception e1)
     { }
 }
Ejemplo n.º 2
0
        public void TryPermute(EPServiceProvider epService, bool soda, string pattern)
        {
            string epl = "select * from SupportBean " +
                         "match_recognize (" +
                         " partition by IntPrimitive" +
                         " measures A as a, B as b, C as c" +
                         " pattern (" + pattern + ")" +
                         " define" +
                         " A as A.TheString like \"A%\"," +
                         " B as B.TheString like \"B%\"," +
                         " C as C.TheString like \"C%\"" +
                         ")";
            EPStatement stmt     = SupportModelHelper.CreateByCompileOrParse(epService, soda, epl);
            var         listener = new SupportUpdateListener();

            stmt.Events += listener.Update;

            string[] prefixes = "A,B,C".Split(',');
            string[] fields   = "a,b,c".Split(',');
            var      e        = PermutationEnumerator.Create(3);
            int      count    = 0;

            foreach (var indexes in e)
            {
                var expected = new Object[3];
                for (int i = 0; i < 3; i++)
                {
                    expected[indexes[i]] = SendEvent(epService, prefixes[indexes[i]] + Convert.ToString(count), count);
                }
                count++;

                EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, expected);
            }

            stmt.Dispose();
        }
Ejemplo n.º 3
0
        public void TestNWOtherContextOnExpr()
        {
            _epService.EPAdministrator.CreateEPL("create context NineToFive as start (0, 9, *, *, *) end (0, 17, *, *, *)");
            _epService.EPAdministrator.CreateEPL("create context TenToFive as start (0, 10, *, *, *) end (0, 17, *, *, *)");

            // Trigger not in context
            EPStatement stmtNamedWindow = _epService.EPAdministrator.CreateEPL("context NineToFive create window MyWindow.win:keepall() as SupportBean");

            try {
                _epService.EPAdministrator.CreateEPL("on SupportBean_S0 s0 merge MyWindow mw when matched then Update set IntPrimitive = 1");
                Assert.Fail();
            }
            catch (EPStatementException ex) {
                Assert.AreEqual("Error starting statement: Cannot create on-trigger expression: Named window 'MyWindow' was declared with context 'NineToFive', please declare the same context name [on SupportBean_S0 s0 merge MyWindow mw when matched then Update set IntPrimitive = 1]", ex.Message);
            }

            // Trigger in different context
            try {
                _epService.EPAdministrator.CreateEPL("context TenToFive on SupportBean_S0 s0 merge MyWindow mw when matched then Update set IntPrimitive = 1");
                Assert.Fail();
            }
            catch (EPStatementException ex) {
                Assert.AreEqual("Error starting statement: Cannot create on-trigger expression: Named window 'MyWindow' was declared with context 'NineToFive', please use the same context instead [context TenToFive on SupportBean_S0 s0 merge MyWindow mw when matched then Update set IntPrimitive = 1]", ex.Message);
            }

            // Named window not in context, trigger in different context
            stmtNamedWindow.Dispose();
            _epService.EPAdministrator.CreateEPL("create window MyWindow.win:keepall() as SupportBean");
            try {
                _epService.EPAdministrator.CreateEPL("context TenToFive on SupportBean_S0 s0 merge MyWindow mw when matched then Update set IntPrimitive = 1");
                Assert.Fail();
            }
            catch (EPStatementException ex) {
                Assert.AreEqual("Error starting statement: Cannot create on-trigger expression: Named window 'MyWindow' was declared with context 'null', please use the same context instead [context TenToFive on SupportBean_S0 s0 merge MyWindow mw when matched then Update set IntPrimitive = 1]", ex.Message);
            }
        }
Ejemplo n.º 4
0
        public StockTickerMonitor(
            EPRuntime runtime,
            PriceLimit limit,
            StockTickerResultListener stockTickerResultListener)
        {
            _runtime = runtime;
            _limit   = limit;
            _stockTickerResultListener = stockTickerResultListener;

            var expressionText = "every Pricelimit=PriceLimit" +
                                 "(UserId='" +
                                 limit.UserId +
                                 "'," +
                                 "StockSymbol='" +
                                 limit.StockSymbol +
                                 "')";

            _newLimitListener         = runtime.DeployStatement(expressionText);
            _newLimitListener.Events += HandleNewLimitEvent;

            expressionText                = "tick=StockTick(StockSymbol='" + limit.StockSymbol + "')";
            _initialPriceListener         = runtime.DeployStatement(expressionText);
            _initialPriceListener.Events += HandleInitialPriceEvent;
        }
Ejemplo n.º 5
0
        private void RunAssertionTimeBatchRowForAllJoin(EPServiceProvider epService)
        {
            SendTimer(epService, 0);
            string      stmtText = "select irstream sum(price) as sumPrice from MarketData#time_batch(1 sec) as S0, SupportBean#keepall as S1 where S0.symbol = S1.TheString";
            EPStatement stmt     = epService.EPAdministrator.CreateEPL(stmtText);
            var         listener = new SupportUpdateListener();

            stmt.Events += listener.Update;

            SendSupportEvent(epService, "DELL");
            SendSupportEvent(epService, "IBM");

            // send first batch
            SendMDEvent(epService, "DELL", 10, 0L);
            SendMDEvent(epService, "IBM", 15, 0L);
            SendMDEvent(epService, "DELL", 20, 0L);
            SendTimer(epService, 1000);

            EventBean[] newEvents = listener.LastNewData;
            Assert.AreEqual(1, newEvents.Length);
            AssertEvent(newEvents[0], 45d);

            // send second batch
            SendMDEvent(epService, "IBM", 20, 600L);
            SendTimer(epService, 2000);

            newEvents = listener.LastNewData;
            Assert.AreEqual(1, newEvents.Length);
            AssertEvent(newEvents[0], 20d);

            EventBean[] oldEvents = listener.LastOldData;
            Assert.AreEqual(1, oldEvents.Length);
            AssertEvent(oldEvents[0], 45d);

            stmt.Dispose();
        }
Ejemplo n.º 6
0
        private void RunAssertionTimeBatchRowPerGroupNoJoin(EPServiceProvider epService)
        {
            SendTimer(epService, 0);
            string      stmtText = "select irstream symbol, sum(price) as sumPrice from MarketData#time_batch(1 sec) group by symbol order by symbol asc";
            EPStatement stmt     = epService.EPAdministrator.CreateEPL(stmtText);
            var         listener = new SupportUpdateListener();

            stmt.Events += listener.Update;

            // send first batch
            SendMDEvent(epService, "DELL", 10, 0L);
            SendMDEvent(epService, "IBM", 15, 0L);
            SendMDEvent(epService, "DELL", 20, 0L);
            SendTimer(epService, 1000);

            EventBean[] newEvents = listener.LastNewData;
            Assert.AreEqual(2, newEvents.Length);
            AssertEvent(newEvents[0], "DELL", 30d);
            AssertEvent(newEvents[1], "IBM", 15d);

            // send second batch
            SendMDEvent(epService, "IBM", 20, 600L);
            SendTimer(epService, 2000);

            newEvents = listener.LastNewData;
            Assert.AreEqual(2, newEvents.Length);
            AssertEvent(newEvents[0], "DELL", null);
            AssertEvent(newEvents[1], "IBM", 20d);

            EventBean[] oldEvents = listener.LastOldData;
            Assert.AreEqual(2, oldEvents.Length);
            AssertEvent(oldEvents[0], "DELL", 30d);
            AssertEvent(oldEvents[1], "IBM", 15d);

            stmt.Dispose();
        }
Ejemplo n.º 7
0
        public void TestSimpleIntAndEnumWrite()
        {
            String expr = "select * from " + typeof(SupportBean).FullName
                          + "(IntPrimitive in (1, 10))";
            EPStatement stmt = _epService.EPAdministrator.CreateEPL(expr);

            stmt.Events += _testListener.Update;

            SendBeanInt(10);
            Assert.IsTrue(_testListener.GetAndClearIsInvoked());
            SendBeanInt(11);
            Assert.IsFalse(_testListener.GetAndClearIsInvoked());
            SendBeanInt(1);
            Assert.IsTrue(_testListener.GetAndClearIsInvoked());
            stmt.Dispose();

            // try enum - ESPER-459
            ICollection <SupportEnum> types = new HashSet <SupportEnum>();

            types.Add(SupportEnum.ENUM_VALUE_2);
            EPPreparedStatement inPstmt = _epService.EPAdministrator.PrepareEPL(
                string.Format("select * from {0} ev where ev.EnumValue in (?)", typeof(SupportBean).FullName));

            inPstmt.SetObject(1, types);

            EPStatement inStmt = _epService.EPAdministrator.Create(inPstmt);

            inStmt.Events += _testListener.Update;

            var theEvent = new SupportBean();

            theEvent.EnumValue = SupportEnum.ENUM_VALUE_2;
            _epService.EPRuntime.SendEvent(theEvent);

            Assert.IsTrue(_testListener.IsInvoked);
        }
Ejemplo n.º 8
0
        public void TestSingleMaxSimple()
        {
            Configuration config = SupportConfigFactory.GetConfiguration();

            config.AddEventType("SupportBean_A", typeof(SupportBean_A));
            config.AddEventType("SupportBean_B", typeof(SupportBean_B));
            config.EngineDefaults.ConditionHandlingConfig.AddClass(typeof(SupportConditionHandlerFactory));

            _epService = EPServiceProviderManager.GetDefaultProvider(config);
            _epService.Initialize();
            ConditionHandlerFactoryContext context = SupportConditionHandlerFactory.FactoryContexts[0];

            Assert.AreEqual(_epService.URI, context.EngineURI);
            SupportConditionHandlerFactory.SupportConditionHandler handler = SupportConditionHandlerFactory.LastHandler;

            String      expression = "select a.id as a, b.id as b from pattern [every a=SupportBean_A -[2]> b=SupportBean_B]";
            EPStatement statement  = _epService.EPAdministrator.CreateEPL(expression);

            RunAssertionSingleMaxSimple(_epService, statement, handler);
            statement.Dispose();

            // test SODA
            EPStatementObjectModel model = _epService.EPAdministrator.CompileEPL(expression);

            Assert.AreEqual(expression, model.ToEPL());
            statement = _epService.EPAdministrator.Create(model);
            Assert.AreEqual(statement.Text, model.ToEPL());
            RunAssertionSingleMaxSimple(_epService, statement, handler);
            statement.Dispose();

            // test variable
            _epService.EPAdministrator.CreateEPL("create variable int myvar=3");
            expression = "select a.id as a, b.id as b from pattern [every a=SupportBean_A -[myvar-1]> b=SupportBean_B]";
            statement  = _epService.EPAdministrator.CreateEPL(expression);
            RunAssertionSingleMaxSimple(_epService, statement, handler);
        }
Ejemplo n.º 9
0
        private void RunAssertionMostLeastEvents(EPServiceProvider epService)
        {
            string[] fields      = "val0,val1".Split(',');
            string   eplFragment = "select " +
                                   "Contained.mostFrequent(x => p00) as val0," +
                                   "Contained.leastFrequent(x => p00) as val1 " +
                                   "from Bean";
            EPStatement stmtFragment = epService.EPAdministrator.CreateEPL(eplFragment);
            var         listener     = new SupportUpdateListener();

            stmtFragment.Events += listener.Update;
            LambdaAssertionUtil.AssertTypes(stmtFragment.EventType, fields, new Type[] { typeof(int?), typeof(int?) });

            SupportBean_ST0_Container bean = SupportBean_ST0_Container.Make2Value("E1,12", "E2,11", "E2,2", "E3,12");

            epService.EPRuntime.SendEvent(bean);
            EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, new object[] { 12, 11 });

            bean = SupportBean_ST0_Container.Make2Value("E1,12");
            epService.EPRuntime.SendEvent(bean);
            EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, new object[] { 12, 12 });

            bean = SupportBean_ST0_Container.Make2Value("E1,12", "E2,11", "E2,2", "E3,12", "E1,12", "E2,11", "E3,11");
            epService.EPRuntime.SendEvent(bean);
            EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, new object[] { 12, 2 });

            bean = SupportBean_ST0_Container.Make2Value("E2,11", "E1,12", "E2,15", "E3,12", "E1,12", "E2,11", "E3,11");
            epService.EPRuntime.SendEvent(bean);
            EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, new object[] { 11, 15 });

            epService.EPRuntime.SendEvent(SupportBean_ST0_Container.Make2Value(null));
            EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, new object[] { null, null });

            epService.EPRuntime.SendEvent(SupportBean_ST0_Container.Make2Value());
            EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, new object[] { null, null });
        }
Ejemplo n.º 10
0
        public void TestTransposeFunctionToStreamWithProps()
        {
            _epService.EPAdministrator.Configuration.AddEventType <SupportBean>();
            _epService.EPAdministrator.Configuration.AddPlugInSingleRowFunction("custom", typeof(SupportStaticMethodLib).FullName, "MakeSupportBean");

            String stmtTextOne = "insert into MyStream select 1 as dummy, Transpose(custom('O' || TheString, 10)) from SupportBean(TheString like 'I%')";

            _epService.EPAdministrator.CreateEPL(stmtTextOne);

            String      stmtTextTwo = "select * from MyStream";
            EPStatement stmt        = _epService.EPAdministrator.CreateEPL(stmtTextTwo);

            stmt.Events += _listener.Update;
            EventType type = stmt.EventType;

            Assert.AreEqual(typeof(Pair <object, DataMap>), type.UnderlyingType);

            _epService.EPRuntime.SendEvent(new SupportBean("I1", 1));
            EventBean result = _listener.AssertOneGetNewAndReset();
            Pair <object, DataMap> underlying = (Pair <object, DataMap>)result.Underlying;

            EPAssertionUtil.AssertProps(result, "dummy,TheString,IntPrimitive".Split(','), new Object[] { 1, "OI1", 10 });
            Assert.AreEqual("OI1", ((SupportBean)underlying.First).TheString);
        }
Ejemplo n.º 11
0
        public void TestTransposeEventJoinMap()
        {
            IDictionary <String, Object> metadata = MakeMap(new Object[][] { new Object[] { "id", typeof(string) } });

            _epService.EPAdministrator.Configuration.AddEventType("AEvent", metadata);
            _epService.EPAdministrator.Configuration.AddEventType("BEvent", metadata);

            String stmtTextOne = "insert into MyStream select a, b from AEvent.win:keepall() as a, BEvent.win:keepall() as b";

            _epService.EPAdministrator.CreateEPL(stmtTextOne);

            String      stmtTextTwo = "select a.id, b.id from MyStream";
            EPStatement stmt        = _epService.EPAdministrator.CreateEPL(stmtTextTwo);

            stmt.Events += _listener.Update;

            IDictionary <String, Object> eventOne = MakeMap(new Object[][] { new Object[] { "id", "A1" } });
            IDictionary <String, Object> eventTwo = MakeMap(new Object[][] { new Object[] { "id", "B1" } });

            _epService.EPRuntime.SendEvent(eventOne, "AEvent");
            _epService.EPRuntime.SendEvent(eventTwo, "BEvent");

            EPAssertionUtil.AssertProps(_listener.AssertOneGetNewAndReset(), "a.id,b.id".Split(','), new Object[] { "A1", "B1" });
        }
Ejemplo n.º 12
0
        public void TestNamedWindowSubquery()
        {
            string[] fields = "theString,totalPrice".Split(',');
            _epService.EPAdministrator.Configuration.AddEventType("OrderEvent", typeof(OrderBean));
            _epService.EPAdministrator.Configuration.AddEventType <SupportBean>();

            _epService.EPAdministrator.CreateEPL("create window OrderWindow.std:lastevent() as OrderEvent");
            _epService.EPAdministrator.CreateEPL("insert into OrderWindow select * from OrderEvent");

            string      stmtText = "select *, (select sum(price) from OrderWindow[books]) as totalPrice from SupportBean";
            EPStatement stmt     = _epService.EPAdministrator.CreateEPL(stmtText);

            stmt.AddListener(_listener);

            _epService.EPRuntime.SendEvent(TestContainedEventSimple.MakeEventOne());
            _epService.EPRuntime.SendEvent(new SupportBean("E1", 1));
            EPAssertionUtil.AssertPropsPerRow(_listener.LastNewData, fields, new object[][] { new object[] { "E1", 24d + 35d + 27d } });
            _listener.Reset();

            _epService.EPRuntime.SendEvent(TestContainedEventSimple.MakeEventFour());
            _epService.EPRuntime.SendEvent(new SupportBean("E2", 2));
            EPAssertionUtil.AssertPropsPerRow(_listener.LastNewData, fields, new object[][] { new object[] { "E2", 15d + 13d } });
            _listener.Reset();
        }
Ejemplo n.º 13
0
        public void TestWhere()
        {
            string[] fields = "reviewId".Split(',');
            _epService.EPAdministrator.Configuration.AddEventType("OrderEvent", typeof(OrderBean));

            // try where in root
            string      stmtText = "select reviewId from OrderEvent[books where title = 'Enders Game'][reviews] bookReviews order by reviewId asc";
            EPStatement stmt     = _epService.EPAdministrator.CreateEPL(stmtText);

            stmt.AddListener(_listener);

            _epService.EPRuntime.SendEvent(TestContainedEventSimple.MakeEventOne());
            EPAssertionUtil.AssertPropsPerRow(_listener.LastNewData, fields, new object[][] { new object[] { 1 }, new object[] { 2 } });
            _listener.Reset();

            // try where in different levels
            stmt.Dispose();
            stmtText = "select reviewId from OrderEvent[books where title = 'Enders Game'][reviews where reviewId in (1, 10)] bookReviews order by reviewId asc";
            stmt     = _epService.EPAdministrator.CreateEPL(stmtText);
            stmt.AddListener(_listener);

            _epService.EPRuntime.SendEvent(TestContainedEventSimple.MakeEventOne());
            EPAssertionUtil.AssertPropsPerRow(_listener.LastNewData, fields, new object[][] { new object[] { 1 } });
            _listener.Reset();

            // try where in combination
            stmt.Dispose();
            stmtText = "select reviewId from OrderEvent[books as bc][reviews as rw where rw.reviewId in (1, 10) and bc.title = 'Enders Game'] bookReviews order by reviewId asc";
            stmt     = _epService.EPAdministrator.CreateEPL(stmtText);
            stmt.AddListener(_listener);

            _epService.EPRuntime.SendEvent(TestContainedEventSimple.MakeEventOne());
            EPAssertionUtil.AssertPropsPerRow(_listener.LastNewData, fields, new object[][] { new object[] { 1 } });
            _listener.Reset();
            Assert.IsFalse(_listener.IsInvoked);
        }
Ejemplo n.º 14
0
        public void TestSelectWhereJoined3SceneTwo()
        {
            String stmtText = "select (select id from S0.win:length(1000) where p00=s1.p10 and p00=s3.p30 and p00=s2.p20) as ids0 " +
                              "from S1.win:keepall() as s1, S2.win:keepall() as s2, S3.win:keepall() as s3 where s1.id = s2.id and s2.id = s3.id";

            EPStatement stmt = _epService.EPAdministrator.CreateEPL(stmtText);

            stmt.Events += _listener.Update;

            _epService.EPRuntime.SendEvent(new SupportBean_S1(10, "s0_1"));
            _epService.EPRuntime.SendEvent(new SupportBean_S2(10, "s0_1"));
            _epService.EPRuntime.SendEvent(new SupportBean_S3(10, "s0_1"));
            Assert.IsNull(_listener.AssertOneGetNewAndReset().Get("ids0"));

            _epService.EPRuntime.SendEvent(new SupportBean_S0(99, "s0_1"));
            _epService.EPRuntime.SendEvent(new SupportBean_S1(11, "s0_1"));
            _epService.EPRuntime.SendEvent(new SupportBean_S2(11, "xxx"));
            _epService.EPRuntime.SendEvent(new SupportBean_S3(11, "s0_1"));
            Assert.IsNull(_listener.AssertOneGetNewAndReset().Get("ids0"));

            _epService.EPRuntime.SendEvent(new SupportBean_S0(98, "s0_2"));
            _epService.EPRuntime.SendEvent(new SupportBean_S1(12, "s0_x"));
            _epService.EPRuntime.SendEvent(new SupportBean_S2(12, "s0_2"));
            _epService.EPRuntime.SendEvent(new SupportBean_S3(12, "s0_1"));
            Assert.IsNull(_listener.AssertOneGetNewAndReset().Get("ids0"));

            _epService.EPRuntime.SendEvent(new SupportBean_S1(13, "s0_2"));
            _epService.EPRuntime.SendEvent(new SupportBean_S2(13, "s0_2"));
            _epService.EPRuntime.SendEvent(new SupportBean_S3(13, "s0_x"));
            Assert.IsNull(_listener.AssertOneGetNewAndReset().Get("ids0"));

            _epService.EPRuntime.SendEvent(new SupportBean_S1(14, "s0_2"));
            _epService.EPRuntime.SendEvent(new SupportBean_S2(14, "s0_2"));
            _epService.EPRuntime.SendEvent(new SupportBean_S3(14, "s0_2"));
            Assert.AreEqual(98, _listener.AssertOneGetNewAndReset().Get("ids0"));
        }
        public override void Run(EPServiceProvider epService)
        {
            epService.EPAdministrator.Configuration.AddEventType(typeof(MySimpleScheduleEvent));
            epService.EPAdministrator.Configuration.AddEventType <SupportBean_S0>();

            epService.EPRuntime.SendEvent(new CurrentTimeEvent(DateTimeParser.ParseDefaultMSec("2002-05-01T09:00:00.000")));
            epService.EPAdministrator.CreateEPL("create context MyCtx start MySimpleScheduleEvent as sse");
            EPStatement stmt = epService.EPAdministrator.CreateEPL("context MyCtx\n" +
                                                                   "select count(*) as c \n" +
                                                                   "from SupportBean_S0\n" +
                                                                   "output last At(context.sse.atminute, context.sse.athour, *, *, *, *) and when terminated\n");
            var listener = new SupportUpdateListener();

            stmt.Events += listener.Update;

            epService.EPRuntime.SendEvent(new MySimpleScheduleEvent(10, 15));
            epService.EPRuntime.SendEvent(new SupportBean_S0(0));

            epService.EPRuntime.SendEvent(new CurrentTimeEvent(DateTimeParser.ParseDefaultMSec("2002-05-01T10:14:59.000")));
            Assert.IsFalse(listener.GetAndClearIsInvoked());

            epService.EPRuntime.SendEvent(new CurrentTimeEvent(DateTimeParser.ParseDefaultMSec("2002-05-01T10:15:00.000")));
            Assert.IsTrue(listener.GetAndClearIsInvoked());
        }
Ejemplo n.º 16
0
        public void Test2Stream2HistStarSubordinate()
        {
            String expression;

            expression = "select s0.Id as ids0, s1.Id as ids1, h0.val as valh0, h1.val as valh1 " +
                         "from SupportBeanInt(id like 'S0%')#keepall as s0, " +
                         "SupportBeanInt(id like 'S1%')#lastevent as s1, " +
                         "method:SupportJoinMethods.FetchVal(s0.Id||'H1', s0.P00) as h0, " +
                         "method:SupportJoinMethods.FetchVal(s1.Id||'H2', s1.P00) as h1 " +
                         "order by s0.Id asc";

            EPStatement stmt = _epService.EPAdministrator.CreateEPL(expression);

            _listener    = new SupportUpdateListener();
            stmt.Events += _listener.Update;

            String[] fields = "ids0,ids1,valh0,valh1".Split(',');
            SendBeanInt("S00", 1);
            EPAssertionUtil.AssertPropsPerRowAnyOrder(stmt.GetEnumerator(), fields, null);
            Assert.IsFalse(_listener.IsInvoked);

            SendBeanInt("S10", 1);
            Object[][] resultOne = new Object[][] { new Object[] { "S00", "S10", "S00H11", "S10H21" } };
            EPAssertionUtil.AssertPropsPerRow(_listener.GetAndResetLastNewData(), fields, resultOne);
            EPAssertionUtil.AssertPropsPerRowAnyOrder(stmt.GetEnumerator(), fields, resultOne);

            SendBeanInt("S01", 1);
            Object[][] resultTwo = new Object[][] { new Object[] { "S01", "S10", "S01H11", "S10H21" } };
            EPAssertionUtil.AssertPropsPerRow(_listener.GetAndResetLastNewData(), fields, resultTwo);
            EPAssertionUtil.AssertPropsPerRowAnyOrder(stmt.GetEnumerator(), fields, EPAssertionUtil.ConcatenateArray2Dim(resultOne, resultTwo));

            SendBeanInt("S11", 1);
            Object[][] resultThree = new Object[][] { new Object[] { "S00", "S11", "S00H11", "S11H21" }, new Object[] { "S01", "S11", "S01H11", "S11H21" } };
            EPAssertionUtil.AssertPropsPerRow(_listener.GetAndResetLastNewData(), fields, resultThree);
            EPAssertionUtil.AssertPropsPerRowAnyOrder(stmt.GetEnumerator(), fields, EPAssertionUtil.ConcatenateArray2Dim(resultThree));
        }
Ejemplo n.º 17
0
        private void RunAssertionSeven(String expression)
        {
            EPStatement stmt = _epService.EPAdministrator.CreateEPL(expression);

            _listener    = new SupportUpdateListener();
            stmt.Events += _listener.Update;
            String[] fields = "valh0,valh1,valh2".Split(',');

            SendBeanInt("S00", 1, 1, 1);
            EPAssertionUtil.AssertPropsPerRowAnyOrder(stmt.GetEnumerator(), fields, new Object[][] { new Object[] { "H01", "H01-H11", "H01-H11-H21" } });

            SendBeanInt("S01", 0, 1, 1);
            EPAssertionUtil.AssertPropsPerRowAnyOrder(stmt.GetEnumerator(), fields, null);

            SendBeanInt("S02", 1, 1, 0);
            EPAssertionUtil.AssertPropsPerRowAnyOrder(stmt.GetEnumerator(), fields, null);

            SendBeanInt("S03", 1, 1, 2);
            EPAssertionUtil.AssertPropsPerRowAnyOrder(stmt.GetEnumerator(), fields, new Object[][] { new Object[] { "H01", "H01-H11", "H01-H11-H21" }, new Object[] { "H01", "H01-H11", "H01-H11-H22" } });

            SendBeanInt("S04", 2, 2, 1);
            Object[][] result = new Object[][] { new Object[] { "H01", "H01-H11", "H01-H11-H21" }, new Object[] { "H02", "H02-H11", "H02-H11-H21" }, new Object[] { "H01", "H01-H12", "H01-H12-H21" }, new Object[] { "H02", "H02-H12", "H02-H12-H21" } };
            EPAssertionUtil.AssertPropsPerRowAnyOrder(stmt.GetEnumerator(), fields, result);
        }
        public override void Run(EPServiceProvider epService)
        {
            var listener = new SupportUpdateListener();

            epService.EPAdministrator.Configuration.AddEventType <SupportBean>();

            string      epl     = "select * from SupportBean(IntPrimitive<10) where IntPrimitive not in (select IntPrimitive from SupportBean#unique(IntPrimitive))";
            EPStatement stmtOne = epService.EPAdministrator.CreateEPL(epl);

            stmtOne.Events += listener.Update;

            epService.EPRuntime.SendEvent(new SupportBean("E1", 5));
            Assert.IsTrue(listener.GetAndClearIsInvoked());

            stmtOne.Dispose();

            string      eplTwo  = "select * from SupportBean where IntPrimitive not in (select IntPrimitive from SupportBean(IntPrimitive<10)#unique(IntPrimitive))";
            EPStatement stmtTwo = epService.EPAdministrator.CreateEPL(eplTwo);

            stmtTwo.Events += listener.Update;

            epService.EPRuntime.SendEvent(new SupportBean("E1", 5));
            Assert.IsTrue(listener.GetAndClearIsInvoked());
        }
Ejemplo n.º 19
0
        private void RunAssertionOne(String expression)
        {
            EPStatement stmt = _epService.EPAdministrator.CreateEPL(expression);

            _listener    = new SupportUpdateListener();
            stmt.Events += _listener.Update;

            String[] fields = "id,valh0,valh1".Split(',');
            EPAssertionUtil.AssertPropsPerRowAnyOrder(stmt.GetEnumerator(), fields, null);

            SendBeanInt("E1", 20, 20, 3);
            EPAssertionUtil.AssertPropsPerRow(_listener.GetAndResetLastNewData(), fields, new Object[][] { new Object[] { "E1", "H03", "H13" } });
            EPAssertionUtil.AssertPropsPerRowAnyOrder(stmt.GetEnumerator(), fields, new Object[][] { new Object[] { "E1", "H03", "H13" } });

            SendBeanInt("E2", 20, 20, 21);
            EPAssertionUtil.AssertPropsPerRow(_listener.GetAndResetLastNewData(), fields, null);
            EPAssertionUtil.AssertPropsPerRowAnyOrder(stmt.GetEnumerator(), fields, new Object[][] { new Object[] { "E1", "H03", "H13" } });

            SendBeanInt("E3", 4, 4, 2);
            EPAssertionUtil.AssertPropsPerRow(_listener.GetAndResetLastNewData(), fields, new Object[][] { new Object[] { "E3", "H02", "H12" } });
            EPAssertionUtil.AssertPropsPerRowAnyOrder(stmt.GetEnumerator(), fields, new Object[][] { new Object[] { "E1", "H03", "H13" }, new Object[] { "E3", "H02", "H12" } });

            stmt.Dispose();
        }
Ejemplo n.º 20
0
        private void RunAssertionAllTypes(String typeName, Object[] events)
        {
            String graph = "create dataflow MySelect\n" +
                           "DefaultSupportSourceOp -> instream<" + typeName + ">{}\n" +
                           "Select(instream as ME) -> outstream {select: (select myString, sum(myInt) as total from ME)}\n" +
                           "DefaultSupportCaptureOp(outstream) {}";
            EPStatement stmtGraph = _epService.EPAdministrator.CreateEPL(graph);

            DefaultSupportSourceOp         source  = new DefaultSupportSourceOp(events);
            DefaultSupportCaptureOp        capture = new DefaultSupportCaptureOp(2);
            EPDataFlowInstantiationOptions options = new EPDataFlowInstantiationOptions();

            options.OperatorProvider(new DefaultSupportGraphOpProvider(source, capture));
            EPDataFlowInstance instance = _epService.EPRuntime.DataFlowRuntime.Instantiate("MySelect", options);

            instance.Run();

            Object[] result = capture.GetAndReset()[0].ToArray();
            EPAssertionUtil.AssertPropsPerRow(result, "myString,total".Split(','), new Object[][] { new Object[] { "one", 1 }, new Object[] { "two", 3 } });

            instance.Cancel();

            stmtGraph.Dispose();
        }
Ejemplo n.º 21
0
        private void TryJoinPassive2Stream(EPServiceProvider epService, string stmtText)
        {
            EPStatement stmt     = epService.EPAdministrator.CreateEPL(stmtText);
            var         listener = new SupportUpdateListener();

            stmt.Events += listener.Update;
            TryUnsupportedIterator(stmt);

            // send event, expect result
            SendEventMD(epService, "E1", 1L);
            string[] fields = "symbol,volume,TheString,IntPrimitive".Split(',');
            Assert.IsFalse(listener.IsInvoked);

            SendEvent(epService, "E1", 10);
            Assert.IsFalse(listener.IsInvoked);

            SendEventMD(epService, "E1", 2L);
            EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, new object[] { "E1", 2L, "E1", 10 });

            SendEvent(epService, "E1", 20);
            Assert.IsFalse(listener.IsInvoked);

            stmt.Dispose();
        }
Ejemplo n.º 22
0
        private void Try3TableOuterJoin(EPServiceProvider epService, EPStatement statement)
        {
            var listener = new SupportUpdateListener();

            statement.Events += listener.Update;
            string[] fields = "s0.id,s1.id,s2.id".Split(',');

            epService.EPRuntime.SendEvent(new SupportBean_S0(1, "E1"));
            EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, new object[] { 1, null, null });
            epService.EPRuntime.SendEvent(new SupportBean_S1(2, "E1"));
            epService.EPRuntime.SendEvent(new SupportBean_S2(3, "E1"));
            Assert.IsFalse(listener.IsInvoked);

            epService.EPRuntime.SendEvent(new SupportBean_S1(20, "E2"));
            epService.EPRuntime.SendEvent(new SupportBean_S0(10, "E2"));
            EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, new object[] { 10, 20, null });
            epService.EPRuntime.SendEvent(new SupportBean_S2(30, "E2"));
            Assert.IsFalse(listener.IsInvoked);

            epService.EPRuntime.SendEvent(new SupportBean_S2(300, "E3"));
            Assert.IsFalse(listener.IsInvoked);
            epService.EPRuntime.SendEvent(new SupportBean_S0(100, "E3"));
            EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, new object[] { 100, null, null });
            epService.EPRuntime.SendEvent(new SupportBean_S1(200, "E3"));
            Assert.IsFalse(listener.IsInvoked);

            epService.EPRuntime.SendEvent(new SupportBean_S2(31, "E4"));
            epService.EPRuntime.SendEvent(new SupportBean_S1(21, "E4"));
            Assert.IsFalse(listener.IsInvoked);
            epService.EPRuntime.SendEvent(new SupportBean_S0(11, "E4"));
            EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, new object[] { 11, 21, 31 });

            epService.EPRuntime.SendEvent(new SupportBean_S2(32, "E4"));
            epService.EPRuntime.SendEvent(new SupportBean_S1(22, "E4"));
            Assert.IsFalse(listener.IsInvoked);
        }
Ejemplo n.º 23
0
        public void TestNamedWindowOnTrigger()
        {
            string[] fields = "theString,intPrimitive".Split(',');
            _epService.EPAdministrator.Configuration.AddEventType("OrderEvent", typeof(OrderBean));
            _epService.EPAdministrator.Configuration.AddEventType <SupportBean>();

            _epService.EPAdministrator.CreateEPL("create window SupportBeanWindow.std:lastevent() as SupportBean");
            _epService.EPAdministrator.CreateEPL("insert into SupportBeanWindow select * from SupportBean");
            _epService.EPAdministrator.CreateEPL("create window OrderWindow.std:lastevent() as OrderEvent");
            _epService.EPAdministrator.CreateEPL("insert into OrderWindow select * from OrderEvent");

            string      stmtText = "on OrderWindow[books] owb select sbw.* from SupportBeanWindow sbw where theString = title";
            EPStatement stmt     = _epService.EPAdministrator.CreateEPL(stmtText);

            stmt.AddListener(_listener);

            _epService.EPRuntime.SendEvent(new SupportBean("E1", 1));
            _epService.EPRuntime.SendEvent(TestContainedEventSimple.MakeEventFour());
            Assert.IsFalse(_listener.IsInvoked);

            _epService.EPRuntime.SendEvent(new SupportBean("Foundation 2", 2));
            _epService.EPRuntime.SendEvent(TestContainedEventSimple.MakeEventFour());
            EPAssertionUtil.AssertPropsPerRow(_listener.LastNewData, fields, new object[][] { new object[] { "Foundation 2", 2 } });
        }
Ejemplo n.º 24
0
        public void TestVariable()
        {
            _epService.EPRuntime.SendEvent(new CurrentTimeEvent(0));
            _epService.EPAdministrator.CreateEPL("create variable bool KEEP = true");

            String[]    fields = { "TheString" };
            EPStatement stmt   = _epService.EPAdministrator.CreateEPL("select irstream * from SupportBean#expr(KEEP)");

            stmt.Events += _listener.Update;

            _epService.EPRuntime.SendEvent(new CurrentTimeEvent(1000));
            _epService.EPRuntime.SendEvent(new SupportBean("E1", 1));
            EPAssertionUtil.AssertPropsPerRow(stmt.GetEnumerator(), fields, new Object[][] { new Object[] { "E1" } });

            _epService.EPRuntime.SetVariableValue("KEEP", false);
            EPAssertionUtil.AssertPropsPerRow(stmt.GetEnumerator(), fields, new Object[][] { new Object[] { "E1" } });

            _listener.Reset();
            _epService.EPRuntime.SendEvent(new CurrentTimeEvent(1001));
            EPAssertionUtil.AssertProps(_listener.AssertOneGetOldAndReset(), fields, new Object[] { "E1" });
            Assert.IsFalse(stmt.HasFirst());

            _epService.EPRuntime.SendEvent(new SupportBean("E2", 2));
            EPAssertionUtil.AssertProps(_listener.LastNewData[0], fields, new Object[] { "E2" });
            EPAssertionUtil.AssertProps(_listener.LastOldData[0], fields, new Object[] { "E2" });
            _listener.Reset();
            Assert.IsFalse(stmt.HasFirst());

            _epService.EPRuntime.SetVariableValue("KEEP", true);

            _epService.EPRuntime.SendEvent(new SupportBean("E3", 3));
            EPAssertionUtil.AssertProps(_listener.AssertOneGetNewAndReset(), fields, new Object[] { "E3" });
            EPAssertionUtil.AssertPropsPerRow(stmt.GetEnumerator(), fields, new Object[][] { new Object[] { "E3" } });

            stmt.Stop();
        }
Ejemplo n.º 25
0
        public void TestAliases()
        {
            String statementString = "select Symbol as mySymbol, sum(Price) as mySum from " +
                                     typeof(SupportMarketDataBean).FullName + ".win:length(10) " +
                                     "output every 6 events " +
                                     "order by mySymbol";

            _testListener = new SupportUpdateListener();
            EPStatement statement = _epService.EPAdministrator.CreateEPL(statementString);

            statement.Events += _testListener.Update;

            SendEvent("IBM", 3);
            SendEvent("IBM", 4);
            SendEvent("CMU", 1);
            SendEvent("CMU", 2);
            SendEvent("CAT", 5);
            SendEvent("CAT", 6);

            String[] fields = "mySymbol,mySum".Split(',');
            EPAssertionUtil.AssertPropsPerRow(_testListener.LastNewData, fields, new Object[][] {
                new Object[] { "CAT", 15.0 }, new Object[] { "CAT", 21.0 }, new Object[] { "CMU", 8.0 }, new Object[] { "CMU", 10.0 }, new Object[] { "IBM", 3.0 }, new Object[] { "IBM", 7.0 }
            });
        }
Ejemplo n.º 26
0
        public void TestAggregatedSelectUnaggregatedHaving()
        {
            // ESPER-571
            _epService.EPAdministrator.Configuration.AddEventType("SupportBean", typeof(SupportBean));
            String      epl  = "select max(IntPrimitive) as val from SupportBean.win:time(1) having max(IntPrimitive) > IntBoxed";
            EPStatement stmt = _epService.EPAdministrator.CreateEPL(epl);

            stmt.Events += _testListener.Update;

            SendEvent("E1", 10, 1);
            Assert.AreEqual(10, _testListener.AssertOneGetNewAndReset().Get("val"));

            SendEvent("E2", 10, 11);
            Assert.IsFalse(_testListener.IsInvoked);

            SendEvent("E3", 15, 11);
            Assert.AreEqual(15, _testListener.AssertOneGetNewAndReset().Get("val"));

            SendEvent("E4", 20, 11);
            Assert.AreEqual(20, _testListener.AssertOneGetNewAndReset().Get("val"));

            SendEvent("E5", 25, 25);
            Assert.IsFalse(_testListener.IsInvoked);
        }
Ejemplo n.º 27
0
        private void RunAssertionRelOp(EPServiceProvider epService)
        {
            // relational op tests handled by relational op unit test
            EPStatement stmt     = epService.EPAdministrator.CreateEPL("select * from SupportBeanNumeric where DecimalOne < 10 and BigInt > 10");
            var         listener = new SupportUpdateListener();

            stmt.Events += listener.Update;

            SendBigNumEvent(epService, 10, 10);
            Assert.IsFalse(listener.GetAndClearIsInvoked());

            SendBigNumEvent(epService, 11, 9);
            Assert.IsTrue(listener.GetAndClearIsInvoked());
            stmt.Dispose();

            stmt         = epService.EPAdministrator.CreateEPL("select * from SupportBeanNumeric where DecimalOne < 10.0");
            stmt.Events += listener.Update;

            SendBigNumEvent(epService, 0, 11);
            Assert.IsFalse(listener.GetAndClearIsInvoked());

            epService.EPRuntime.SendEvent(new SupportBeanNumeric(null, new decimal(9.999)));
            Assert.IsTrue(listener.GetAndClearIsInvoked());
            stmt.Dispose();

            // test float
            stmt         = epService.EPAdministrator.CreateEPL("select * from SupportBeanNumeric where floatOne < 10f and floatTwo > 10f");
            stmt.Events += listener.Update;

            epService.EPRuntime.SendEvent(new SupportBeanNumeric(true, 1f, 20f));
            Assert.IsTrue(listener.GetAndClearIsInvoked());
            epService.EPRuntime.SendEvent(new SupportBeanNumeric(true, 20f, 1f));
            Assert.IsFalse(listener.GetAndClearIsInvoked());

            stmt.Dispose();
        }
Ejemplo n.º 28
0
        private void RunAssert(EPStatement selectTestView)
        {
            String[] fields = new String[] { "LongPrimitive", "mySum" };

            // assert select result type
            Assert.AreEqual(typeof(long?), selectTestView.EventType.GetPropertyType("mySum"));
            EPAssertionUtil.AssertPropsPerRowAnyOrder(selectTestView.GetEnumerator(), fields, null);

            SendEvent(10);
            Assert.AreEqual(10L, _testListener.GetAndResetLastNewData()[0].Get("mySum"));
            EPAssertionUtil.AssertPropsPerRowAnyOrder(selectTestView.GetEnumerator(), fields, new Object[][] { new Object[] { 1L, 10L } });

            SendEvent(15);
            Assert.AreEqual(25L, _testListener.GetAndResetLastNewData()[0].Get("mySum"));
            EPAssertionUtil.AssertPropsPerRowAnyOrder(selectTestView.GetEnumerator(), fields, new Object[][] { new Object[] { 1L, 25L }, new Object[] { 2L, 25L } });

            SendEvent(-5);
            Assert.AreEqual(20L, _testListener.GetAndResetLastNewData()[0].Get("mySum"));
            Assert.IsNull(_testListener.LastOldData);
            EPAssertionUtil.AssertPropsPerRowAnyOrder(selectTestView.GetEnumerator(), fields, new Object[][] { new Object[] { 1L, 20L }, new Object[] { 2L, 20L }, new Object[] { 3L, 20L } });

            SendEvent(-2);
            Assert.AreEqual(8L, _testListener.LastOldData[0].Get("mySum"));
            Assert.AreEqual(8L, _testListener.GetAndResetLastNewData()[0].Get("mySum"));
            EPAssertionUtil.AssertPropsPerRowAnyOrder(selectTestView.GetEnumerator(), fields, new Object[][] { new Object[] { 4L, 8L }, new Object[] { 2L, 8L }, new Object[] { 3L, 8L } });

            SendEvent(100);
            Assert.AreEqual(93L, _testListener.LastOldData[0].Get("mySum"));
            Assert.AreEqual(93L, _testListener.GetAndResetLastNewData()[0].Get("mySum"));
            EPAssertionUtil.AssertPropsPerRowAnyOrder(selectTestView.GetEnumerator(), fields, new Object[][] { new Object[] { 4L, 93L }, new Object[] { 5L, 93L }, new Object[] { 3L, 93L } });

            SendEvent(1000);
            Assert.AreEqual(1098L, _testListener.LastOldData[0].Get("mySum"));
            Assert.AreEqual(1098L, _testListener.GetAndResetLastNewData()[0].Get("mySum"));
            EPAssertionUtil.AssertPropsPerRowAnyOrder(selectTestView.GetEnumerator(), fields, new Object[][] { new Object[] { 4L, 1098L }, new Object[] { 5L, 1098L }, new Object[] { 6L, 1098L } });
        }
Ejemplo n.º 29
0
        public void TestConflictingPropertyOrder()
        {
            var adapterSpec = new CSVInputAdapterSpec(new AdapterInputSource("regression/intsTitleRow.csv"),
                                                      "intsTitleRowEvent");

            adapterSpec.EventsPerSec        = 10;
            adapterSpec.PropertyOrder       = new[] { "intTwo", "intOne" };
            adapterSpec.IsUsingEngineThread = true;
            adapter = new CSVInputAdapter(epService, adapterSpec);

            const string statementText = "select * from intsTitleRowEvent#length(5)";
            EPStatement  statement     = epService.EPAdministrator.CreateEPL(statementText);

            statement.Events += listener.Update;

            adapter.Start();

            SendTimeEvent(100);

            Assert.IsTrue(listener.GetAndClearIsInvoked());
            Assert.AreEqual(1, listener.GetLastNewData().Length);
            Assert.AreEqual("1", listener.GetLastNewData()[0].Get("intTwo"));
            Assert.AreEqual("0", listener.GetLastNewData()[0].Get("intOne"));
        }
        public override void Run(EPServiceProvider epService)
        {
            foreach (var clazz in new Type[] { typeof(SupportBean), typeof(SupportBean_S0), typeof(SupportBean_S1), typeof(SupportBean_S2) })
            {
                epService.EPAdministrator.Configuration.AddEventType(clazz);
            }
            var currentTime = new AtomicLong(0);

            epService.EPRuntime.SendEvent(new CurrentTimeEvent(currentTime.Get()));

            epService.EPAdministrator.CreateEPL("@Name('create') create table MyTable as (\n" +
                                                "key string primary key, thesum sum(int))");
            epService.EPAdministrator.CreateEPL("@Name('select') into table MyTable " +
                                                "select sum(IntPrimitive) as thesum from SupportBean group by TheString");

            epService.EPRuntime.SendEvent(new SupportBean("E1", 10));
            epService.EPRuntime.SendEvent(new SupportBean("E2", 20));
            epService.EPRuntime.SendEvent(new SupportBean("E1", 30));
            epService.EPAdministrator.GetStatement("create").Dispose();

            EPStatement stmt     = epService.EPAdministrator.CreateEPL("select key, thesum from MyTable output snapshot every 1 seconds");
            var         listener = new SupportUpdateListener();

            stmt.Events += listener.Update;

            currentTime.Set(currentTime.Get() + 1000L);
            epService.EPRuntime.SendEvent(new CurrentTimeEvent(currentTime.Get()));
            EPAssertionUtil.AssertPropsPerRowAnyOrder(listener.GetAndResetLastNewData(), "key,thesum".Split(','),
                                                      new object[][] { new object[] { "E1", 40 }, new object[] { "E2", 20 } });

            currentTime.Set(currentTime.Get() + 1000L);
            epService.EPRuntime.SendEvent(new CurrentTimeEvent(currentTime.Get()));
            Assert.IsTrue(listener.IsInvoked);

            stmt.Dispose();
        }
Ejemplo n.º 31
0
        public void TestNamedWindow()
        {
            EPStatement stmtWindow = _engine.EPAdministrator.CreateEPL(
                "create window MyWindow#keepall as select TheString, LongPrimitive from " + typeof(SupportBean).FullName);

            _listenerWindow    = new SupportMTUpdateListener();
            stmtWindow.Events += _listenerWindow.Update;

            _engine.EPAdministrator.CreateEPL(
                "insert into MyWindow(TheString, LongPrimitive) " +
                " select Symbol, Volume \n" +
                " from " + typeof(SupportMarketDataBean).FullName);

            String stmtTextDelete = "on " + typeof(SupportBean_A).FullName + " as s0 delete from MyWindow as win where win.TheString = s0.Id";

            _engine.EPAdministrator.CreateEPL(stmtTextDelete);

            EPStatement stmtConsumer = _engine.EPAdministrator.CreateEPL("select irstream TheString, LongPrimitive from MyWindow");

            _listenerConsumer    = new SupportMTUpdateListener();
            stmtConsumer.Events += _listenerConsumer.Update;

            TrySend(4, 1000);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="StatementCreationEventArgs"/> class.
 /// </summary>
 /// <param name="instance">The instance.</param>
 /// <param name="statement">The statement.</param>
 public StatementCreationEventArgs(IEngineInstance instance, EPStatement statement)
 {
     Instance = instance;
     Statement = statement;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="EventPublisherArgs"/> class.
 /// </summary>
 /// <param name="runtime">The runtime.</param>
 /// <param name="statement">The statement.</param>
 public EventPublisherArgs(EPRuntime runtime, EPStatement statement)
 {
     Runtime = runtime;
     Statement = statement;
 }