Esempio n. 1
0
        private void RunAssertion <T>(
            EventRepresentationChoice eventRepresentationEnum,
            string additionalAnnotations,
            string typename,
            FunctionSendEvent send,
            Func <object, object> optionalValueConversion,
            IEnumerable <Pair <T, ValueWithExistsFlag> > tests,
            Type expectedPropertyType)
        {
            var stmtText = eventRepresentationEnum.GetAnnotationText() + additionalAnnotations + " select " +
                           "item.id? as myid, " +
                           "exists(item.id?) as exists_myid " +
                           "from " + typename;
            var stmt     = _epService.EPAdministrator.CreateEPL(stmtText);
            var listener = new SupportUpdateListener();

            stmt.AddListener(listener);

            Assert.AreEqual(expectedPropertyType, stmt.EventType.GetPropertyType("myid"));
            Assert.AreEqual(typeof(bool?), TypeHelper.GetBoxedType(stmt.EventType.GetPropertyType("exists_myid")));
            Assert.IsTrue(eventRepresentationEnum.MatchesClass(stmt.EventType.UnderlyingType));

            foreach (var pair in tests)
            {
                send.Invoke(_epService, pair.First);
                var @event = listener.AssertOneGetNewAndReset();
                SupportEventInfra.AssertValueMayConvert(@event, "myid", (ValueWithExistsFlag)pair.Second, optionalValueConversion);
            }

            stmt.Dispose();
        }
Esempio n. 2
0
        private void RunAssertion(
            EPServiceProvider epService, string typename, FunctionSendEvent send, Object @event)
        {
            string      epl       = "select * from " + typename;
            EPStatement statement = epService.EPAdministrator.CreateEPL(epl);
            var         listener  = new SupportUpdateListener();

            statement.Events += listener.Update;

            send.Invoke(epService, @event);

            EventBean eventBean = listener.AssertOneGetNewAndReset();

            JSONEventRenderer jsonEventRenderer = epService.EPRuntime.EventRenderer.GetJSONRenderer(statement.EventType);
            string            json = jsonEventRenderer.Render(eventBean).RegexReplaceAll("(\\s|\\n|\\t)", "");

            Assert.AreEqual("{\"MyInt\":1,\"MyString\":\"abc\",\"Nested\":{\"MyInsideInt\":10}}", json);

            XMLEventRenderer xmlEventRenderer = epService.EPRuntime.EventRenderer.GetXMLRenderer(statement.EventType);
            string           xml = xmlEventRenderer.Render("root", eventBean).RegexReplaceAll("(\\s|\\n|\\t)", "");

            Assert.AreEqual("<?xmlversion=\"1.0\"encoding=\"UTF-8\"?><root><MyInt>1</MyInt><MyString>abc</MyString><Nested><MyInsideInt>10</MyInsideInt></Nested></root>", xml);

            statement.Dispose();
        }
        private void RunAssertion(
            RegressionEnvironment env,
            string typename,
            FunctionSendEvent send,
            Func <object, object> optionalValueConversion,
            Pair <object, object>[] tests,
            Type expectedPropertyType,
            RegressionPath path)
        {
            var stmtText = "@Name('s0') select Id? as myid, exists(Id?) as exists_myid from " + typename;

            env.CompileDeploy(stmtText, path).AddListener("s0");

            Assert.AreEqual(expectedPropertyType, env.Statement("s0").EventType.GetPropertyType("myid"));
            Assert.AreEqual(typeof(bool?), env.Statement("s0").EventType.GetPropertyType("exists_myid"));

            foreach (var pair in tests)
            {
                send.Invoke(env, pair.First, typename);
                var @event = env.Listener("s0").AssertOneGetNewAndReset();
                SupportEventInfra.AssertValueMayConvert(@event, "myid", (ValueWithExistsFlag)pair.Second, optionalValueConversion);
            }

            env.UndeployAll();
        }
        private void RunAssertion(EPServiceProvider epService,
                                  string typename,
                                  FunctionSendEvent send,
                                  object underlying)
        {
            RunAssertionTypeValidProp(epService, typename, underlying);
            RunAssertionTypeInvalidProp(epService, typename);

            string stmtText = "select * from " + typename;

            EPStatement stmt     = epService.EPAdministrator.CreateEPL(stmtText);
            var         listener = new SupportUpdateListener();

            stmt.Events += listener.Update;

            send.Invoke(epService, underlying);
            EventBean @event = listener.AssertOneGetNewAndReset();

            EventPropertyGetterMapped mappedGetter = @event.EventType.GetGetterMapped("mapped");

            Assert.AreEqual("v1", mappedGetter.Get(@event, "k1"));

            EventPropertyGetterIndexed indexedGetter = @event.EventType.GetGetterIndexed("indexed");

            Assert.AreEqual("v2", indexedGetter.Get(@event, 1));

            RunAssertionEventInvalidProp(@event);
            SupportEventTypeAssertionUtil.AssertConsistency(@event);

            stmt.Dispose();
        }
