示例#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();
        }
        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();
        }
        public override void Run(EPServiceProvider epService)
        {
            epService.EPAdministrator.Configuration.AddEventType(BEAN_TYPE);
            AddMapEventType(epService);
            AddOAEventType(epService);
            AddAvroEventType(epService);

            RunAssertion(
                epService,
                BEAN_TYPE.Name,
                FBEAN,
                new MyIMEvent(new[] { "v1", "v2" }, Collections.SingletonMap("k1", "v1")));

            RunAssertion(
                epService,
                SupportEventInfra.MAP_TYPENAME,
                SupportEventInfra.FMAP,
                SupportEventInfra.TwoEntryMap("indexed", new[] { "v1", "v2" }, "mapped", Collections.SingletonMap("k1", "v1")));

            RunAssertion(
                epService,
                SupportEventInfra.OA_TYPENAME,
                SupportEventInfra.FOA,
                new object[] { new[] { "v1", "v2" }, Collections.SingletonMap("k1", "v1") });

            // Avro
            var datum = new GenericRecord(GetAvroSchema());

            datum.Put("indexed", Collections.List("v1", "v2"));
            datum.Put("mapped", Collections.SingletonMap("k1", "v1"));
            RunAssertion(epService, AVRO_TYPENAME, FAVRO, datum);
        }
        private void RunAssertion <T>(
            string typename,
            FunctionSendEvent send,
            Func <object, object> optionalValueConversion,
            IEnumerable <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.AddListener(listener);

            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();
                SupportEventInfra.AssertValueMayConvert(@event, "myid", (ValueWithExistsFlag)pair.Second, optionalValueConversion);
            }

            stmt.Dispose();
        }
        public void TestIt()
        {
            ValueWithExistsFlag[] NOT_EXISTS = ValueWithExistsFlag.MultipleNotExists(4);

            // Bean
            SupportBeanComplexProps bean = SupportBeanComplexProps.MakeDefaultBean();
            var beanTests = new Pair <SupportBeanComplexProps, ValueWithExistsFlag[]>[] {
                new Pair <SupportBeanComplexProps, ValueWithExistsFlag[]>(bean, ValueWithExistsFlag.AllExist(bean.GetIndexed(0), bean.GetIndexed(1), bean.GetMapped("keyOne"), bean.GetMapped("keyTwo")))
            };

            RunAssertion(BEAN_TYPE.Name, SupportEventInfra.FBEAN, null, beanTests, typeof(object));

            // Map
            var mapTests = new Pair <IDictionary <string, object>, ValueWithExistsFlag[]>[] {
                new Pair <IDictionary <string, object>, ValueWithExistsFlag[]>(Collections.SingletonDataMap("somekey", "10"), NOT_EXISTS),
                new Pair <IDictionary <string, object>, ValueWithExistsFlag[]>(SupportEventInfra.TwoEntryMap("indexed", new int[] { 1, 2 }, "mapped", SupportEventInfra.TwoEntryMap("keyOne", 3, "keyTwo", 4)), ValueWithExistsFlag.AllExist(1, 2, 3, 4)),
            };

            RunAssertion(SupportEventInfra.MAP_TYPENAME, SupportEventInfra.FMAP, null, mapTests, typeof(object));

            // Object-Array
            var oaTests = new Pair <object[], ValueWithExistsFlag[]>[] {
                new Pair <object[], ValueWithExistsFlag[]>(new object[] { null, null }, NOT_EXISTS),
                new Pair <object[], ValueWithExistsFlag[]>(new object[] { new int[] { 1, 2 }, SupportEventInfra.TwoEntryMap("keyOne", 3, "keyTwo", 4) }, ValueWithExistsFlag.AllExist(1, 2, 3, 4)),
            };

            RunAssertion(SupportEventInfra.OA_TYPENAME, SupportEventInfra.FOA, null, oaTests, typeof(object));

            // XML
            var xmlTests = new Pair <string, ValueWithExistsFlag[]>[] {
                new Pair <string, ValueWithExistsFlag[]>("", NOT_EXISTS),
                new Pair <string, ValueWithExistsFlag[]>("<indexed>1</indexed><indexed>2</indexed><mapped id=\"keyOne\">3</mapped><mapped id=\"keyTwo\">4</mapped>", ValueWithExistsFlag.AllExist("1", "2", "3", "4"))
            };

            RunAssertion(SupportEventInfra.XML_TYPENAME, SupportEventInfra.FXML, SupportEventInfra.XML_TO_VALUE, xmlTests, typeof(XmlNode));

            // Avro
            var datumOne = new GenericRecord(SchemaBuilder.Record(SupportEventInfra.AVRO_TYPENAME));
            var datumTwo = new GenericRecord(GetAvroSchema());

            datumTwo.Put("indexed", Collections.List(1, 2));
            datumTwo.Put("mapped", SupportEventInfra.TwoEntryMap("keyOne", 3, "keyTwo", 4));
            var avroTests = new Pair <GenericRecord, ValueWithExistsFlag[]>[] {
                new Pair <GenericRecord, ValueWithExistsFlag[]>(datumOne, NOT_EXISTS),
                new Pair <GenericRecord, ValueWithExistsFlag[]>(datumTwo, ValueWithExistsFlag.AllExist(1, 2, 3, 4)),
            };

            RunAssertion(SupportEventInfra.AVRO_TYPENAME, SupportEventInfra.FAVRO, null, avroTests, typeof(object));
        }
