Ejemplo n.º 1
0
            public void Run(RegressionEnvironment env)
            {
                var ns      = NamespaceGenerator.Create();
                var inlined = INLINEDCLASS_CONCAT.Replace("${NAMESPACE}", ns);

                var eplCreateInlined = "@Name('clazz') @public create " + inlined + ";\n";
                var path             = new RegressionPath();

                env.Compile(eplCreateInlined.Replace("builder.ToString()", "null"), path);

                var eplSelect      = "@Name('s0') select concat(TheString) as c0 from SupportBean";
                var compiledSelect = env.Compile(eplSelect, path);

                env.CompileDeploy(eplCreateInlined);
                env.Deploy(compiledSelect).AddListener("s0");

                SendAssertConcat(env, "A", "A");

                env.Milestone(0);

                SendAssertConcat(env, "B", "A,B");

                // assert dependencies
                SupportDeploymentDependencies.AssertSingle(env, "s0", "clazz", EPObjectType.CLASSPROVIDED, "ConcatAggForge");

                env.UndeployAll();
            }
Ejemplo n.º 2
0
            public void Run(RegressionEnvironment env)
            {
                var ns      = NamespaceGenerator.Create();
                var inlined = INLINEDCLASS_CONCAT.Replace("${NAMESPACE}", ns);
                var epl     = "@Name('s0')\n" + inlined + "select concat(TheString) as c0 from SupportBean";

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

                SendAssertConcat(env, "A", "A");
                SendAssertConcat(env, "B", "A,B");

                env.Milestone(0);

                SendAssertConcat(env, "C", "A,B,C");

                env.UndeployAll();
            }
Ejemplo n.º 3
0
            public void Run(RegressionEnvironment env)
            {
                var ns      = NamespaceGenerator.Create();
                var inlined = INLINEDCLASS_CONCAT.Replace("${NAMESPACE}", ns);

                var path      = new RegressionPath();
                var eplWindow = "create window MyWindow#keepall as (TheString string);\n" +
                                "on SupportBean merge MyWindow insert select TheString;\n";

                env.CompileDeploy(eplWindow, path);

                env.SendEventBean(new SupportBean("E1", 1));
                env.SendEventBean(new SupportBean("E2", 1));

                var eplFAF = inlined + "select concat(TheString) as c0 from MyWindow";
                var result = env.CompileExecuteFAF(eplFAF, path);

                Assert.AreEqual("E1,E2", result.Array[0].Get("c0"));

                env.UndeployAll();
            }
Ejemplo n.º 4
0
            public void Run(RegressionEnvironment env)
            {
                var ns      = NamespaceGenerator.Create();
                var inlined = INLINEDCLASS_CONCAT.Replace("${NAMESPACE}", ns);

                var eplTwiceLocal =
                    inlined.Replace("ConcatAggForge", "ConcatAggForgeOne") +
                    inlined.Replace("ConcatAggForge", "ConcatAggForgeTwo") +
                    "select concat(TheString) from SupportBean";

                TryInvalidCompile(
                    env,
                    eplTwiceLocal,
                    "The plug-in aggregation function 'concat' occurs multiple times");

                var eplTwiceCreate =
                    "create " + inlined.Replace("ConcatAggForge", "ConcatAggForgeOne") + ";\n" +
                    "create " + inlined.Replace("ConcatAggForge", "ConcatAggForgeTwo") + ";\n" +
                    "select concat(TheString) from SupportBean";

                TryInvalidCompile(
                    env,
                    eplTwiceCreate,
                    "The plug-in aggregation function 'concat' occurs multiple times");

                var path = new RegressionPath();

                env.Compile("@public create " + inlined.Replace("ConcatAggForge", "ConcatAggForgeOne"), path);
                env.Compile("@public create " + inlined.Replace("ConcatAggForge", "ConcatAggForgeTwo"), path);
                var eplTwiceInPath = "select concat(TheString) from SupportBean";

                TryInvalidCompile(
                    env,
                    path,
                    eplTwiceInPath,
                    "The plug-in aggregation function 'concat' occurs multiple times");
            }
Ejemplo n.º 5
0
            public void Run(RegressionEnvironment env)
            {
                var path    = new RegressionPath();
                var ns      = NamespaceGenerator.Create();
                var inlined = INLINEDCLASS_CONCAT.Replace("${NAMESPACE}", ns);

                foreach (var module in new string[] { "XXX", "YYY", "ZZZ" })
                {
                    var epl =
                        "module " + module + "; " +
                        "@public create " + inlined
                        .Replace("ConcatAggForge", $"ConcatAggForge{module}")
                        .Replace("builder.ToString()", $"\"{module}\"");
                    env.CompileDeploy(epl, path);
                }

                var eplSelect = "uses YYY; @Name('s0') select concat(TheString) as c0 from SupportBean";

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

                SendAssertConcat(env, "A", "YYY");

                env.UndeployAll();
            }