Esempio n. 5
0
        private void RunAssertion(string typename, FunctionSendEvent send, object @event)
        {
            var epl       = "select * from " + typename;
            var statement = _epService.EPAdministrator.CreateEPL(epl);
            var listener  = new SupportUpdateListener();

            statement.AddListener(listener);

            send.Invoke(_epService, @event);

            var eventBean = listener.AssertOneGetNewAndReset();

            var jsonEventRenderer = _epService.EPRuntime.EventRenderer.GetJSONRenderer(statement.EventType);
            var json         = jsonEventRenderer.Render(eventBean).RegexReplaceAll("(\\s|\\n|\\t)", "");
            var jsonExpected = string.Format("{{\"{0}\":1,\"{1}\":\"abc\",\"{2}\":{{\"{3}\":10}}}}",
                                             "myInt", "myString", "nested", "myInsideInt");

            Assert.AreEqual(jsonExpected, json);

            var xmlEventRenderer = _epService.EPRuntime.EventRenderer.GetXMLRenderer(statement.EventType);
            var xml         = xmlEventRenderer.Render("root", eventBean).RegexReplaceAll("(\\s|\\n|\\t)", "");
            var xmlExpected = string.Format("<?xmlversion=\"1.0\"encoding=\"UTF-8\"?><root><{0}>1</{0}><{1}>abc</{1}><{2}><{3}>10</{3}></{2}></root>",
                                            "myInt", "myString", "nested", "myInsideInt");

            Assert.AreEqual(xmlExpected, xml);

            statement.Dispose();
        }
        private void RunAssertion<T>(
            EPServiceProvider epService,
            string typename,
            FunctionSendEvent send,
            Func<object, object> optionalValueConversion,
            Pair<T, ValueWithExistsFlag>[] tests,
            Type expectedPropertyType)
        {
            var stmtText = "select id? as myid, Exists(id?) as exists_myid from " + typename;
            var stmt = epService.EPAdministrator.CreateEPL(stmtText);
            var listener = new SupportUpdateListener();
            stmt.Events += listener.Update;

            Assert.AreEqual(expectedPropertyType, stmt.EventType.GetPropertyType("myid"));
            Assert.AreEqual(typeof(bool?), stmt.EventType.GetPropertyType("exists_myid"));

            foreach (var pair in tests)
            {
                send.Invoke(epService, pair.First);
                var @event = listener.AssertOneGetNewAndReset();
                AssertValueMayConvert(@event, "myid", pair.Second, optionalValueConversion);
            }

            stmt.Dispose();
        }
        private void RunAssertion(
            RegressionEnvironment env,
            string typename,
            FunctionSendEvent send,
            object underlying,
            RegressionPath path)
        {
            RunAssertionTypeValidProp(env, typename, underlying);
            RunAssertionTypeInvalidProp(env, typename);

            var stmtText = "@Name('s0') select * from " + typename;

            env.CompileDeploy(stmtText, path).AddListener("s0");

            send.Invoke(env, underlying, typename);
            var @event = env.Listener("s0").AssertOneGetNewAndReset();

            var mappedGetter = @event.EventType.GetGetterMapped("Mapped");

            Assert.AreEqual("v1", mappedGetter.Get(@event, "k1"));

            var indexedGetter = @event.EventType.GetGetterIndexed("Indexed");

            Assert.AreEqual("v2", indexedGetter.Get(@event, 1));

            RunAssertionEventInvalidProp(@event);
            SupportEventTypeAssertionUtil.AssertConsistency(@event);

            env.UndeployAll();
        }
        private void RunAssertion(
            RegressionEnvironment env,
            EventRepresentationChoice eventRepresentationEnum,
            string additionalAnnotations,
            string typename,
            FunctionSendEvent send,
            Func<object, object> optionalValueConversion,
            Pair<object, object>[] tests,
            Type expectedPropertyType)
        {
            var stmtText = "@Name('s0') " +
                           eventRepresentationEnum.GetAnnotationText() +
                           additionalAnnotations +
                           " select " +
                           "Item.Id? as myId, " +
                           "exists(Item.Id?) as exists_myId " +
                           "from " +
                           typename;
            env.CompileDeploy(stmtText).AddListener("s0");

            var eventType = env.Statement("s0").EventType;
            Assert.AreEqual(expectedPropertyType, eventType.GetPropertyType("myId"));
            Assert.AreEqual(typeof(bool?), eventType.GetPropertyType("exists_myId").GetBoxedType());
            Assert.IsTrue(eventRepresentationEnum.MatchesClass(eventType.UnderlyingType));

            foreach (var pair in tests) {
                send.Invoke(env, pair.First, typename);
                var @event = env.Listener("s0").AssertOneGetNewAndReset();
                AssertValueMayConvert(@event, "myId", (ValueWithExistsFlag) pair.Second, optionalValueConversion);
            }

            env.UndeployAll();
        }
