private void RunAssertionChainedStatic(EPServiceProvider epService)
        {
            var subexp        = "SupportChainTop.Make().GetChildOne(\"abc\",1).GetChildTwo(\"def\").GetText()";
            var statementText = "select " + subexp + " from SupportBean";
            var stmtOne       = epService.EPAdministrator.CreateEPL(statementText);
            var listener      = new SupportUpdateListener();

            stmtOne.Events += listener.Update;

            var rows = new object[][] {
                new object[] { subexp, typeof(string) }
            };

            for (var i = 0; i < rows.Length; i++)
            {
                var prop = stmtOne.EventType.PropertyDescriptors[i];
                Assert.AreEqual(rows[i][0], prop.PropertyName);
                Assert.AreEqual(rows[i][1], prop.PropertyType);
            }

            epService.EPRuntime.SendEvent(new SupportBean());
            EPAssertionUtil.AssertProps(listener.AssertOneGetNew(), new string[] { subexp },
                                        new object[] { SupportChainTop.Make().GetChildOne("abc", 1).GetChildTwo("def").GetText() });

            stmtOne.Dispose();
        }
Exemple #2
0
        public void TestChainedStatic()
        {
            _epService.EPAdministrator.Configuration.AddEventType("SupportBean", typeof(SupportBean));
            _epService.EPAdministrator.Configuration.AddEventType("SupportChainTop", typeof(SupportChainTop));
            _epService.EPAdministrator.Configuration.AddImport(typeof(SupportChainTop));

            var subexp = "SupportChainTop.Make().GetChildOne(\"abc\",1).GetChildTwo(\"def\").GetText()";

            _statementText = "select " + subexp + " from SupportBean";
            var stmtOne = _epService.EPAdministrator.CreateEPL(_statementText);

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

            var rows = new Object[][] {
                new Object[] { subexp, typeof(String) }
            };

            for (var i = 0; i < rows.Length; i++)
            {
                var prop = stmtOne.EventType.PropertyDescriptors[i];
                Assert.AreEqual(rows[i][0], prop.PropertyName);
                Assert.AreEqual(rows[i][1], prop.PropertyType);
            }

            _epService.EPRuntime.SendEvent(new SupportBean());
            EPAssertionUtil.AssertProps(_listener.AssertOneGetNew(), new String[] { subexp },
                                        new Object[] { SupportChainTop.Make().GetChildOne("abc", 1).GetChildTwo("def").GetText() });
        }
Exemple #3
0
            public void Run(RegressionEnvironment env)
            {
                var subexp = "SupportChainTop.Make().GetChildOne(\"abc\",1).GetChildTwo(\"def\").GetText()";
                var statementText = "@Name('s0') select " + subexp + " from SupportBean";
                env.CompileDeploy(statementText).AddListener("s0");

                object[][] rows = {
                    new object[] {subexp, typeof(string)}
                };
                var prop = env.Statement("s0").EventType.PropertyDescriptors;
                for (var i = 0; i < rows.Length; i++) {
                    Assert.AreEqual(rows[i][0], prop[i].PropertyName);
                    Assert.AreEqual(rows[i][1], prop[i].PropertyType);
                }

                env.SendEventBean(new SupportBean());
                EPAssertionUtil.AssertProps(
                    env.Listener("s0").AssertOneGetNew(),
                    new[] {subexp},
                    new object[] {SupportChainTop.Make().GetChildOne("abc", 1).GetChildTwo("def").Text});

                env.UndeployAll();
            }