public void Run(RegressionEnvironment env) { var path = new RegressionPath(); var statementText = "insert into MyStream select map.mapOne as val1 from NestedMap#length(5)"; env.CompileDeploy(statementText, path); statementText = "@Name('s0') select val1 as a from MyStream"; env.CompileDeploy(statementText, path).AddListener("s0"); var testdata = GetTestData(); env.SendEventMap(testdata, "NestedMap"); // test all properties exist var fields = new [] { "a" }; var received = env.Listener("s0").AssertOneGetNewAndReset(); EPAssertionUtil.AssertProps( received, fields, new[] {EventMapCore.GetNestedKeyMap(testdata, "map", "mapOne")}); env.UndeployAll(); }
public void Run(RegressionEnvironment env) { var statementText = "@Name('s0') select " + "simple, object, " + "nodefmap, " + "map, " + "object.Id as a1, " + "nodefmap.key1? as a2, " + "nodefmap.key2? as a3, " + "nodefmap.key3?.key4 as a4, " + "map.objectOne as b1, " + "map.simpleOne as b2, " + "map.nodefmapOne.key2? as b3, " + "map.mapOne.simpleTwo? as b4, " + "map.objectOne.Indexed[1] as c1, " + "map.objectOne.Nested.NestedValue as c2," + "map.mapOne.simpleTwo as d1, " + "map.mapOne.objectTwo as d2, " + "map.mapOne.nodefmapTwo as d3, " + "map.mapOne.mapTwo as e1, " + "map.mapOne.mapTwo.simpleThree as e2, " + "map.mapOne.mapTwo.objectThree as e3, " + "map.mapOne.objectTwo.Array[1].Mapped('1ma').Value as f1, " + "map.mapOne.mapTwo.objectThree.Id as f2" + " from NestedMap#length(5)"; env.CompileDeploy(statementText).AddListener("s0"); var testdata = GetTestData(); env.SendEventMap(testdata, "NestedMap"); // test all properties exist var received = env.Listener("s0").AssertOneGetNewAndReset(); EPAssertionUtil.AssertProps( received, new [] { "simple","object","nodefmap","map" }, new[] {"abc", new SupportBean_A("A1"), testdata.Get("nodefmap"), testdata.Get("map")}); EPAssertionUtil.AssertProps( received, new [] { "a1","a2","a3","a4" }, new object[] {"A1", "val1", null, null}); EPAssertionUtil.AssertProps( received, new [] { "b1","b2","b3","b4" }, new[] {EventMapCore.GetNestedKeyMap(testdata, "map", "objectOne"), 10, "val2", 300}); EPAssertionUtil.AssertProps( received, new [] { "c1","c2" }, new object[] {2, "NestedValue"}); EPAssertionUtil.AssertProps( received, new [] { "d1","d2","d3" }, new[] { 300, EventMapCore.GetNestedKeyMap(testdata, "map", "mapOne", "objectTwo"), EventMapCore.GetNestedKeyMap(testdata, "map", "mapOne", "nodefmapTwo") }); EPAssertionUtil.AssertProps( received, new [] { "e1","e2","e3" }, new[] { EventMapCore.GetNestedKeyMap(testdata, "map", "mapOne", "mapTwo"), 4000L, new SupportBean_B("B1") }); EPAssertionUtil.AssertProps( received, new [] { "f1","f2" }, new object[] {"1ma0", "B1"}); // test partial properties exist testdata = GetTestDataThree(); env.SendEventMap(testdata, "NestedMap"); received = env.Listener("s0").AssertOneGetNewAndReset(); EPAssertionUtil.AssertProps( received, new [] { "simple","object","nodefmap","map" }, new[] {"abc", new SupportBean_A("A1"), testdata.Get("nodefmap"), testdata.Get("map")}); EPAssertionUtil.AssertProps( received, new [] { "a1","a2","a3","a4" }, new object[] {"A1", "val1", null, null}); EPAssertionUtil.AssertProps( received, new [] { "b1","b2","b3","b4" }, new[] {EventMapCore.GetNestedKeyMap(testdata, "map", "objectOne"), null, null, null}); EPAssertionUtil.AssertProps( received, new [] { "c1","c2" }, new object[] {null, null}); EPAssertionUtil.AssertProps( received, new [] { "d1","d2","d3" }, new[] { null, EventMapCore.GetNestedKeyMap(testdata, "map", "mapOne", "objectTwo"), EventMapCore.GetNestedKeyMap(testdata, "map", "mapOne", "nodefmapTwo") }); EPAssertionUtil.AssertProps( received, new [] { "e1","e2","e3" }, new[] {EventMapCore.GetNestedKeyMap(testdata, "map", "mapOne", "mapTwo"), 4000L, null}); EPAssertionUtil.AssertProps( received, new [] { "f1","f2" }, new object[] {"1ma0", null}); env.UndeployAll(); }