Esempio n. 9
0
        private void RunAssertion(
            RegressionEnvironment env,
            string typename,
            FunctionSendEvent send,
            object @event,
            RegressionPath path)
        {
            var epl = "@Name('s0') select * from " + typename;

            env.CompileDeploy(epl, path).AddListener("s0");
            send.Invoke(env, @event, typename);

            var eventBean = env.Listener("s0").AssertOneGetNewAndReset();

            var jsonEventRenderer = env.Runtime.RenderEventService.GetJSONRenderer(env.Statement("s0").EventType);
            var json = jsonEventRenderer.Render(eventBean).RegexReplaceAll("(\\s|\\n|\\t)", "");

            Assert.AreEqual("{\"MyInt\":1,\"MyString\":\"abc\",\"Nested\":{\"MyInsideInt\":10}}", json);

            var xmlEventRenderer = env.Runtime.RenderEventService.GetXMLRenderer(env.Statement("s0").EventType);
            var xml = xmlEventRenderer.Render("root", eventBean).RegexReplaceAll("(\\s|\\n|\\t)", "");

            Assert.AreEqual(
                "<?xmlversion=\"1.0\"encoding=\"UTF-8\"?><root><MyInt>1</MyInt><MyString>abc</MyString><Nested><MyInsideInt>10</MyInsideInt></Nested></root>",
                xml);

            env.UndeployAll();
        }
Esempio n. 10
0
 private void RunAssertion <T>(
     string typename,
     FunctionSendEvent send,
     Func <object, object> optionalValueConversion,
     Pair <T, ValueWithExistsFlag[]>[] tests,
     Type expectedPropertyType)
 {
     RunAssertionSelectNested(typename, send, optionalValueConversion, tests, expectedPropertyType);
     RunAssertionBeanNav(typename, send, tests[0].First);
 }
Esempio n. 11
0
 private void RunAssertion(
     RegressionEnvironment env,
     string typename,
     FunctionSendEvent send,
     Func<object, object> optionalValueConversion,
     Pair<object, object>[] tests,
     Type expectedPropertyType)
 {
     RunAssertionSelectNested(env, typename, send, optionalValueConversion, tests, expectedPropertyType);
     RunAssertionBeanNav(env, typename, send, tests[0].First);
 }
        private void RunAssertion(string typename, FunctionSendEvent fsend, object underlying)
        {
            string                stmtText = "select intPrimitive from " + typename;
            EPStatement           stmt     = _epService.EPAdministrator.CreateEPL(stmtText);
            SupportUpdateListener listener = new SupportUpdateListener();

            stmt.AddListener(listener);

            fsend.Invoke(_epService, underlying);
            var n = listener.AssertOneGetNewAndReset().Get("intPrimitive").AsInt();

            Assert.AreEqual(10, n);

            stmt.Dispose();
        }
Esempio n. 13
0
        private void RunAssertionBeanNav(
            RegressionEnvironment env,
            string typename,
            FunctionSendEvent send,
            object underlyingComplete)
        {
            var stmtText = "@Name('s0') select * from " + typename;
            env.CompileDeploy(stmtText).AddListener("s0");

            send.Invoke(env, underlyingComplete, typename);
            var @event = env.Listener("s0").AssertOneGetNewAndReset();
            SupportEventTypeAssertionUtil.AssertConsistency(@event);

            env.UndeployAll();
        }
