private void RunAssertionSelectNested(string typename, FunctionSendEvent4Int send)
        {
            var epl = "select " +
                      "l1[0].lvl1 as c0, " +
                      "exists(l1[0].lvl1) as exists_c0, " +
                      "l1[0].l2[0].lvl2 as c1, " +
                      "exists(l1[0].l2[0].lvl2) as exists_c1, " +
                      "l1[0].l2[0].l3[0].lvl3 as c2, " +
                      "exists(l1[0].l2[0].l3[0].lvl3) as exists_c2, " +
                      "l1[0].l2[0].l3[0].l4[0].lvl4 as c3, " +
                      "exists(l1[0].l2[0].l3[0].l4[0].lvl4) as exists_c3 " +
                      "from `" + typename + '`';
            var statement = _epService.EPAdministrator.CreateEPL(epl);
            var listener  = new SupportUpdateListener();

            statement.AddListener(listener);
            var fields = "c0,exists_c0,c1,exists_c1,c2,exists_c2,c3,exists_c3".SplitCsv();

            foreach (var property in fields)
            {
                Assert.AreEqual(property.StartsWith("exists") ? typeof(bool?) : typeof(int?), TypeHelper.GetBoxedType(statement.EventType.GetPropertyType(property)));
            }

            send.Invoke(_epService, 1, 2, 3, 4);
            var @event = listener.AssertOneGetNewAndReset();

            EPAssertionUtil.AssertProps(@event, fields, new object[] { 1, true, 2, true, 3, true, 4, true });
            SupportEventTypeAssertionUtil.AssertConsistency(@event);

            send.Invoke(_epService, 10, 5, 50, 400);
            EPAssertionUtil.AssertProps(listener.AssertOneGetNewAndReset(), fields, new object[] { 10, true, 5, true, 50, true, 400, true });

            statement.Dispose();
        }
        private void RunAssertionSelectNested(
            RegressionEnvironment env,
            string typename,
            FunctionSendEvent4Int send,
            RegressionPath path)
        {
            var epl =
                "@Name('s0') select " +
                "L1.Lvl1 as c0, " +
                "exists(L1.Lvl1) as exists_c0, " +
                "L1.L2.Lvl2 as c1, " +
                "exists(L1.L2.Lvl2) as exists_c1, " +
                "L1.L2.L3.Lvl3 as c2, " +
                "exists(L1.L2.L3.Lvl3) as exists_c2, " +
                "L1.L2.L3.L4.Lvl4 as c3, " +
                "exists(L1.L2.L3.L4.Lvl4) as exists_c3 " +
                "from " +
                typename;

            env.CompileDeploy(epl, path).AddListener("s0");
            var fields = "c0,exists_c0,c1,exists_c1,c2,exists_c2,c3,exists_c3".SplitCsv();

            var eventType = env.Statement("s0").EventType;

            foreach (var property in fields)
            {
                Assert.AreEqual(property.StartsWith("exists") ? typeof(bool?) : typeof(int?), eventType.GetPropertyType(property).GetBoxedType());
            }

            send.Invoke(typename, env, 1, 2, 3, 4);
            var @event = env.Listener("s0").AssertOneGetNewAndReset();

            EPAssertionUtil.AssertProps(@event, fields, new object[] { 1, true, 2, true, 3, true, 4, true });
            SupportEventTypeAssertionUtil.AssertConsistency(@event);

            send.Invoke(typename, env, 10, 5, 50, 400);
            EPAssertionUtil.AssertProps(env.Listener("s0").AssertOneGetNewAndReset(), fields, new object[] { 10, true, 5, true, 50, true, 400, true });

            env.UndeployModuleContaining("s0");
        }
        private void RunAssertionBeanNav(string typename, FunctionSendEvent4Int send)
        {
            var epl       = "select * from " + typename;
            var statement = _epService.EPAdministrator.CreateEPL(epl);
            var listener  = new SupportUpdateListener();

            statement.AddListener(listener);

            send.Invoke(_epService, 1, 2, 3, 4);
            var @event = listener.AssertOneGetNewAndReset();

            EPAssertionUtil.AssertProps(@event, "l1.lvl1,l1.l2.lvl2,l1.l2.l3.lvl3,l1.l2.l3.l4.lvl4".SplitCsv(), new object[] { 1, 2, 3, 4 });
            SupportEventTypeAssertionUtil.AssertConsistency(@event);
            SupportEventTypeAssertionUtil.AssertFragments(@event, typename.Equals(BEAN_TYPENAME), false, "l1,l1.l2,l1.l2.l3,l1.l2.l3.l4");
            RunAssertionEventInvalidProp(@event);

            statement.Dispose();
        }
        private void RunAssertionBeanNav(
            RegressionEnvironment env,
            string typename,
            FunctionSendEvent4Int send,
            RegressionPath path)
        {
            var epl = "@Name('s0') select * from " + typename;

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

            send.Invoke(typename, env, 1, 2, 3, 4);
            var @event = env.Listener("s0").AssertOneGetNewAndReset();

            EPAssertionUtil.AssertProps(@event, "L1.Lvl1,L1.L2.Lvl2,L1.L2.L3.Lvl3,L1.L2.L3.L4.Lvl4".SplitCsv(), new object[] { 1, 2, 3, 4 });
            SupportEventTypeAssertionUtil.AssertConsistency(@event);
            var nativeFragment = typename.Equals(BEAN_TYPENAME) || typename.Equals(JSONPROVIDED_TYPENAME);

            SupportEventTypeAssertionUtil.AssertFragments(@event, nativeFragment, false, "L1.L2");
            SupportEventTypeAssertionUtil.AssertFragments(@event, nativeFragment, false, "L1,L1.L2,L1.L2.L3,L1.L2.L3.L4");
            RunAssertionEventInvalidProp(@event);

            env.UndeployModuleContaining("s0");
        }