示例#6
0
        private void RunAssertionSelectNested <T>(
            string typename,
            FunctionSendEvent send,
            Func <object, object> optionalValueConversion,
            IEnumerable <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.AddListener(listener);

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

            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();
                SupportEventInfra.AssertValuesMayConvert(@event, propertyNames, (ValueWithExistsFlag[])pair.Second, optionalValueConversion);
            }

            stmt.Dispose();
        }
示例#7
0
        private void RunAssertion <T>(
            string typename,
            FunctionSendEvent send,
            Func <object, object> optionalValueConversion,
            IEnumerable <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.AddListener(listener);

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

            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);
                SupportEventInfra.AssertValuesMayConvert(listener.AssertOneGetNewAndReset(), propertyNames, (ValueWithExistsFlag[])pair.Second, optionalValueConversion);
            }

            stmt.Dispose();
        }
示例#8
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();
        }
        public void TestIt()
        {
            RunAssertion(
                BEAN_TYPE.Name,
                SupportEventInfra.FBEAN,
                new MyIMEvent(new string[] { "v1", "v2" }, Collections.SingletonMap("k1", "v1")));

            RunAssertion(
                SupportEventInfra.MAP_TYPENAME,
                SupportEventInfra.FMAP,
                SupportEventInfra.TwoEntryMap("indexed", new string[] { "v1", "v2" }, "mapped", Collections.SingletonMap("k1", "v1")));

            RunAssertion(
                SupportEventInfra.OA_TYPENAME,
                SupportEventInfra.FOA,
                new object[] { new string[] { "v1", "v2" }, Collections.SingletonMap("k1", "v1") });

            // Avro
            GenericRecord datum = new GenericRecord(GetAvroSchema());

            datum.Put("indexed", Collections.List("v1", "v2"));
            datum.Put("mapped", Collections.SingletonMap("k1", "v1"));
            RunAssertion(SupportEventInfra.AVRO_TYPENAME, SupportEventInfra.FAVRO, datum);
        }
 private void AddMapEventType()
 {
     _epService.EPAdministrator.Configuration.AddEventType(SupportEventInfra.MAP_TYPENAME + "_4", Collections.SingletonDataMap("lvl4", typeof(int)));
     _epService.EPAdministrator.Configuration.AddEventType(SupportEventInfra.MAP_TYPENAME + "_3", SupportEventInfra.TwoEntryMap("l4", SupportEventInfra.MAP_TYPENAME + "_4[]", "lvl3", typeof(int)));
     _epService.EPAdministrator.Configuration.AddEventType(SupportEventInfra.MAP_TYPENAME + "_2", SupportEventInfra.TwoEntryMap("l3", SupportEventInfra.MAP_TYPENAME + "_3[]", "lvl2", typeof(int)));
     _epService.EPAdministrator.Configuration.AddEventType(SupportEventInfra.MAP_TYPENAME + "_1", SupportEventInfra.TwoEntryMap("l2", SupportEventInfra.MAP_TYPENAME + "_2[]", "lvl1", typeof(int)));
     _epService.EPAdministrator.Configuration.AddEventType(SupportEventInfra.MAP_TYPENAME, Collections.SingletonDataMap("l1", SupportEventInfra.MAP_TYPENAME + "_1[]"));
 }