Esempio n. 14
0
        private void RunAssertionBeanNav(string typename, FunctionSendEvent send, object underlyingComplete)
        {
            var stmtText = "select * from " + typename;

            var stmt     = _epService.EPAdministrator.CreateEPL(stmtText);
            var listener = new SupportUpdateListener();

            stmt.AddListener(listener);

            send.Invoke(_epService, underlyingComplete);
            var @event = listener.AssertOneGetNewAndReset();

            SupportEventTypeAssertionUtil.AssertConsistency(@event);

            stmt.Dispose();
        }
        private void RunAssertionSelectNested <T>(
            EPServiceProvider epService, string typename,
            FunctionSendEvent send,
            Func <object, object> optionalValueConversion,
            Pair <T, ValueWithExistsFlag[]>[] tests,
            Type expectedPropertyType)
        {
            var stmtText = "select " +
                           " item.nested?.nestedValue as n1, " +
                           " exists(item.nested?.nestedValue) as exists_n1, " +
                           " item.nested?.nestedValue? as n2, " +
                           " exists(item.nested?.nestedValue?) as exists_n2, " +
                           " item.nested?.nestedNested.nestedNestedValue as n3, " +
                           " exists(item.nested?.nestedNested.nestedNestedValue) as exists_n3, " +
                           " item.nested?.nestedNested?.nestedNestedValue as n4, " +
                           " exists(item.nested?.nestedNested?.nestedNestedValue) as exists_n4, " +
                           " item.nested?.nestedNested.nestedNestedValue? as n5, " +
                           " exists(item.nested?.nestedNested.nestedNestedValue?) as exists_n5, " +
                           " item.nested?.nestedNested?.nestedNestedValue? as n6, " +
                           " exists(item.nested?.nestedNested?.nestedNestedValue?) as exists_n6 " +
                           " from " + typename;

            var stmt     = epService.EPAdministrator.CreateEPL(stmtText);
            var listener = new SupportUpdateListener();

            stmt.Events += listener.Update;

            var propertyNames = "n1,n2,n3,n4,n5,n6".Split(',');

            foreach (var propertyName in propertyNames)
            {
                Assert.AreEqual(expectedPropertyType, stmt.EventType.GetPropertyType(propertyName));
                Assert.AreEqual(typeof(bool?), stmt.EventType.GetPropertyType("exists_" + propertyName));
            }

            foreach (var pair in tests)
            {
                send.Invoke(epService, pair.First);
                var @event = listener.AssertOneGetNewAndReset();
                AssertValuesMayConvert(
                    @event, propertyNames, (ValueWithExistsFlag[])pair.Second, optionalValueConversion);
            }

            stmt.Dispose();
        }
Esempio n. 16
0
        private void RunAssertion <T>(
            EPServiceProvider epService,
            string typename,
            FunctionSendEvent send,
            Func <object, object> optionalValueConversion,
            Pair <T, ValueWithExistsFlag[]>[] tests,
            Type expectedPropertyType)
        {
            var stmtText = "select " +
                           "item?.indexed[0] as indexed1, " +
                           "exists(item?.indexed[0]) as exists_indexed1, " +
                           "item?.indexed[1]? as indexed2, " +
                           "exists(item?.indexed[1]?) as exists_indexed2, " +
                           "item?.arrayProperty[1]? as array, " +
                           "exists(item?.arrayProperty[1]?) as exists_array, " +
                           "item?.mapped('keyOne') as mapped1, " +
                           "exists(item?.mapped('keyOne')) as exists_mapped1, " +
                           "item?.mapped('keyTwo')? as mapped2,  " +
                           "exists(item?.mapped('keyTwo')?) as exists_mapped2,  " +
                           "item?.mapProperty('xOne')? as map, " +
                           "exists(item?.mapProperty('xOne')?) as exists_map " +
                           " from " + typename;

            var stmt     = epService.EPAdministrator.CreateEPL(stmtText);
            var listener = new SupportUpdateListener();

            stmt.Events += listener.Update;

            var propertyNames = "indexed1,indexed2,array,mapped1,mapped2,map".Split(',');

            foreach (var propertyName in propertyNames)
            {
                Assert.AreEqual(expectedPropertyType, stmt.EventType.GetPropertyType(propertyName));
                Assert.AreEqual(typeof(bool?), stmt.EventType.GetPropertyType("exists_" + propertyName));
            }

            foreach (var pair in tests)
            {
                send.Invoke(epService, pair.First);
                AssertValuesMayConvert(listener.AssertOneGetNewAndReset(), propertyNames, pair.Second, optionalValueConversion);
            }

            stmt.Dispose();
        }
