Ejemplo n.º 1
0
            public void Run(RegressionEnvironment env)
            {
                var events = EventCollectionFactory.GetSetThreeExternalClock(0, 1000);
                var testCaseList = new CaseList();
                EventExpressionCase testCase;

                testCase = new EventExpressionCase(
                    "na=SupportBean_N -> nb=SupportBean_N(DoublePrimitive = na.DoublePrimitive)");
                testCase.Add("N6", "na", events.GetEvent("N1"), "nb", events.GetEvent("N6"));
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "na=SupportBean_N(IntPrimitive=87) -> nb=SupportBean_N(IntPrimitive > na.IntPrimitive)");
                testCase.Add("N8", "na", events.GetEvent("N3"), "nb", events.GetEvent("N8"));
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "na=SupportBean_N(IntPrimitive=87) -> nb=SupportBean_N(IntPrimitive < na.IntPrimitive)");
                testCase.Add("N4", "na", events.GetEvent("N3"), "nb", events.GetEvent("N4"));
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "na=SupportBean_N(IntPrimitive=66) -> every nb=SupportBean_N(IntPrimitive >= na.IntPrimitive)");
                testCase.Add("N3", "na", events.GetEvent("N2"), "nb", events.GetEvent("N3"));
                testCase.Add("N4", "na", events.GetEvent("N2"), "nb", events.GetEvent("N4"));
                testCase.Add("N8", "na", events.GetEvent("N2"), "nb", events.GetEvent("N8"));
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "na=SupportBean_N(BoolBoxed=false) -> every nb=SupportBean_N(BoolPrimitive = na.BoolPrimitive)");
                testCase.Add("N4", "na", events.GetEvent("N2"), "nb", events.GetEvent("N4"));
                testCase.Add("N5", "na", events.GetEvent("N2"), "nb", events.GetEvent("N5"));
                testCase.Add("N8", "na", events.GetEvent("N2"), "nb", events.GetEvent("N8"));
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "every na=SupportBean_N -> every nb=SupportBean_N(IntPrimitive=na.IntPrimitive)");
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "every na=SupportBean_N() -> every nb=SupportBean_N(DoublePrimitive=na.DoublePrimitive)");
                testCase.Add("N5", "na", events.GetEvent("N2"), "nb", events.GetEvent("N5"));
                testCase.Add("N6", "na", events.GetEvent("N1"), "nb", events.GetEvent("N6"));
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "every na=SupportBean_N(BoolBoxed=false) -> every nb=SupportBean_N(BoolBoxed=na.BoolBoxed)");
                testCase.Add("N5", "na", events.GetEvent("N2"), "nb", events.GetEvent("N5"));
                testCase.Add("N8", "na", events.GetEvent("N2"), "nb", events.GetEvent("N8"));
                testCase.Add("N8", "na", events.GetEvent("N5"), "nb", events.GetEvent("N8"));
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "na=SupportBean_N(BoolBoxed=false) -> nb=SupportBean_N(IntPrimitive<na.IntPrimitive)" +
                    " -> nc=SupportBean_N(IntPrimitive > nb.IntPrimitive)");
                testCase.Add(
                    "N6",
                    "na",
                    events.GetEvent("N2"),
                    "nb",
                    events.GetEvent("N5"),
                    "nc",
                    events.GetEvent("N6"));
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "na=SupportBean_N(IntPrimitive=86) -> nb=SupportBean_N(IntPrimitive<na.IntPrimitive)" +
                    " -> nc=SupportBean_N(IntPrimitive > na.IntPrimitive)");
                testCase.Add(
                    "N8",
                    "na",
                    events.GetEvent("N4"),
                    "nb",
                    events.GetEvent("N5"),
                    "nc",
                    events.GetEvent("N8"));
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "na=SupportBean_N(IntPrimitive=86) -> (nb=SupportBean_N(IntPrimitive<na.IntPrimitive)" +
                    " or nc=SupportBean_N(IntPrimitive > na.IntPrimitive))");
                testCase.Add("N5", "na", events.GetEvent("N4"), "nb", events.GetEvent("N5"), "nc", null);
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "na=SupportBean_N(IntPrimitive=86) -> (nb=SupportBean_N(IntPrimitive>na.IntPrimitive)" +
                    " or nc=SupportBean_N(IntBoxed < na.IntBoxed))");
                testCase.Add("N8", "na", events.GetEvent("N4"), "nb", events.GetEvent("N8"), "nc", null);
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "na=SupportBean_N(IntPrimitive=86) -> (nb=SupportBean_N(IntPrimitive>na.IntPrimitive)" +
                    " and nc=SupportBean_N(IntBoxed < na.IntBoxed))");
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "na=SupportBean_N() -> every nb=SupportBean_N(DoublePrimitive in [0:na.DoublePrimitive])");
                testCase.Add("N4", "na", events.GetEvent("N1"), "nb", events.GetEvent("N4"));
                testCase.Add("N6", "na", events.GetEvent("N1"), "nb", events.GetEvent("N6"));
                testCase.Add("N7", "na", events.GetEvent("N1"), "nb", events.GetEvent("N7"));
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "na=SupportBean_N() -> every nb=SupportBean_N(DoublePrimitive in (0:na.DoublePrimitive))");
                testCase.Add("N4", "na", events.GetEvent("N1"), "nb", events.GetEvent("N4"));
                testCase.Add("N7", "na", events.GetEvent("N1"), "nb", events.GetEvent("N7"));
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "na=SupportBean_N() -> every nb=SupportBean_N(IntPrimitive in (na.IntPrimitive:na.DoublePrimitive))");
                testCase.Add("N7", "na", events.GetEvent("N1"), "nb", events.GetEvent("N7"));
                testCaseList.AddTest(testCase);

                testCase = new EventExpressionCase(
                    "na=SupportBean_N() -> every nb=SupportBean_N(IntPrimitive in (na.IntPrimitive:60))");
                testCase.Add("N6", "na", events.GetEvent("N1"), "nb", events.GetEvent("N6"));
                testCase.Add("N7", "na", events.GetEvent("N1"), "nb", events.GetEvent("N7"));
                testCaseList.AddTest(testCase);

                var util = new PatternTestHarness(events, testCaseList, GetType());
                util.RunTest(env);
            }