示例#11
0
        public void TestIt()
        {
            var NOT_EXISTS = ValueWithExistsFlag.MultipleNotExists(3);

            // Bean
            var beanTests = new Pair <SupportMarkerInterface, ValueWithExistsFlag[]>[] {
                new Pair <SupportMarkerInterface, ValueWithExistsFlag[]>(SupportBeanComplexProps.MakeDefaultBean(), ValueWithExistsFlag.AllExist("Simple", "NestedValue", "NestedNestedValue")),
                new Pair <SupportMarkerInterface, ValueWithExistsFlag[]>(new SupportMarkerImplA("x"), NOT_EXISTS),
            };

            RunAssertion(BEAN_TYPE.Name, SupportEventInfra.FBEAN, null, beanTests, typeof(object));

            // Map
            var mapNestedNestedOne = Collections.SingletonDataMap("nestedNestedValue", 101);
            IDictionary <string, object> mapNestedOne = SupportEventInfra.TwoEntryMap("nestedNested", mapNestedNestedOne, "nestedValue", "abc");
            IDictionary <string, object> mapOne       = SupportEventInfra.TwoEntryMap("simpleProperty", 5, "nested", mapNestedOne);
            var mapTests = new Pair <IDictionary <string, object>, ValueWithExistsFlag[]>[] {
                new Pair <IDictionary <string, object>, ValueWithExistsFlag[]>(Collections.SingletonDataMap("simpleProperty", "a"), new ValueWithExistsFlag[] { ValueWithExistsFlag.Exists("a"), ValueWithExistsFlag.NotExists(), ValueWithExistsFlag.NotExists() }),
                new Pair <IDictionary <string, object>, ValueWithExistsFlag[]>(mapOne, ValueWithExistsFlag.AllExist(5, "abc", 101)),
            };

            RunAssertion(SupportEventInfra.MAP_TYPENAME, SupportEventInfra.FMAP, null, mapTests, typeof(object));

            // Object-Array
            var oaNestedNestedOne = new object[] { 101 };
            var oaNestedOne       = new object[] { "abc", oaNestedNestedOne };
            var oaOne             = new object[] { 5, oaNestedOne };
            var oaTests           = new Pair <object[], ValueWithExistsFlag[]>[] {
                new Pair <object[], ValueWithExistsFlag[]>(new object[] { "a", null }, new ValueWithExistsFlag[] { ValueWithExistsFlag.Exists("a"), ValueWithExistsFlag.NotExists(), ValueWithExistsFlag.NotExists() }),
                new Pair <object[], ValueWithExistsFlag[]>(oaOne, ValueWithExistsFlag.AllExist(5, "abc", 101)),
            };

            RunAssertion(SupportEventInfra.OA_TYPENAME, SupportEventInfra.FOA, null, oaTests, typeof(object));

            // XML
            var xmlTests = new Pair <string, ValueWithExistsFlag[]>[]
            {
                new Pair <string, ValueWithExistsFlag[]>(
                    "<simpleProperty>abc</simpleProperty>" +
                    "<nested nestedValue=\"100\">\n" +
                    "\t<nestedNested nestedNestedValue=\"101\">\n" +
                    "\t</nestedNested>\n" +
                    "</nested>\n", ValueWithExistsFlag.AllExist("abc", "100", "101")),
                new Pair <string, ValueWithExistsFlag[]>("<nested/>", NOT_EXISTS),
            };

            RunAssertion(SupportEventInfra.XML_TYPENAME, SupportEventInfra.FXML, SupportEventInfra.XML_TO_VALUE, xmlTests, typeof(XmlNode));

            // Avro
            var schema             = GetAvroSchema();
            var datumNull          = new GenericRecord(schema);
            var nestedSchema       = AvroSchemaUtil.FindUnionRecordSchemaSingle(schema.GetField("nested").Schema).AsRecordSchema();
            var nestedNestedSchema = AvroSchemaUtil.FindUnionRecordSchemaSingle(nestedSchema.GetField("nestedNested").Schema).AsRecordSchema();
            var nestedNestedDatum  = new GenericRecord(nestedNestedSchema);

            nestedNestedDatum.Put("nestedNestedValue", 101);
            var nestedDatum = new GenericRecord(nestedSchema);

            nestedDatum.Put("nestedValue", 100);
            nestedDatum.Put("nestedNested", nestedNestedDatum);
            var datumOne = new GenericRecord(schema);

            datumOne.Put("simpleProperty", "abc");
            datumOne.Put("nested", nestedDatum);

            var avroTests = new Pair <GenericRecord, ValueWithExistsFlag[]>[] {
                new Pair <GenericRecord, ValueWithExistsFlag[]>(new GenericRecord(SchemaBuilder.Record(SupportEventInfra.AVRO_TYPENAME)), NOT_EXISTS),
                new Pair <GenericRecord, ValueWithExistsFlag[]>(datumNull, new ValueWithExistsFlag[] { ValueWithExistsFlag.Exists(null), ValueWithExistsFlag.NotExists(), ValueWithExistsFlag.NotExists() }),
                new Pair <GenericRecord, ValueWithExistsFlag[]>(datumOne, ValueWithExistsFlag.AllExist("abc", 100, 101)),
            };

            RunAssertion(SupportEventInfra.AVRO_TYPENAME, SupportEventInfra.FAVRO, null, avroTests, typeof(object));
        }