Esempio n. 17
0
        private void RunAssertionSelectNested(
            RegressionEnvironment env,
            string typename,
            FunctionSendEvent send,
            Func<object, object> optionalValueConversion,
            Pair<object, object>[] tests,
            Type expectedPropertyType)
        {
            var stmtText = "@Name('s0') select " +
                           " Item.Nested?.NestedValue as n1, " +
                           " exists(Item.Nested?.NestedValue) as exists_n1, " +
                           " Item.Nested?.NestedValue? as n2, " +
                           " exists(Item.Nested?.NestedValue?) as exists_n2, " +
                           " Item.Nested?.NestedNested.NestedNestedValue as n3, " +
                           " exists(Item.Nested?.NestedNested.NestedNestedValue) as exists_n3, " +
                           " Item.Nested?.NestedNested?.NestedNestedValue as n4, " +
                           " exists(Item.Nested?.NestedNested?.NestedNestedValue) as exists_n4, " +
                           " Item.Nested?.NestedNested.NestedNestedValue? as n5, " +
                           " exists(Item.Nested?.NestedNested.NestedNestedValue?) as exists_n5, " +
                           " Item.Nested?.NestedNested?.NestedNestedValue? as n6, " +
                           " exists(Item.Nested?.NestedNested?.NestedNestedValue?) as exists_n6 " +
                           " from " +
                           typename;
            env.CompileDeploy(stmtText).AddListener("s0");

            var propertyNames = new [] { "n1","n2","n3","n4","n5","n6" };
            var eventType = env.Statement("s0").EventType;
            foreach (var propertyName in propertyNames) {
                Assert.AreEqual(expectedPropertyType, eventType.GetPropertyType(propertyName));
                Assert.AreEqual(typeof(bool?), eventType.GetPropertyType("exists_" + propertyName));
            }

            foreach (var pair in tests) {
                send.Invoke(env, pair.First, typename);
                var @event = env.Listener("s0").AssertOneGetNewAndReset();
                AssertValuesMayConvert(
                    @event,
                    propertyNames,
                    (ValueWithExistsFlag[]) pair.Second,
                    optionalValueConversion);
            }

            env.UndeployAll();
        }