Ejemplo n.º 2
0
        public void TestNumeric()
        {
            string EVENT = typeof(SupportBean_N).FullName;

            EventCollection     events       = EventCollectionFactory.GetSetThreeExternalClock(0, 1000);
            CaseList            testCaseList = new CaseList();
            EventExpressionCase testCase     = null;

            testCase = new EventExpressionCase("na=" + EVENT + " -> nb=" + EVENT + "(DoublePrimitive = na.DoublePrimitive)");
            testCase.Add("N6", "na", events.GetEvent("N1"), "nb", events.GetEvent("N6"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + EVENT + "(IntPrimitive=87) -> nb=" + EVENT + "(IntPrimitive > na.IntPrimitive)");
            testCase.Add("N8", "na", events.GetEvent("N3"), "nb", events.GetEvent("N8"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + EVENT + "(IntPrimitive=87) -> nb=" + EVENT + "(IntPrimitive < na.IntPrimitive)");
            testCase.Add("N4", "na", events.GetEvent("N3"), "nb", events.GetEvent("N4"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + EVENT + "(IntPrimitive=66) -> every nb=" + EVENT + "(IntPrimitive >= na.IntPrimitive)");
            testCase.Add("N3", "na", events.GetEvent("N2"), "nb", events.GetEvent("N3"));
            testCase.Add("N4", "na", events.GetEvent("N2"), "nb", events.GetEvent("N4"));
            testCase.Add("N8", "na", events.GetEvent("N2"), "nb", events.GetEvent("N8"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + EVENT + "(BoolBoxed=false) -> every nb=" + EVENT + "(BoolPrimitive = na.BoolPrimitive)");
            testCase.Add("N4", "na", events.GetEvent("N2"), "nb", events.GetEvent("N4"));
            testCase.Add("N5", "na", events.GetEvent("N2"), "nb", events.GetEvent("N5"));
            testCase.Add("N8", "na", events.GetEvent("N2"), "nb", events.GetEvent("N8"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("every na=" + EVENT + " -> every nb=" + EVENT + "(IntPrimitive=na.IntPrimitive)");
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("every na=" + EVENT + "() -> every nb=" + EVENT + "(DoublePrimitive=na.DoublePrimitive)");
            testCase.Add("N5", "na", events.GetEvent("N2"), "nb", events.GetEvent("N5"));
            testCase.Add("N6", "na", events.GetEvent("N1"), "nb", events.GetEvent("N6"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("every na=" + EVENT + "(BoolBoxed=false) -> every nb=" + EVENT + "(BoolBoxed=na.BoolBoxed)");
            testCase.Add("N5", "na", events.GetEvent("N2"), "nb", events.GetEvent("N5"));
            testCase.Add("N8", "na", events.GetEvent("N2"), "nb", events.GetEvent("N8"));
            testCase.Add("N8", "na", events.GetEvent("N5"), "nb", events.GetEvent("N8"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + EVENT + "(BoolBoxed=false) -> nb=" + EVENT + "(IntPrimitive<na.IntPrimitive)" +
                                               " -> nc=" + EVENT + "(IntPrimitive > nb.IntPrimitive)");
            testCase.Add("N6", "na", events.GetEvent("N2"), "nb", events.GetEvent("N5"), "nc", events.GetEvent("N6"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + EVENT + "(IntPrimitive=86) -> nb=" + EVENT + "(IntPrimitive<na.IntPrimitive)" +
                                               " -> nc=" + EVENT + "(IntPrimitive > na.IntPrimitive)");
            testCase.Add("N8", "na", events.GetEvent("N4"), "nb", events.GetEvent("N5"), "nc", events.GetEvent("N8"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + EVENT + "(IntPrimitive=86) -> (nb=" + EVENT + "(IntPrimitive<na.IntPrimitive)" +
                                               " or nc=" + EVENT + "(IntPrimitive > na.IntPrimitive))");
            testCase.Add("N5", "na", events.GetEvent("N4"), "nb", events.GetEvent("N5"), "nc", null);
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + EVENT + "(IntPrimitive=86) -> (nb=" + EVENT + "(IntPrimitive>na.IntPrimitive)" +
                                               " or nc=" + EVENT + "(IntBoxed < na.IntBoxed))");
            testCase.Add("N8", "na", events.GetEvent("N4"), "nb", events.GetEvent("N8"), "nc", null);
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + EVENT + "(IntPrimitive=86) -> (nb=" + EVENT + "(IntPrimitive>na.IntPrimitive)" +
                                               " and nc=" + EVENT + "(IntBoxed < na.IntBoxed))");
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + EVENT + "() -> every nb=" + EVENT + "(DoublePrimitive in [0:na.DoublePrimitive])");
            testCase.Add("N4", "na", events.GetEvent("N1"), "nb", events.GetEvent("N4"));
            testCase.Add("N6", "na", events.GetEvent("N1"), "nb", events.GetEvent("N6"));
            testCase.Add("N7", "na", events.GetEvent("N1"), "nb", events.GetEvent("N7"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + EVENT + "() -> every nb=" + EVENT + "(DoublePrimitive in (0:na.DoublePrimitive))");
            testCase.Add("N4", "na", events.GetEvent("N1"), "nb", events.GetEvent("N4"));
            testCase.Add("N7", "na", events.GetEvent("N1"), "nb", events.GetEvent("N7"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + EVENT + "() -> every nb=" + EVENT + "(IntPrimitive in (na.IntPrimitive:na.DoublePrimitive))");
            testCase.Add("N7", "na", events.GetEvent("N1"), "nb", events.GetEvent("N7"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + EVENT + "() -> every nb=" + EVENT + "(IntPrimitive in (na.IntPrimitive:60))");
            testCase.Add("N6", "na", events.GetEvent("N1"), "nb", events.GetEvent("N6"));
            testCase.Add("N7", "na", events.GetEvent("N1"), "nb", events.GetEvent("N7"));
            testCaseList.AddTest(testCase);

            PatternTestHarness util = new PatternTestHarness(events, testCaseList, GetType(), GetType().FullName);

            util.RunTest();
        }
Ejemplo n.º 3
0
        private void RunAssertionNumeric(EPServiceProvider epService)
        {
            string @event = typeof(SupportBean_N).FullName;

            EventCollection     events       = EventCollectionFactory.GetSetThreeExternalClock(0, 1000);
            var                 testCaseList = new CaseList();
            EventExpressionCase testCase;

            testCase = new EventExpressionCase("na=" + @event + " -> nb=" + @event + "(DoublePrimitive = na.DoublePrimitive)");
            testCase.Add("N6", "na", events.GetEvent("N1"), "nb", events.GetEvent("N6"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + @event + "(IntPrimitive=87) -> nb=" + @event + "(IntPrimitive > na.IntPrimitive)");
            testCase.Add("N8", "na", events.GetEvent("N3"), "nb", events.GetEvent("N8"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + @event + "(IntPrimitive=87) -> nb=" + @event + "(IntPrimitive < na.IntPrimitive)");
            testCase.Add("N4", "na", events.GetEvent("N3"), "nb", events.GetEvent("N4"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + @event + "(IntPrimitive=66) -> every nb=" + @event + "(IntPrimitive >= na.IntPrimitive)");
            testCase.Add("N3", "na", events.GetEvent("N2"), "nb", events.GetEvent("N3"));
            testCase.Add("N4", "na", events.GetEvent("N2"), "nb", events.GetEvent("N4"));
            testCase.Add("N8", "na", events.GetEvent("N2"), "nb", events.GetEvent("N8"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + @event + "(BoolBoxed=false) -> every nb=" + @event + "(BoolPrimitive = na.BoolPrimitive)");
            testCase.Add("N4", "na", events.GetEvent("N2"), "nb", events.GetEvent("N4"));
            testCase.Add("N5", "na", events.GetEvent("N2"), "nb", events.GetEvent("N5"));
            testCase.Add("N8", "na", events.GetEvent("N2"), "nb", events.GetEvent("N8"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("every na=" + @event + " -> every nb=" + @event + "(IntPrimitive=na.IntPrimitive)");
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("every na=" + @event + "() -> every nb=" + @event + "(DoublePrimitive=na.DoublePrimitive)");
            testCase.Add("N5", "na", events.GetEvent("N2"), "nb", events.GetEvent("N5"));
            testCase.Add("N6", "na", events.GetEvent("N1"), "nb", events.GetEvent("N6"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("every na=" + @event + "(BoolBoxed=false) -> every nb=" + @event + "(BoolBoxed=na.BoolBoxed)");
            testCase.Add("N5", "na", events.GetEvent("N2"), "nb", events.GetEvent("N5"));
            testCase.Add("N8", "na", events.GetEvent("N2"), "nb", events.GetEvent("N8"));
            testCase.Add("N8", "na", events.GetEvent("N5"), "nb", events.GetEvent("N8"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + @event + "(BoolBoxed=false) -> nb=" + @event + "(IntPrimitive<na.IntPrimitive)" +
                                               " -> nc=" + @event + "(IntPrimitive > nb.IntPrimitive)");
            testCase.Add("N6", "na", events.GetEvent("N2"), "nb", events.GetEvent("N5"), "nc", events.GetEvent("N6"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + @event + "(IntPrimitive=86) -> nb=" + @event + "(IntPrimitive<na.IntPrimitive)" +
                                               " -> nc=" + @event + "(IntPrimitive > na.IntPrimitive)");
            testCase.Add("N8", "na", events.GetEvent("N4"), "nb", events.GetEvent("N5"), "nc", events.GetEvent("N8"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + @event + "(IntPrimitive=86) -> (nb=" + @event + "(IntPrimitive<na.IntPrimitive)" +
                                               " or nc=" + @event + "(IntPrimitive > na.IntPrimitive))");
            testCase.Add("N5", "na", events.GetEvent("N4"), "nb", events.GetEvent("N5"), "nc", null);
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + @event + "(IntPrimitive=86) -> (nb=" + @event + "(IntPrimitive>na.IntPrimitive)" +
                                               " or nc=" + @event + "(IntBoxed < na.IntBoxed))");
            testCase.Add("N8", "na", events.GetEvent("N4"), "nb", events.GetEvent("N8"), "nc", null);
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + @event + "(IntPrimitive=86) -> (nb=" + @event + "(IntPrimitive>na.IntPrimitive)" +
                                               " and nc=" + @event + "(IntBoxed < na.IntBoxed))");
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + @event + "() -> every nb=" + @event + "(DoublePrimitive in [0:na.DoublePrimitive])");
            testCase.Add("N4", "na", events.GetEvent("N1"), "nb", events.GetEvent("N4"));
            testCase.Add("N6", "na", events.GetEvent("N1"), "nb", events.GetEvent("N6"));
            testCase.Add("N7", "na", events.GetEvent("N1"), "nb", events.GetEvent("N7"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + @event + "() -> every nb=" + @event + "(DoublePrimitive in (0:na.DoublePrimitive))");
            testCase.Add("N4", "na", events.GetEvent("N1"), "nb", events.GetEvent("N4"));
            testCase.Add("N7", "na", events.GetEvent("N1"), "nb", events.GetEvent("N7"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + @event + "() -> every nb=" + @event + "(IntPrimitive in (na.IntPrimitive:na.DoublePrimitive))");
            testCase.Add("N7", "na", events.GetEvent("N1"), "nb", events.GetEvent("N7"));
            testCaseList.AddTest(testCase);

            testCase = new EventExpressionCase("na=" + @event + "() -> every nb=" + @event + "(IntPrimitive in (na.IntPrimitive:60))");
            testCase.Add("N6", "na", events.GetEvent("N1"), "nb", events.GetEvent("N6"));
            testCase.Add("N7", "na", events.GetEvent("N1"), "nb", events.GetEvent("N7"));
            testCaseList.AddTest(testCase);

            var util = new PatternTestHarness(events, testCaseList, this.GetType());

            util.RunTest(epService);
        }