示例#12
0
        public void TestIt()
        {
            var NOT_EXISTS = ValueWithExistsFlag.MultipleNotExists(6);

            // Bean
            SupportBeanComplexProps inner = SupportBeanComplexProps.MakeDefaultBean();
            var beanTests = new Pair <SupportBeanDynRoot, ValueWithExistsFlag[]>[] {
                new Pair <SupportBeanDynRoot, ValueWithExistsFlag[]>(new SupportBeanDynRoot("xxx"), NOT_EXISTS),
                new Pair <SupportBeanDynRoot, ValueWithExistsFlag[]>(new SupportBeanDynRoot(inner), ValueWithExistsFlag.AllExist(
                                                                         inner.GetIndexed(0),
                                                                         inner.GetIndexed(1),
                                                                         inner.ArrayProperty[1],
                                                                         inner.GetMapped("keyOne"),
                                                                         inner.GetMapped("keyTwo"),
                                                                         inner.MapProperty.Get("xOne"))),
            };

            RunAssertion(BEAN_TYPE.Name, SupportEventInfra.FBEAN, null, beanTests, typeof(object));

            // Map
            IDictionary <string, object> mapNestedOne = new Dictionary <string, object>();

            mapNestedOne.Put("indexed", new int[] { 1, 2 });
            mapNestedOne.Put("arrayProperty", null);
            mapNestedOne.Put("mapped", SupportEventInfra.TwoEntryMap("keyOne", 100, "keyTwo", 200));
            mapNestedOne.Put("mapProperty", null);
            var mapOne   = Collections.SingletonDataMap("item", mapNestedOne);
            var mapTests = new Pair <IDictionary <string, object>, ValueWithExistsFlag[]>[] {
                new Pair <IDictionary <string, object>, ValueWithExistsFlag[]>(Collections.EmptyDataMap, NOT_EXISTS),
                new Pair <IDictionary <string, object>, ValueWithExistsFlag[]>(mapOne, new ValueWithExistsFlag[]
                {
                    ValueWithExistsFlag.Exists(1),
                    ValueWithExistsFlag.Exists(2),
                    ValueWithExistsFlag.NotExists(),
                    ValueWithExistsFlag.Exists(100),
                    ValueWithExistsFlag.Exists(200),
                    ValueWithExistsFlag.NotExists()
                }),
            };

            RunAssertion(SupportEventInfra.MAP_TYPENAME, SupportEventInfra.FMAP, null, mapTests, typeof(object));

            // Object-Array
            var oaNestedOne = new object[] { new int[] { 1, 2 }, SupportEventInfra.TwoEntryMap("keyOne", 100, "keyTwo", 200), new int[] { 1000, 2000 }, Collections.SingletonMap("xOne", "abc") };
            var oaOne       = new object[] { null, oaNestedOne };
            var oaTests     = new Pair <object[], ValueWithExistsFlag[]>[] {
                new Pair <object[], ValueWithExistsFlag[]>(new object[] { null, null }, NOT_EXISTS),
                new Pair <object[], ValueWithExistsFlag[]>(oaOne, ValueWithExistsFlag.AllExist(1, 2, 2000, 100, 200, "abc")),
            };

            RunAssertion(SupportEventInfra.OA_TYPENAME, SupportEventInfra.FOA, null, oaTests, typeof(object));

            // XML
            var xmlTests = new Pair <string, ValueWithExistsFlag[]>[] {
                new Pair <string, ValueWithExistsFlag[]>("", NOT_EXISTS),
                new Pair <string, ValueWithExistsFlag[]>(
                    "<item>" +
                    "<indexed>1</indexed><indexed>2</indexed><mapped id=\"keyOne\">3</mapped><mapped id=\"keyTwo\">4</mapped>" +
                    "</item>", new ValueWithExistsFlag[]
                {
                    ValueWithExistsFlag.Exists("1"),
                    ValueWithExistsFlag.Exists("2"),
                    ValueWithExistsFlag.NotExists(),
                    ValueWithExistsFlag.Exists("3"),
                    ValueWithExistsFlag.Exists("4"),
                    ValueWithExistsFlag.NotExists()
                })
            };

            RunAssertion(SupportEventInfra.XML_TYPENAME, SupportEventInfra.FXML, SupportEventInfra.XML_TO_VALUE, xmlTests, typeof(XmlNode));

            // Avro
            var schema     = GetAvroSchema();
            var itemSchema = AvroSchemaUtil.FindUnionRecordSchemaSingle(schema.GetField("item").Schema).AsRecordSchema();
            var datumOne   = new GenericRecord(schema);

            datumOne.Put("item", null);
            var datumItemTwo = new GenericRecord(itemSchema);

            datumItemTwo.Put("indexed", Collections.List(1, 2));
            datumItemTwo.Put("mapped", SupportEventInfra.TwoEntryMap("keyOne", 3, "keyTwo", 4));
            var datumTwo = new GenericRecord(schema);

            datumTwo.Put("item", datumItemTwo);
            var avroTests = new Pair <GenericRecord, ValueWithExistsFlag[]>[] {
                new Pair <GenericRecord, ValueWithExistsFlag[]>(new GenericRecord(schema), NOT_EXISTS),
                new Pair <GenericRecord, ValueWithExistsFlag[]>(datumOne, NOT_EXISTS),
                new Pair <GenericRecord, ValueWithExistsFlag[]>(datumTwo, new ValueWithExistsFlag[]
                {
                    ValueWithExistsFlag.Exists(1),
                    ValueWithExistsFlag.Exists(2),
                    ValueWithExistsFlag.NotExists(),
                    ValueWithExistsFlag.Exists(3),
                    ValueWithExistsFlag.Exists(4),
                    ValueWithExistsFlag.NotExists()
                }),
            };

            RunAssertion(SupportEventInfra.AVRO_TYPENAME, SupportEventInfra.FAVRO, null, avroTests, typeof(object));
        }
 private void AddMapEventType()
 {
     _epService.EPAdministrator.Configuration.AddEventType(SupportEventInfra.MAP_TYPENAME, SupportEventInfra.TwoEntryMap("indexed", typeof(string[]), "mapped", typeof(IDictionary <string, string>)));
 }