Esempio n. 18
0
        private void RunAssertion(
            RegressionEnvironment env,
            string typename,
            FunctionSendEvent send,
            Func<object, object> optionalValueConversion,
            Pair<object, object>[] tests,
            Type expectedPropertyType)
        {
            var stmtText = "@Name('s0') select " +
                           "Item?.Indexed[0] as indexed1, " +
                           "exists(Item?.Indexed[0]) as exists_indexed1, " +
                           "Item?.Indexed[1]? as indexed2, " +
                           "exists(Item?.Indexed[1]?) as exists_indexed2, " +
                           "Item?.ArrayProperty[1]? as array, " +
                           "exists(Item?.ArrayProperty[1]?) as exists_array, " +
                           "Item?.Mapped('keyOne') as mapped1, " +
                           "exists(Item?.Mapped('keyOne')) as exists_mapped1, " +
                           "Item?.Mapped('keyTwo')? as mapped2,  " +
                           "exists(Item?.Mapped('keyTwo')?) as exists_mapped2,  " +
                           "Item?.MapProperty('xOne')? as map, " +
                           "exists(Item?.MapProperty('xOne')?) as exists_map " +
                           " from " +
                           typename;
            env.CompileDeploy(stmtText).AddListener("s0");

            var propertyNames = new [] { "indexed1","indexed2","array","mapped1","mapped2","map" };
            var eventType = env.Statement("s0").EventType;
            foreach (var propertyName in propertyNames) {
                Assert.AreEqual(expectedPropertyType, eventType.GetPropertyType(propertyName));
                Assert.AreEqual(typeof(bool?), eventType.GetPropertyType("exists_" + propertyName));
            }

            foreach (var pair in tests) {
                send.Invoke(env, pair.First, typename);
                AssertValuesMayConvert(
                    env.Listener("s0").AssertOneGetNewAndReset(),
                    propertyNames,
                    (ValueWithExistsFlag[]) pair.Second,
                    optionalValueConversion);
            }

            env.UndeployAll();
        }
        private void RunAssertion(
            RegressionEnvironment env,
            string typename,
            FunctionSendEvent send,
            Func <object, object> optionalValueConversion,
            Pair <object, object>[] tests,
            Type expectedPropertyType,
            RegressionPath path)
        {
            var stmtText =
                "@Name('s0') select " +
                "Indexed[0]? as Indexed1, " +
                "exists(Indexed[0]?) as exists_Indexed1, " +
                "Indexed[1]? as Indexed2, " +
                "exists(Indexed[1]?) as exists_Indexed2, " +
                "Mapped('keyOne')? as Mapped1, " +
                "exists(Mapped('keyOne')?) as exists_Mapped1, " +
                "Mapped('keyTwo')? as Mapped2,  " +
                "exists(Mapped('keyTwo')?) as exists_Mapped2  " +
                "from " + typename;

            env.CompileDeploy(stmtText, path).AddListener("s0");

            var propertyNames = "Indexed1,Indexed2,Mapped1,Mapped2".SplitCsv();
            var eventType     = env.Statement("s0").EventType;

            foreach (var propertyName in propertyNames)
            {
                Assert.AreEqual(expectedPropertyType, eventType.GetPropertyType(propertyName));
                Assert.AreEqual(typeof(bool?), eventType.GetPropertyType("exists_" + propertyName));
            }

            foreach (var pair in tests)
            {
                send.Invoke(env, pair.First, typename);
                var @event = env.Listener("s0").AssertOneGetNewAndReset();
                AssertValuesMayConvert(@event, propertyNames, (ValueWithExistsFlag[])pair.Second, optionalValueConversion);
            }

            env.UndeployAll();
        }
        private void RunAssertion <T>(
            string typename,
            FunctionSendEvent send,
            Func <object, object> optionalValueConversion,
            IEnumerable <Pair <T, ValueWithExistsFlag[]> > tests,
            Type expectedPropertyType)
        {
            string stmtText = "select " +
                              "indexed[0]? as indexed1, " +
                              "exists(indexed[0]?) as exists_indexed1, " +
                              "indexed[1]? as indexed2, " +
                              "exists(indexed[1]?) as exists_indexed2, " +
                              "mapped('keyOne')? as mapped1, " +
                              "exists(mapped('keyOne')?) as exists_mapped1, " +
                              "mapped('keyTwo')? as mapped2,  " +
                              "exists(mapped('keyTwo')?) as exists_mapped2  " +
                              "from " + typename;

            EPStatement           stmt     = _epService.EPAdministrator.CreateEPL(stmtText);
            SupportUpdateListener listener = new SupportUpdateListener();

            stmt.AddListener(listener);

            string[] propertyNames = "indexed1,indexed2,mapped1,mapped2".SplitCsv();
            foreach (string propertyName in propertyNames)
            {
                Assert.AreEqual(expectedPropertyType, stmt.EventType.GetPropertyType(propertyName));
                Assert.AreEqual(typeof(bool?), stmt.EventType.GetPropertyType("exists_" + propertyName));
            }

            foreach (var pair in tests)
            {
                send.Invoke(_epService, pair.First);
                EventBean @event = listener.AssertOneGetNewAndReset();
                SupportEventInfra.AssertValuesMayConvert(@event, propertyNames, (ValueWithExistsFlag[])pair.Second, optionalValueConversion);
            }

            stmt.Dispose();
        }
Esempio n. 21
0
        private void RunAssertion <T>(
            EPServiceProvider epService,
            string typename,
            FunctionSendEvent send,
            Func <object, object> optionalValueConversion,
            Pair <T, ValueWithExistsFlag[]>[] tests,
            Type expectedPropertyType)
        {
            string stmtText = "select " +
                              "simpleProperty? as simple, " +
                              "exists(simpleProperty?) as exists_simple, " +
                              "nested?.nestedValue as nested, " +
                              "exists(nested?.nestedValue) as exists_nested, " +
                              "nested?.nestedNested.nestedNestedValue as nestedNested, " +
                              "exists(nested?.nestedNested.nestedNestedValue) as exists_nestedNested " +
                              "from " + typename;
            EPStatement stmt     = epService.EPAdministrator.CreateEPL(stmtText);
            var         listener = new SupportUpdateListener();

            stmt.Events += listener.Update;

            string[] propertyNames = "simple,nested,nestedNested".Split(',');
            foreach (string propertyName in propertyNames)
            {
                Assert.AreEqual(expectedPropertyType, stmt.EventType.GetPropertyType(propertyName));
                Assert.AreEqual(typeof(bool?), stmt.EventType.GetPropertyType("exists_" + propertyName));
            }

            foreach (var pair in tests)
            {
                send.Invoke(epService, pair.First);
                SupportEventInfra.AssertValuesMayConvert(listener.AssertOneGetNewAndReset(), propertyNames, (ValueWithExistsFlag[])pair.Second, optionalValueConversion);
            }

            stmt.Dispose();
        }