예제 #1
0
        private void RunAsserts()
        {
            Object[] s0Events;
            Object[] s1Events;
            Object[] s2Events;
            Object[] s3Events;
            Object[] s4Events;
            Object[] s5Events;

            // Test s0 and s1=0, s2=0, s3=0, s4=0, s5=0
            //
            s0Events = SupportBean_S0.MakeS0("A", new String[] { "A-s0-1" });
            SendEvent(s0Events);
            Assert.IsFalse(updateListener.IsInvoked);

            // Test s0 and s1=1, s2=0, s3=0, s4=0, s5=0
            //
            s1Events = SupportBean_S1.MakeS1("B", new String[] { "B-s1-1" });
            SendEvent(s1Events);
            Assert.IsFalse(updateListener.IsInvoked);

            s0Events = SupportBean_S0.MakeS0("B", new String[] { "B-s0-1" });
            SendEvent(s0Events);
            Assert.IsFalse(updateListener.IsInvoked);

            // Test s0 and s1=1, s2=1, s3=0, s4=0, s5=0
            //
            s1Events = SupportBean_S1.MakeS1("C", new String[] { "C-s1-1" });
            SendEvent(s1Events);

            s2Events = SupportBean_S2.MakeS2("C", new String[] { "C-s2-1" });
            SendEvent(s2Events);
            Assert.IsFalse(updateListener.IsInvoked);

            s0Events = SupportBean_S0.MakeS0("C", new String[] { "C-s0-1" });
            SendEvent(s0Events);
            Assert.IsFalse(updateListener.IsInvoked);

            // Test s0 and s1=1, s2=1, s3=1, s4=0, s5=0
            //
            s1Events = SupportBean_S1.MakeS1("D", new String[] { "D-s1-1" });
            SendEvent(s1Events);

            s2Events = SupportBean_S2.MakeS2("D", new String[] { "D-s2-1" });
            SendEvent(s2Events);

            s3Events = SupportBean_S3.MakeS3("D", new String[] { "D-s2-1" });
            SendEvent(s3Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { null, s1Events[0], null, s3Events[0], null, null }
            }, GetAndResetNewEvents());

            s0Events = SupportBean_S0.MakeS0("D", new String[] { "D-s0-1" });
            SendEvent(s0Events);
            Assert.IsFalse(updateListener.IsInvoked);

            // Test s0 and s1=1, s2=1, s3=1, s4=1, s5=0
            //
            s1Events = SupportBean_S1.MakeS1("E", new String[] { "E-s1-1" });
            SendEvent(s1Events);

            s2Events = SupportBean_S2.MakeS2("E", new String[] { "E-s2-1" });
            SendEvent(s2Events);

            s3Events = SupportBean_S3.MakeS3("E", new String[] { "E-s2-1" });
            SendEvent(s3Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { null, s1Events[0], null, s3Events[0], null, null }
            }, GetAndResetNewEvents());

            s4Events = SupportBean_S4.MakeS4("E", new String[] { "E-s2-1" });
            SendEvent(s4Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { null, null, null, null, s4Events[0], null }
            }, GetAndResetNewEvents());

            s0Events = SupportBean_S0.MakeS0("E", new String[] { "E-s0-1" });
            SendEvent(s0Events);
            Assert.IsFalse(updateListener.IsInvoked);

            // Test s0 and s1=2, s2=1, s3=1, s4=1, s5=1
            //
            s1Events = SupportBean_S1.MakeS1("F", new String[] { "F-s1-1" });
            SendEvent(s1Events);
            Assert.IsFalse(updateListener.IsInvoked);

            s2Events = SupportBean_S2.MakeS2("F", new String[] { "F-s2-1" });
            SendEvent(s2Events);
            Assert.IsFalse(updateListener.IsInvoked);

            s3Events = SupportBean_S3.MakeS3("F", new String[] { "F-s3-1" });
            SendEvent(s3Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { null, s1Events[0], null, s3Events[0], null, null }
            }, GetAndResetNewEvents());

            s4Events = SupportBean_S4.MakeS4("F", new String[] { "F-s2-1" });
            SendEvent(s4Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { null, null, null, null, s4Events[0], null }
            }, GetAndResetNewEvents());

            s5Events = SupportBean_S5.MakeS5("F", new String[] { "F-s2-1" });
            SendEvent(s5Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { null, null, s2Events[0], null, s4Events[0], s5Events[0] }
            }, GetAndResetNewEvents());

            s0Events = SupportBean_S0.MakeS0("F", new String[] { "F-s0-1" });
            SendEvent(s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[0] }
            }, GetAndResetNewEvents());

            // Test s0 and s1=2, s2=2, s3=1, s4=1, s5=2
            //
            s1Events = SupportBean_S1.MakeS1("G", new String[] { "G-s1-1", "G-s1-2" });
            SendEventsAndReset(s1Events);

            s2Events = SupportBean_S2.MakeS2("G", new String[] { "G-s2-1", "G-s2-2" });
            SendEventsAndReset(s2Events);

            s3Events = SupportBean_S3.MakeS3("G", new String[] { "G-s3-1" });
            SendEventsAndReset(s3Events);

            s4Events = SupportBean_S4.MakeS4("G", new String[] { "G-s2-1" });
            SendEventsAndReset(s4Events);

            s5Events = SupportBean_S5.MakeS5("G", new String[] { "G-s5-1", "G-s5-2" });
            SendEventsAndReset(s5Events);

            s0Events = SupportBean_S0.MakeS0("G", new String[] { "G-s0-1" });
            SendEvent(s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[0], s5Events[1] }
            }, GetAndResetNewEvents());

            // Test s0 and s1=2, s2=2, s3=2, s4=2, s5=2
            //
            s1Events = SupportBean_S1.MakeS1("H", new String[] { "H-s1-1", "H-s1-2" });
            SendEventsAndReset(s1Events);

            s2Events = SupportBean_S2.MakeS2("H", new String[] { "H-s2-1", "H-s2-2" });
            SendEventsAndReset(s2Events);

            s3Events = SupportBean_S3.MakeS3("H", new String[] { "H-s3-1", "H-s3-2" });
            SendEventsAndReset(s3Events);

            s4Events = SupportBean_S4.MakeS4("H", new String[] { "H-s4-1", "H-s4-2" });
            SendEventsAndReset(s4Events);

            s5Events = SupportBean_S5.MakeS5("H", new String[] { "H-s5-1", "H-s5-2" });
            SendEventsAndReset(s5Events);

            s0Events = SupportBean_S0.MakeS0("H", new String[] { "H-s0-1" });
            SendEvent(s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[1], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[1], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[1], s5Events[1] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[1], s5Events[1] },
                new Object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[1], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[1], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[1], s5Events[1] },
                new Object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[1], s5Events[1] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[1], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[1], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[1], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[1], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[1], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[1], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[1], s5Events[1] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[1], s5Events[1] },
                new Object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[1], s4Events[1], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[1], s4Events[1], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[1], s4Events[1], s5Events[1] },
                new Object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[1], s4Events[1], s5Events[1] }
            }, GetAndResetNewEvents());

            // Test s0 and s1=2, s2=1, s3=1, s4=3, s5=1
            //
            s1Events = SupportBean_S1.MakeS1("I", new String[] { "I-s1-1", "I-s1-2" });
            SendEventsAndReset(s1Events);

            s2Events = SupportBean_S2.MakeS2("I", new String[] { "I-s2-1" });
            SendEventsAndReset(s2Events);

            s3Events = SupportBean_S3.MakeS3("I", new String[] { "I-s3-1" });
            SendEventsAndReset(s3Events);

            s4Events = SupportBean_S4.MakeS4("I", new String[] { "I-s4-1", "I-s4-2", "I-s4-3" });
            SendEventsAndReset(s4Events);

            s5Events = SupportBean_S5.MakeS5("I", new String[] { "I-s5-1" });
            SendEventsAndReset(s5Events);

            s0Events = SupportBean_S0.MakeS0("I", new String[] { "I-s0-1" });
            SendEvent(s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[1], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[2], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[1], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[2], s5Events[0] }
            }, GetAndResetNewEvents());

            // Test s1 and s3=0
            //
            s1Events = SupportBean_S1.MakeS1("J", new String[] { "J-s1-1" });
            SendEvent(s1Events);
            Assert.IsFalse(updateListener.IsInvoked);

            // Test s1 and s0=1, s2=0, s3=1, s4=1, s5=0
            //
            s0Events = SupportBean_S0.MakeS0("K", new String[] { "K-s0-1" });
            SendEvent(s0Events);

            s3Events = SupportBean_S3.MakeS3("K", new String[] { "K-s3-1" });
            SendEventsAndReset(s3Events);

            s1Events = SupportBean_S1.MakeS1("K", new String[] { "K-s1-1" });
            SendEvent(s1Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { null, s1Events[0], null, s3Events[0], null, null }
            }, GetAndResetNewEvents());

            // Test s1 and s0=1, s2=1, s3=1, s4=0, s5=1
            //
            s0Events = SupportBean_S0.MakeS0("L", new String[] { "L-s0-1" });
            SendEvent(s0Events);
            Assert.IsFalse(updateListener.IsInvoked);

            s2Events = SupportBean_S2.MakeS2("L", new String[] { "L-s2-1" });
            SendEvent(s2Events);
            Assert.IsFalse(updateListener.IsInvoked);

            s3Events = SupportBean_S3.MakeS3("L", new String[] { "L-s3-1" });
            SendEventsAndReset(s3Events);

            s5Events = SupportBean_S5.MakeS5("L", new String[] { "L-s5-1" });
            SendEventsAndReset(s5Events);

            s1Events = SupportBean_S1.MakeS1("L", new String[] { "L-s1-1" });
            SendEvent(s1Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { null, s1Events[0], null, s3Events[0], null, null }
            }, GetAndResetNewEvents());

            // Test s1 and s0=1, s2=1, s3=1, s4=2, s5=1
            //
            s0Events = SupportBean_S0.MakeS0("M", new String[] { "M-s0-1" });
            SendEvent(s0Events);

            s2Events = SupportBean_S2.MakeS2("M", new String[] { "M-s2-1" });
            SendEventsAndReset(s2Events);

            s3Events = SupportBean_S3.MakeS3("M", new String[] { "M-s3-1" });
            SendEventsAndReset(s3Events);

            s4Events = SupportBean_S4.MakeS4("M", new String[] { "M-s4-1", "M-s4-2" });
            SendEventsAndReset(s4Events);

            s5Events = SupportBean_S5.MakeS5("M", new String[] { "M-s5-1" });
            SendEventsAndReset(s5Events);

            s1Events = SupportBean_S1.MakeS1("M", new String[] { "M-s1-1" });
            SendEvent(s1Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[1], s5Events[0] }
            }, GetAndResetNewEvents());

            // Test s2 and s0=1, s1=0, s3=0, s4=1, s5=2
            //
            s0Events = SupportBean_S0.MakeS0("Count", new String[] { "Count-s0-1" });
            SendEvent(s0Events);

            s4Events = SupportBean_S4.MakeS4("Count", new String[] { "Count-s4-1" });
            SendEventsAndReset(s4Events);

            s5Events = SupportBean_S5.MakeS5("Count", new String[] { "Count-s5-1", "Count-s5-2" });
            SendEventsAndReset(s5Events);

            s2Events = SupportBean_S2.MakeS2("Count", new String[] { "Count-s2-1" });
            SendEvent(s2Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { null, null, s2Events[0], null, s4Events[0], s5Events[0] },
                new Object[] { null, null, s2Events[0], null, s4Events[0], s5Events[1] }
            }, GetAndResetNewEvents());

            // Test s2 and s0=1, s1=1, s3=3, s4=1, s5=2
            //
            s0Events = SupportBean_S0.MakeS0("O", new String[] { "O-s0-1" });
            SendEvent(s0Events);

            s1Events = SupportBean_S1.MakeS1("O", new String[] { "O-s1-1" });
            SendEvent(s1Events);

            s3Events = SupportBean_S3.MakeS3("O", new String[] { "O-s3-1", "O-s3-2", "O-s3-3" });
            SendEventsAndReset(s3Events);

            s4Events = SupportBean_S4.MakeS4("O", new String[] { "O-s4-1" });
            SendEventsAndReset(s4Events);

            s5Events = SupportBean_S5.MakeS5("O", new String[] { "O-s5-1", "O-s5-2" });
            SendEventsAndReset(s5Events);

            s2Events = SupportBean_S2.MakeS2("O", new String[] { "O-s2-1" });
            SendEvent(s2Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[2], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[2], s4Events[0], s5Events[1] }
            }, GetAndResetNewEvents());

            // Test s3 and s0=0, s1=0, s2=0, s4=0, s5=0
            //
            s3Events = SupportBean_S3.MakeS3("P", new String[] { "P-s1-1" });
            SendEvent(s3Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { null, null, null, s3Events[0], null, null }
            }, GetAndResetNewEvents());

            // Test s3 and s0=0, s1=1, s2=0, s4=0, s5=0
            //
            s1Events = SupportBean_S1.MakeS1("Q", new String[] { "Q-s1-1" });
            SendEvent(s1Events);

            s3Events = SupportBean_S3.MakeS3("Q", new String[] { "Q-s1-1" });
            SendEvent(s3Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { null, s1Events[0], null, s3Events[0], null, null }
            }, GetAndResetNewEvents());

            // Test s3 and s0=1, s1=2, s2=2, s4=0, s5=0
            //
            s0Events = SupportBean_S0.MakeS0("R", new String[] { "R-s0-1" });
            SendEvent(s0Events);

            s1Events = SupportBean_S1.MakeS1("R", new String[] { "R-s1-1", "R-s1-2" });
            SendEvent(s1Events);

            s2Events = SupportBean_S2.MakeS2("R", new String[] { "R-s2-1", "R-s2-1" });
            SendEventsAndReset(s2Events);

            s3Events = SupportBean_S3.MakeS3("R", new String[] { "R-s3-1" });
            SendEvent(s3Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { null, s1Events[0], null, s3Events[0], null, null },
                new Object[] { null, s1Events[1], null, s3Events[0], null, null }
            }, GetAndResetNewEvents());

            // Test s3 and s0=2, s1=2, s2=1, s4=2, s5=2
            //
            s0Events = SupportBean_S0.MakeS0("S", new String[] { "S-s0-1", "S-s0-2" });
            SendEvent(s0Events);

            s1Events = SupportBean_S1.MakeS1("S", new String[] { "S-s1-1", "S-s1-2" });
            SendEvent(s1Events);

            s2Events = SupportBean_S2.MakeS2("S", new String[] { "S-s2-1", "S-s2-1" });
            SendEventsAndReset(s2Events);

            s4Events = SupportBean_S4.MakeS4("S", new String[] { "S-s4-1", "S-s4-2" });
            SendEventsAndReset(s4Events);

            s5Events = SupportBean_S5.MakeS5("S", new String[] { "S-s5-1", "S-s5-2" });
            SendEventsAndReset(s5Events);

            s3Events = SupportBean_S3.MakeS3("S", new String[] { "s-s3-1" });
            SendEvent(s3Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[1], s1Events[0], s2Events[1], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[1], s1Events[0], s2Events[1], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[1], s5Events[0] },
                new Object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[0], s4Events[1], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[1], s5Events[1] },
                new Object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[0], s4Events[1], s5Events[1] },
                new Object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[1], s5Events[0] },
                new Object[] { s0Events[1], s1Events[0], s2Events[1], s3Events[0], s4Events[1], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[1], s5Events[1] },
                new Object[] { s0Events[1], s1Events[0], s2Events[1], s3Events[0], s4Events[1], s5Events[1] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[1], s1Events[1], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[1], s1Events[1], s2Events[0], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[1], s1Events[1], s2Events[1], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[1], s1Events[1], s2Events[1], s3Events[0], s4Events[0], s5Events[1] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[1], s5Events[0] },
                new Object[] { s0Events[1], s1Events[1], s2Events[0], s3Events[0], s4Events[1], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[1], s5Events[1] },
                new Object[] { s0Events[1], s1Events[1], s2Events[0], s3Events[0], s4Events[1], s5Events[1] },
                new Object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[1], s5Events[0] },
                new Object[] { s0Events[1], s1Events[1], s2Events[1], s3Events[0], s4Events[1], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[1], s5Events[1] },
                new Object[] { s0Events[1], s1Events[1], s2Events[1], s3Events[0], s4Events[1], s5Events[1] }
            }, GetAndResetNewEvents());

            // Test s4 and s0=1, s1=0, s2=1, s3=0, s5=0
            //
            s0Events = SupportBean_S0.MakeS0("U", new String[] { "U-s0-1" });
            SendEventsAndReset(s0Events);

            s2Events = SupportBean_S2.MakeS2("U", new String[] { "U-s1-1" });
            SendEventsAndReset(s2Events);

            s4Events = SupportBean_S4.MakeS4("U", new String[] { "U-s4-1" });
            SendEvent(s4Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { null, null, null, null, s4Events[0], null }
            }, GetAndResetNewEvents());

            // Test s4 and s0=1, s1=0, s2=1, s3=0, s5=1
            //
            s0Events = SupportBean_S0.MakeS0("V", new String[] { "V-s0-1" });
            SendEventsAndReset(s0Events);

            s2Events = SupportBean_S2.MakeS2("V", new String[] { "V-s1-1" });
            SendEventsAndReset(s2Events);

            s5Events = SupportBean_S5.MakeS5("V", new String[] { "V-s5-1" });
            SendEventsAndReset(s5Events);

            s4Events = SupportBean_S4.MakeS4("V", new String[] { "V-s4-1" });
            SendEvent(s4Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { null, null, s2Events[0], null, s4Events[0], s5Events[0] }
            }, GetAndResetNewEvents());

            // Test s4 and s0=1, s1=1, s2=1, s3=1, s5=2
            //
            s0Events = SupportBean_S0.MakeS0("W", new String[] { "W-s0-1" });
            SendEvent(s0Events);

            s1Events = SupportBean_S1.MakeS1("W", new String[] { "W-s1-1" });
            SendEventsAndReset(s1Events);

            s2Events = SupportBean_S2.MakeS2("W", new String[] { "W-s2-1" });
            SendEventsAndReset(s2Events);

            s3Events = SupportBean_S3.MakeS3("W", new String[] { "W-s3-1" });
            SendEventsAndReset(s3Events);

            s5Events = SupportBean_S5.MakeS5("W", new String[] { "W-s5-1", "W-s5-2" });
            SendEventsAndReset(s5Events);

            s4Events = SupportBean_S4.MakeS4("W", new String[] { "W-s4-1" });
            SendEvent(s4Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[1] }
            }, GetAndResetNewEvents());

            // Test s5 and s0=1, s1=2, s2=2, s3=1, s4=1
            //
            s0Events = SupportBean_S0.MakeS0("X", new String[] { "X-s0-1" });
            SendEvent(s0Events);

            s1Events = SupportBean_S1.MakeS1("X", new String[] { "X-s1-1", "X-s1-2" });
            SendEventsAndReset(s1Events);

            s2Events = SupportBean_S2.MakeS2("X", new String[] { "X-s2-1", "X-s2-2" });
            SendEvent(s2Events);

            s3Events = SupportBean_S3.MakeS3("X", new String[] { "X-s3-1" });
            SendEventsAndReset(s3Events);

            s4Events = SupportBean_S4.MakeS4("X", new String[] { "X-s4-1" });
            SendEventsAndReset(s4Events);

            s5Events = SupportBean_S5.MakeS5("X", new String[] { "X-s5-1" });
            SendEvent(s5Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[0], s5Events[0] }
            }, GetAndResetNewEvents());

            // Test s5 and s0=2, s1=1, s2=1, s3=1, s4=1
            //
            s0Events = SupportBean_S0.MakeS0("Y", new String[] { "Y-s0-1", "Y-s0-2" });
            SendEvent(s0Events);

            s1Events = SupportBean_S1.MakeS1("Y", new String[] { "Y-s1-1" });
            SendEventsAndReset(s1Events);

            s2Events = SupportBean_S2.MakeS2("Y", new String[] { "Y-s2-1" });
            SendEvent(s2Events);

            s3Events = SupportBean_S3.MakeS3("Y", new String[] { "Y-s3-1" });
            SendEventsAndReset(s3Events);

            s4Events = SupportBean_S4.MakeS4("Y", new String[] { "Y-s4-1" });
            SendEventsAndReset(s4Events);

            s5Events = SupportBean_S5.MakeS5("Y", new String[] { "X-s5-1" });
            SendEvent(s5Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[0] }
            }, GetAndResetNewEvents());

            // Test s5 and s0=1, s1=1, s2=1, s3=2, s4=2
            //
            s0Events = SupportBean_S0.MakeS0("Z", new String[] { "Z-s0-1" });
            SendEvent(s0Events);

            s1Events = SupportBean_S1.MakeS1("Z", new String[] { "Z-s1-1" });
            SendEventsAndReset(s1Events);

            s2Events = SupportBean_S2.MakeS2("Z", new String[] { "Z-s2-1" });
            SendEventsAndReset(s2Events);

            s3Events = SupportBean_S3.MakeS3("Z", new String[] { "Z-s3-1", "Z-s3-2" });
            SendEventsAndReset(s3Events);

            s4Events = SupportBean_S4.MakeS4("Z", new String[] { "Z-s4-1", "Z-s4-2" });
            SendEventsAndReset(s4Events);

            s5Events = SupportBean_S5.MakeS5("Z", new String[] { "Z-s5-1" });
            SendEvent(s5Events);
            EPAssertionUtil.AssertSameAnyOrder(new Object[][] {
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[1], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0], s5Events[0] },
                new Object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[1], s5Events[0] }
            }, GetAndResetNewEvents());
        }
예제 #2
0
        private static void TryAssertion(RegressionEnvironment env)
        {
            object[] s0Events;
            object[] s1Events;
            object[] s2Events;
            object[] s3Events;
            object[] s4Events;

            // Test s0 and s1=0, s2=0, s3=0, s4=0
            //
            s0Events = SupportBean_S0.MakeS0("A", new[] {"A-s0-1"});
            SendEvent(env, s0Events);
            Assert.IsFalse(env.Listener("s0").IsInvoked);

            // Test s0 and s1=1, s2=0, s3=0, s4=0
            //
            s1Events = SupportBean_S1.MakeS1("B", new[] {"B-s1-1"});
            SendEvent(env, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {new[] {null, s1Events[0], null, null, null}},
                GetAndResetNewEvents(env));

            s0Events = SupportBean_S0.MakeS0("B", new[] {"B-s0-1"});
            SendEvent(env, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {new[] {s0Events[0], s1Events[0], null, null, null}},
                GetAndResetNewEvents(env));

            // Test s0 and s1=1, s2=1, s3=0, s4=0
            //
            s1Events = SupportBean_S1.MakeS1("C", new[] {"C-s1-1"});
            SendEventsAndReset(env, s1Events);

            s2Events = SupportBean_S2.MakeS2("C", new[] {"C-s2-1"});
            SendEvent(env, s2Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {new[] {null, s1Events[0], s2Events[0], null, null}},
                GetAndResetNewEvents(env));

            s0Events = SupportBean_S0.MakeS0("C", new[] {"C-s0-1"});
            SendEvent(env, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {new[] {s0Events[0], s1Events[0], s2Events[0], null, null}},
                GetAndResetNewEvents(env));

            // Test s0 and s1=1, s2=1, s3=1, s4=0
            //
            s1Events = SupportBean_S1.MakeS1("D", new[] {"D-s1-1"});
            SendEventsAndReset(env, s1Events);

            s2Events = SupportBean_S2.MakeS2("D", new[] {"D-s2-1"});
            SendEventsAndReset(env, s2Events);

            s3Events = SupportBean_S3.MakeS3("D", new[] {"D-s2-1"});
            SendEvent(env, s3Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {new[] {null, s1Events[0], s2Events[0], s3Events[0], null}},
                GetAndResetNewEvents(env));

            s0Events = SupportBean_S0.MakeS0("D", new[] {"D-s0-1"});
            SendEvent(env, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[0], null}
                },
                GetAndResetNewEvents(env));

            // Test s0 and s1=1, s2=1, s3=1, s4=1
            //
            s1Events = SupportBean_S1.MakeS1("E", new[] {"E-s1-1"});
            SendEventsAndReset(env, s1Events);

            s2Events = SupportBean_S2.MakeS2("E", new[] {"E-s2-1"});
            SendEventsAndReset(env, s2Events);

            s3Events = SupportBean_S3.MakeS3("E", new[] {"E-s2-1"});
            SendEventsAndReset(env, s3Events);

            s4Events = SupportBean_S4.MakeS4("E", new[] {"E-s2-1"});
            SendEvent(env, s4Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {new[] {null, s1Events[0], s2Events[0], s3Events[0], s4Events[0]}},
                GetAndResetNewEvents(env));

            s0Events = SupportBean_S0.MakeS0("E", new[] {"E-s0-1"});
            SendEvent(env, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0]}
                },
                GetAndResetNewEvents(env));

            // Test s0 and s1=2, s2=1, s3=1, s4=1
            //
            s1Events = SupportBean_S1.MakeS1("F", new[] {"F-s1-1", "F-s1-2"});
            SendEventsAndReset(env, s1Events);

            s2Events = SupportBean_S2.MakeS2("F", new[] {"F-s2-1"});
            SendEventsAndReset(env, s2Events);

            s3Events = SupportBean_S3.MakeS3("F", new[] {"F-s3-1"});
            SendEventsAndReset(env, s3Events);

            s4Events = SupportBean_S4.MakeS4("F", new[] {"F-s2-1"});
            SendEventsAndReset(env, s4Events);

            s0Events = SupportBean_S0.MakeS0("F", new[] {"F-s0-1"});
            SendEvent(env, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0]}
                },
                GetAndResetNewEvents(env));

            // Test s0 and s1=2, s2=2, s3=1, s4=1
            //
            s1Events = SupportBean_S1.MakeS1("G", new[] {"G-s1-1", "G-s1-2"});
            SendEventsAndReset(env, s1Events);

            s2Events = SupportBean_S2.MakeS2("G", new[] {"G-s2-1", "G-s2-2"});
            SendEventsAndReset(env, s2Events);

            s3Events = SupportBean_S3.MakeS3("G", new[] {"G-s3-1"});
            SendEventsAndReset(env, s3Events);

            s4Events = SupportBean_S4.MakeS4("G", new[] {"G-s2-1"});
            SendEventsAndReset(env, s4Events);

            s0Events = SupportBean_S0.MakeS0("G", new[] {"G-s0-1"});
            SendEvent(env, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[0]}
                },
                GetAndResetNewEvents(env));

            // Test s0 and s1=2, s2=2, s3=2, s4=1
            //
            s1Events = SupportBean_S1.MakeS1("H", new[] {"H-s1-1", "H-s1-2"});
            SendEventsAndReset(env, s1Events);

            s2Events = SupportBean_S2.MakeS2("H", new[] {"H-s2-1", "H-s2-2"});
            SendEventsAndReset(env, s2Events);

            s3Events = SupportBean_S3.MakeS3("H", new[] {"H-s3-1", "H-s3-2"});
            SendEventsAndReset(env, s3Events);

            s4Events = SupportBean_S4.MakeS4("H", new[] {"H-s2-1"});
            SendEventsAndReset(env, s4Events);

            s0Events = SupportBean_S0.MakeS0("H", new[] {"H-s0-1"});
            SendEvent(env, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[1], s3Events[1], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[1], s3Events[1], s4Events[0]}
                },
                GetAndResetNewEvents(env));

            // Test s0 and s1=2, s2=2, s3=2, s4=2
            //
            s1Events = SupportBean_S1.MakeS1("I", new[] {"I-s1-1", "I-s1-2"});
            SendEventsAndReset(env, s1Events);

            s2Events = SupportBean_S2.MakeS2("I", new[] {"I-s2-1", "I-s2-2"});
            SendEventsAndReset(env, s2Events);

            s3Events = SupportBean_S3.MakeS3("I", new[] {"I-s3-1", "I-s3-2"});
            SendEventsAndReset(env, s3Events);

            s4Events = SupportBean_S4.MakeS4("I", new[] {"I-s4-1", "I-s4-2"});
            SendEventsAndReset(env, s4Events);

            s0Events = SupportBean_S0.MakeS0("I", new[] {"I-s0-1"});
            SendEvent(env, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[1], s3Events[1], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[1], s3Events[1], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[1]},
                    new[] {s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[1]},
                    new[] {s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[1]},
                    new[] {s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[1]},
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[1]},
                    new[] {s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[1]},
                    new[] {s0Events[0], s1Events[0], s2Events[1], s3Events[1], s4Events[1]},
                    new[] {s0Events[0], s1Events[1], s2Events[1], s3Events[1], s4Events[1]}
                },
                GetAndResetNewEvents(env));

            // Test s0 and s1=1, s2=1, s3=2, s4=3
            //
            s1Events = SupportBean_S1.MakeS1("J", new[] {"J-s1-1"});
            SendEventsAndReset(env, s1Events);

            s2Events = SupportBean_S2.MakeS2("J", new[] {"J-s2-1"});
            SendEventsAndReset(env, s2Events);

            s3Events = SupportBean_S3.MakeS3("J", new[] {"J-s3-1", "J-s3-2"});
            SendEventsAndReset(env, s3Events);

            s4Events = SupportBean_S4.MakeS4("J", new[] {"J-s4-1", "J-s4-2", "J-s4-3"});
            SendEventsAndReset(env, s4Events);

            s0Events = SupportBean_S0.MakeS0("J", new[] {"J-s0-1"});
            SendEvent(env, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[1]},
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[2]},
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[1]},
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[2]}
                },
                GetAndResetNewEvents(env));

            // Test s1 and s0=0, s2=1, s3=1, s4=1
            //
            s2Events = SupportBean_S2.MakeS2("K", new[] {"K-s2-1"});
            SendEventsAndReset(env, s2Events);

            s3Events = SupportBean_S3.MakeS3("K", new[] {"K-s3-1"});
            SendEventsAndReset(env, s3Events);

            s4Events = SupportBean_S4.MakeS4("K", new[] {"K-s4-1"});
            SendEventsAndReset(env, s4Events);

            s1Events = SupportBean_S1.MakeS1("K", new[] {"K-s1-1"});
            SendEvent(env, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {null, s1Events[0], s2Events[0], s3Events[0], s4Events[0]}
                },
                GetAndResetNewEvents(env));

            // Test s1 and s0=0, s2=1, s3=0, s4=1
            //
            s2Events = SupportBean_S2.MakeS2("L", new[] {"L-s2-1"});
            SendEventsAndReset(env, s2Events);

            s4Events = SupportBean_S4.MakeS4("L", new[] {"L-s4-1"});
            SendEventsAndReset(env, s4Events);

            s1Events = SupportBean_S1.MakeS1("L", new[] {"L-s1-1"});
            SendEvent(env, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {null, s1Events[0], s2Events[0], null, s4Events[0]}
                },
                GetAndResetNewEvents(env));

            // Test s1 and s0=2, s2=1, s3=0, s4=1
            //
            s0Events = SupportBean_S0.MakeS0("M", new[] {"M-s0-1", "M-s0-2"});
            SendEvent(env, s0Events);

            s2Events = SupportBean_S2.MakeS2("M", new[] {"M-s2-1"});
            SendEventsAndReset(env, s2Events);

            s4Events = SupportBean_S4.MakeS4("M", new[] {"M-s4-1"});
            SendEventsAndReset(env, s4Events);

            s1Events = SupportBean_S1.MakeS1("M", new[] {"M-s1-1"});
            SendEvent(env, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {s0Events[0], s1Events[0], s2Events[0], null, s4Events[0]},
                    new[] {s0Events[1], s1Events[0], s2Events[0], null, s4Events[0]}
                },
                GetAndResetNewEvents(env));

            // Test s1 and s0=1, s2=0, s3=0, s4=0
            //
            s0Events = SupportBean_S0.MakeS0("N", new[] {"N-s0-1"});
            SendEvent(env, s0Events);

            s1Events = SupportBean_S1.MakeS1("N", new[] {"N-s1-1"});
            SendEvent(env, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {s0Events[0], s1Events[0], null, null, null}
                },
                GetAndResetNewEvents(env));

            // Test s1 and s0=0, s2=0, s3=1, s4=0
            //
            s3Events = SupportBean_S3.MakeS3("O", new[] {"O-s3-1"});
            SendEventsAndReset(env, s3Events);

            s1Events = SupportBean_S1.MakeS1("O", new[] {"O-s1-1"});
            SendEvent(env, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {null, s1Events[0], null, s3Events[0], null}
                },
                GetAndResetNewEvents(env));

            // Test s1 and s0=0, s2=0, s3=0, s4=1
            //
            s4Events = SupportBean_S4.MakeS4("P", new[] {"P-s4-1"});
            SendEventsAndReset(env, s4Events);

            s1Events = SupportBean_S1.MakeS1("P", new[] {"P-s1-1"});
            SendEvent(env, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {null, s1Events[0], null, null, s4Events[0]}
                },
                GetAndResetNewEvents(env));

            // Test s1 and s0=0, s2=0, s3=0, s4=2
            //
            s4Events = SupportBean_S4.MakeS4("Q", new[] {"Q-s4-1", "Q-s4-2"});
            SendEventsAndReset(env, s4Events);

            s1Events = SupportBean_S1.MakeS1("Q", new[] {"Q-s1-1"});
            SendEvent(env, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {null, s1Events[0], null, null, s4Events[0]},
                    new[] {null, s1Events[0], null, null, s4Events[1]}
                },
                GetAndResetNewEvents(env));

            // Test s1 and s0=0, s2=0, s3=2, s4=2
            //
            s3Events = SupportBean_S3.MakeS3("R", new[] {"R-s3-1", "R-s3-2"});
            SendEventsAndReset(env, s3Events);

            s4Events = SupportBean_S4.MakeS4("R", new[] {"R-s4-1", "R-s4-2"});
            SendEventsAndReset(env, s4Events);

            s1Events = SupportBean_S1.MakeS1("R", new[] {"R-s1-1"});
            SendEvent(env, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {null, s1Events[0], null, s3Events[0], s4Events[0]},
                    new[] {null, s1Events[0], null, s3Events[1], s4Events[0]},
                    new[] {null, s1Events[0], null, s3Events[0], s4Events[1]},
                    new[] {null, s1Events[0], null, s3Events[1], s4Events[1]}
                },
                GetAndResetNewEvents(env));

            // Test s1 and s0=0, s2=2, s3=0, s4=2
            //
            s4Events = SupportBean_S4.MakeS4("S", new[] {"S-s4-1", "S-s4-2"});
            SendEventsAndReset(env, s4Events);

            s2Events = SupportBean_S2.MakeS2("S", new[] {"S-s2-1", "S-s2-1"});
            SendEventsAndReset(env, s2Events);

            s1Events = SupportBean_S1.MakeS1("S", new[] {"S-s1-1"});
            SendEvent(env, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {null, s1Events[0], s2Events[0], null, s4Events[0]},
                    new[] {null, s1Events[0], s2Events[0], null, s4Events[1]},
                    new[] {null, s1Events[0], s2Events[1], null, s4Events[0]},
                    new[] {null, s1Events[0], s2Events[1], null, s4Events[1]}
                },
                GetAndResetNewEvents(env));

            // Test s2 and s0=1, s1=2, s3=0, s4=2
            //
            s0Events = SupportBean_S0.MakeS0("U", new[] {"U-s0-1"});
            SendEvent(env, s0Events);

            s1Events = SupportBean_S1.MakeS1("U", new[] {"U-s1-1"});
            SendEventsAndReset(env, s1Events);

            s4Events = SupportBean_S4.MakeS4("U", new[] {"U-s4-1", "U-s4-2"});
            SendEventsAndReset(env, s4Events);

            s2Events = SupportBean_S2.MakeS2("U", new[] {"U-s1-1"});
            SendEvent(env, s2Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {s0Events[0], s1Events[0], s2Events[0], null, s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[0], null, s4Events[1]}
                },
                GetAndResetNewEvents(env));

            // Test s2 and s0=3, s1=1, s3=2, s4=1
            //
            s0Events = SupportBean_S0.MakeS0("V", new[] {"V-s0-1", "V-s0-2", "V-s0-3"});
            SendEvent(env, s0Events);

            s1Events = SupportBean_S1.MakeS1("V", new[] {"V-s1-1"});
            SendEventsAndReset(env, s1Events);

            s3Events = SupportBean_S3.MakeS3("V", new[] {"V-s3-1", "V-s3-2"});
            SendEventsAndReset(env, s3Events);

            s4Events = SupportBean_S4.MakeS4("V", new[] {"V-s4-1"});
            SendEventsAndReset(env, s4Events);

            s2Events = SupportBean_S2.MakeS2("V", new[] {"V-s1-1"});
            SendEvent(env, s2Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[1], s1Events[0], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[2], s1Events[0], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0]},
                    new[] {s0Events[1], s1Events[0], s2Events[0], s3Events[1], s4Events[0]},
                    new[] {s0Events[2], s1Events[0], s2Events[0], s3Events[1], s4Events[0]}
                },
                GetAndResetNewEvents(env));

            // Test s2 and s0=2, s1=2, s3=2, s4=1
            //
            s0Events = SupportBean_S0.MakeS0("W", new[] {"W-s0-1", "W-s0-2"});
            SendEvent(env, s0Events);

            s1Events = SupportBean_S1.MakeS1("W", new[] {"W-s1-1", "W-s1-2"});
            SendEventsAndReset(env, s1Events);

            s3Events = SupportBean_S3.MakeS3("W", new[] {"W-s3-1", "W-s3-2"});
            SendEventsAndReset(env, s3Events);

            s4Events = SupportBean_S4.MakeS4("W", new[] {"W-s4-1", "W-s4-2"});
            SendEventsAndReset(env, s4Events);

            s2Events = SupportBean_S2.MakeS2("W", new[] {"W-s1-1"});
            SendEvent(env, s2Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[1], s1Events[0], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[1], s1Events[1], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0]},
                    new[] {s0Events[1], s1Events[0], s2Events[0], s3Events[1], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[0]},
                    new[] {s0Events[1], s1Events[1], s2Events[0], s3Events[1], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[1]},
                    new[] {s0Events[1], s1Events[0], s2Events[0], s3Events[0], s4Events[1]},
                    new[] {s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[1]},
                    new[] {s0Events[1], s1Events[1], s2Events[0], s3Events[0], s4Events[1]},
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[1]},
                    new[] {s0Events[1], s1Events[0], s2Events[0], s3Events[1], s4Events[1]},
                    new[] {s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[1]},
                    new[] {s0Events[1], s1Events[1], s2Events[0], s3Events[1], s4Events[1]}
                },
                GetAndResetNewEvents(env));

            // Test s4 and s0=2, s1=2, s2=2, s3=2
            //
            s0Events = SupportBean_S0.MakeS0("X", new[] {"X-s0-1", "X-s0-2"});
            SendEvent(env, s0Events);

            s1Events = SupportBean_S1.MakeS1("X", new[] {"X-s1-1", "X-s1-2"});
            SendEventsAndReset(env, s1Events);

            s2Events = SupportBean_S2.MakeS2("X", new[] {"X-s2-1", "X-s2-2"});
            SendEvent(env, s2Events);

            s3Events = SupportBean_S3.MakeS3("X", new[] {"X-s3-1", "X-s3-2"});
            SendEventsAndReset(env, s3Events);

            s4Events = SupportBean_S4.MakeS4("X", new[] {"X-s4-1"});
            SendEvent(env, s4Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[1], s1Events[0], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[1], s1Events[1], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0]},
                    new[] {s0Events[1], s1Events[0], s2Events[0], s3Events[1], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[0]},
                    new[] {s0Events[1], s1Events[1], s2Events[0], s3Events[1], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[0]},
                    new[] {s0Events[1], s1Events[0], s2Events[1], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[0]},
                    new[] {s0Events[1], s1Events[1], s2Events[1], s3Events[0], s4Events[0]},
                    new[] {s0Events[0], s1Events[0], s2Events[1], s3Events[1], s4Events[0]},
                    new[] {s0Events[1], s1Events[0], s2Events[1], s3Events[1], s4Events[0]},
                    new[] {s0Events[0], s1Events[1], s2Events[1], s3Events[1], s4Events[0]},
                    new[] {s0Events[1], s1Events[1], s2Events[1], s3Events[1], s4Events[0]}
                },
                GetAndResetNewEvents(env));

            // Test s4 and s0=0, s1=1, s2=1, s3=1
            //
            s1Events = SupportBean_S1.MakeS1("Y", new[] {"Y-s1-1"});
            SendEventsAndReset(env, s1Events);

            s2Events = SupportBean_S2.MakeS2("Y", new[] {"Y-s2-1"});
            SendEvent(env, s2Events);

            s3Events = SupportBean_S3.MakeS3("Y", new[] {"Y-s3-1"});
            SendEventsAndReset(env, s3Events);

            s4Events = SupportBean_S4.MakeS4("Y", new[] {"Y-s4-1"});
            SendEvent(env, s4Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {null, s1Events[0], s2Events[0], s3Events[0], s4Events[0]}
                },
                GetAndResetNewEvents(env));

            // Test s3 and s0=0, s1=2, s2=1, s4=1
            //
            s1Events = SupportBean_S1.MakeS1("Z", new[] {"Z-s1-1", "Z-s1-2"});
            SendEventsAndReset(env, s1Events);

            s2Events = SupportBean_S2.MakeS2("Z", new[] {"Z-s2-1"});
            SendEventsAndReset(env, s2Events);

            s4Events = SupportBean_S4.MakeS4("Z", new[] {"Z-s4-1"});
            SendEventsAndReset(env, s4Events);

            s3Events = SupportBean_S3.MakeS3("Z", new[] {"Z-s3-1"});
            SendEvent(env, s3Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new[] {
                    new[] {null, s1Events[0], s2Events[0], s3Events[0], s4Events[0]},
                    new[] {null, s1Events[1], s2Events[0], s3Events[0], s4Events[0]}
                },
                GetAndResetNewEvents(env));

            env.UndeployAll();
        }
예제 #3
0
        private void RunAsserts()
        {
            object[] s0Events;
            object[] s1Events;
            object[] s2Events;
            object[] s3Events;

            // Test s0 and s1=1, s2=1, s3=1
            //
            s1Events = SupportBean_S1.MakeS1("A", new string[] { "A-s1-1" });
            SendEvent(s1Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s2Events = SupportBean_S2.MakeS2("A", new string[] { "A-s2-1" });
            SendEvent(s2Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s3Events = SupportBean_S3.MakeS3("A", new string[] { "A-s3-1" });
            SendEvent(s3Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s0Events = SupportBean_S0.MakeS0("A", new string[] { "A-s0-1" });
            SendEvent(s0Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new object[][] { new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0] } }, GetAndResetNewEvents());

            // Test s0 and s1=1, s2=0, s3=0
            //
            s1Events = SupportBean_S1.MakeS1("B", new string[] { "B-s1-1" });
            SendEvent(s1Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s0Events = SupportBean_S0.MakeS0("B", new string[] { "B-s0-1" });
            SendEvent(s0Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new object[][] { new object[] { s0Events[0], s1Events[0], null, null } }, GetAndResetNewEvents());

            // Test s0 and s1=1, s2=1, s3=0
            //
            s1Events = SupportBean_S1.MakeS1("C", new string[] { "C-s1-1" });
            SendEvent(s1Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s2Events = SupportBean_S2.MakeS2("C", new string[] { "C-s2-1" });
            SendEvent(s2Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s0Events = SupportBean_S0.MakeS0("C", new string[] { "C-s0-1" });
            SendEvent(s0Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new object[][] { new object[] { s0Events[0], s1Events[0], s2Events[0], null } }, GetAndResetNewEvents());

            // Test s0 and s1=2, s2=0, s3=0
            //
            s1Events = SupportBean_S1.MakeS1("D", new string[] { "D-s1-1", "D-s1-2" });
            SendEvent(s1Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s2Events = SupportBean_S2.MakeS2("D", new string[] { "D-s2-1" });
            SendEvent(s2Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s0Events = SupportBean_S0.MakeS0("D", new string[] { "D-s0-1" });
            SendEvent(s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], null },
                new object[] { s0Events[0], s1Events[1], s2Events[0], null }
            }, GetAndResetNewEvents());

            // Test s0 and s1=2, s2=2, s3=0
            //
            s1Events = SupportBean_S1.MakeS1("E", new string[] { "E-s1-1", "E-s1-2" });
            SendEvent(s1Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s2Events = SupportBean_S2.MakeS2("E", new string[] { "E-s2-1", "E-s2-1" });
            SendEvent(s2Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s0Events = SupportBean_S0.MakeS0("E", new string[] { "E-s0-1" });
            SendEvent(s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], null },
                new object[] { s0Events[0], s1Events[1], s2Events[0], null },
                new object[] { s0Events[0], s1Events[0], s2Events[1], null },
                new object[] { s0Events[0], s1Events[1], s2Events[1], null }
            }, GetAndResetNewEvents());

            // Test s0 and s1=2, s2=2, s3=1
            //
            s1Events = SupportBean_S1.MakeS1("F", new string[] { "F-s1-1", "F-s1-2" });
            SendEvent(s1Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s2Events = SupportBean_S2.MakeS2("F", new string[] { "F-s2-1", "F-s2-1" });
            SendEvent(s2Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s3Events = SupportBean_S3.MakeS3("F", new string[] { "F-s3-1" });
            SendEvent(s3Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s0Events = SupportBean_S0.MakeS0("F", new string[] { "F-s0-1" });
            SendEvent(s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0] }
            }, GetAndResetNewEvents());

            // Test s0 and s1=2, s2=2, s3=2
            //
            s1Events = SupportBean_S1.MakeS1("G", new string[] { "G-s1-1", "G-s1-2" });
            SendEvent(s1Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s2Events = SupportBean_S2.MakeS2("G", new string[] { "G-s2-1", "G-s2-1" });
            SendEvent(s2Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s3Events = SupportBean_S3.MakeS3("G", new string[] { "G-s3-1", "G-s3-2" });
            SendEvent(s3Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s0Events = SupportBean_S0.MakeS0("G", new string[] { "G-s0-1" });
            SendEvent(s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[1] },
                new object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[1] },
                new object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[1] }
            }, GetAndResetNewEvents());

            // Test s0 and s1=1, s2=1, s3=3
            //
            s1Events = SupportBean_S1.MakeS1("H", new string[] { "H-s1-1" });
            SendEvent(s1Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s2Events = SupportBean_S2.MakeS2("H", new string[] { "H-s2-1" });
            SendEvent(s2Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s3Events = SupportBean_S3.MakeS3("H", new string[] { "H-s3-1", "H-s3-2", "H-s3-3" });
            SendEvent(s3Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s0Events = SupportBean_S0.MakeS0("H", new string[] { "H-s0-1" });
            SendEvent(s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[2] }
            }, GetAndResetNewEvents());

            // Test s3 and s0=0, s1=0, s2=0
            //
            s3Events = SupportBean_S3.MakeS3("I", new string[] { "I-s3-1" });
            SendEvent(s3Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            // Test s3 and s0=0, s1=0, s2=1
            //
            s2Events = SupportBean_S2.MakeS2("J", new string[] { "J-s2-1" });
            SendEvent(s2Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s3Events = SupportBean_S3.MakeS3("J", new string[] { "J-s3-1" });
            SendEvent(s3Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            // Test s3 and s0=0, s1=1, s2=1
            //
            s2Events = SupportBean_S2.MakeS2("K", new string[] { "K-s2-1" });
            SendEvent(s2Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s1Events = SupportBean_S1.MakeS1("K", new string[] { "K-s1-1" });
            SendEvent(s1Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            s3Events = SupportBean_S3.MakeS3("K", new string[] { "K-s3-1" });
            SendEvent(s3Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            // Test s3 and s0=1, s1=1, s2=1
            //
            s0Events = SupportBean_S0.MakeS0("M", new string[] { "M-s0-1" });
            SendEventsAndReset(s0Events);

            s1Events = SupportBean_S1.MakeS1("M", new string[] { "M-s1-1" });
            SendEventsAndReset(s1Events);

            s2Events = SupportBean_S2.MakeS2("M", new string[] { "M-s2-1" });
            SendEventsAndReset(s2Events);

            s3Events = SupportBean_S3.MakeS3("M", new string[] { "M-s3-1" });
            SendEvent(s3Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0] }
            }, GetAndResetNewEvents());

            // Test s3 and s0=1, s1=2, s2=1
            //
            s0Events = SupportBean_S0.MakeS0("N", new string[] { "N-s0-1" });
            SendEventsAndReset(s0Events);

            s1Events = SupportBean_S1.MakeS1("N", new string[] { "N-s1-1", "N-s1-2" });
            SendEventsAndReset(s1Events);

            s2Events = SupportBean_S2.MakeS2("N", new string[] { "N-s2-1" });
            SendEventsAndReset(s2Events);

            s3Events = SupportBean_S3.MakeS3("N", new string[] { "N-s3-1" });
            SendEvent(s3Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0] }
            }, GetAndResetNewEvents());

            // Test s3 and s0=1, s1=2, s2=3
            //
            s0Events = SupportBean_S0.MakeS0("O", new string[] { "O-s0-1" });
            SendEventsAndReset(s0Events);

            s1Events = SupportBean_S1.MakeS1("O", new string[] { "O-s1-1", "O-s1-2" });
            SendEventsAndReset(s1Events);

            s2Events = SupportBean_S2.MakeS2("O", new string[] { "O-s2-1", "O-s2-2", "O-s2-3" });
            SendEventsAndReset(s2Events);

            s3Events = SupportBean_S3.MakeS3("O", new string[] { "O-s3-1" });
            SendEvent(s3Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[2], s3Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[2], s3Events[0] }
            }, GetAndResetNewEvents());

            // Test s3 and s0=2, s1=2, s2=3
            //
            s0Events = SupportBean_S0.MakeS0("P", new string[] { "P-s0-1", "P-s0-2" });
            SendEventsAndReset(s0Events);

            s1Events = SupportBean_S1.MakeS1("P", new string[] { "P-s1-1", "P-s1-2" });
            SendEventsAndReset(s1Events);

            s2Events = SupportBean_S2.MakeS2("P", new string[] { "P-s2-1", "P-s2-2", "P-s2-3" });
            SendEventsAndReset(s2Events);

            s3Events = SupportBean_S3.MakeS3("P", new string[] { "P-s3-1" });
            SendEvent(s3Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[2], s3Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[2], s3Events[0] },
                new object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[0] },
                new object[] { s0Events[1], s1Events[1], s2Events[0], s3Events[0] },
                new object[] { s0Events[1], s1Events[0], s2Events[1], s3Events[0] },
                new object[] { s0Events[1], s1Events[1], s2Events[1], s3Events[0] },
                new object[] { s0Events[1], s1Events[0], s2Events[2], s3Events[0] },
                new object[] { s0Events[1], s1Events[1], s2Events[2], s3Events[0] }
            }, GetAndResetNewEvents());

            // Test s1 and s0=0, s2=1, s3=0
            //
            s2Events = SupportBean_S2.MakeS2("Q", new string[] { "Q-s2-1" });
            SendEventsAndReset(s2Events);

            s1Events = SupportBean_S1.MakeS1("Q", new string[] { "Q-s1-1" });
            SendEvent(s1Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            // Test s1 and s0=2, s2=1, s3=0
            //
            s0Events = SupportBean_S0.MakeS0("R", new string[] { "R-s0-1", "R-s0-2" });
            SendEventsAndReset(s0Events);

            s2Events = SupportBean_S2.MakeS2("R", new string[] { "R-s2-1" });
            SendEventsAndReset(s2Events);

            s1Events = SupportBean_S1.MakeS1("R", new string[] { "R-s1-1" });
            SendEvent(s1Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], null },
                new object[] { s0Events[1], s1Events[0], s2Events[0], null }
            }, GetAndResetNewEvents());

            // Test s1 and s0=2, s2=2, s3=2
            //
            s0Events = SupportBean_S0.MakeS0("S", new string[] { "S-s0-1", "S-s0-2" });
            SendEventsAndReset(s0Events);

            s2Events = SupportBean_S2.MakeS2("S", new string[] { "S-s2-1" });
            SendEventsAndReset(s2Events);

            s3Events = SupportBean_S3.MakeS3("S", new string[] { "S-s3-1", "S-s3-1" });
            SendEventsAndReset(s3Events);

            s1Events = SupportBean_S1.MakeS1("S", new string[] { "S-s1-1" });
            SendEvent(s1Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0] },
                new object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1] },
                new object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[1] }
            }, GetAndResetNewEvents());

            // Test s2 and s0=0, s1=0, s3=1
            //
            s3Events = SupportBean_S3.MakeS3("T", new string[] { "T-s3-1" });
            SendEventsAndReset(s3Events);

            s2Events = SupportBean_S2.MakeS2("T", new string[] { "T-s2-1" });
            SendEvent(s2Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            // Test s2 and s0=0, s1=1, s3=1
            //
            s3Events = SupportBean_S3.MakeS3("U", new string[] { "U-s3-1" });
            SendEventsAndReset(s3Events);

            s1Events = SupportBean_S1.MakeS1("U", new string[] { "U-s1-1" });
            SendEvent(s1Events);

            s2Events = SupportBean_S2.MakeS2("U", new string[] { "U-s2-1" });
            SendEvent(s2Events);
            Assert.IsFalse(_updateListener.IsInvoked);

            // Test s2 and s0=1, s1=1, s3=1
            //
            s0Events = SupportBean_S0.MakeS0("V", new string[] { "V-s0-1" });
            SendEventsAndReset(s0Events);

            s1Events = SupportBean_S1.MakeS1("V", new string[] { "V-s1-1" });
            SendEvent(s1Events);

            s3Events = SupportBean_S3.MakeS3("V", new string[] { "V-s3-1" });
            SendEventsAndReset(s3Events);

            s2Events = SupportBean_S2.MakeS2("V", new string[] { "V-s2-1" });
            SendEvent(s2Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0] }
            }, GetAndResetNewEvents());

            // Test s2 and s0=2, s1=2, s3=0
            //
            s0Events = SupportBean_S0.MakeS0("W", new string[] { "W-s0-1", "W-s0-2" });
            SendEventsAndReset(s0Events);

            s1Events = SupportBean_S1.MakeS1("W", new string[] { "W-s1-1", "W-s1-2" });
            SendEvent(s1Events);

            s2Events = SupportBean_S2.MakeS2("W", new string[] { "W-s2-1" });
            SendEvent(s2Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], null },
                new object[] { s0Events[0], s1Events[1], s2Events[0], null },
                new object[] { s0Events[1], s1Events[0], s2Events[0], null },
                new object[] { s0Events[1], s1Events[1], s2Events[0], null }
            }, GetAndResetNewEvents());

            // Test s2 and s0=2, s1=2, s3=2
            //
            s0Events = SupportBean_S0.MakeS0("X", new string[] { "X-s0-1", "X-s0-2" });
            SendEventsAndReset(s0Events);

            s1Events = SupportBean_S1.MakeS1("X", new string[] { "X-s1-1", "X-s1-2" });
            SendEvent(s1Events);

            s3Events = SupportBean_S3.MakeS3("X", new string[] { "X-s3-1", "X-s3-2" });
            SendEventsAndReset(s3Events);

            s2Events = SupportBean_S2.MakeS2("X", new string[] { "X-s2-1" });
            SendEvent(s2Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0] },
                new object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[0] },
                new object[] { s0Events[1], s1Events[1], s2Events[0], s3Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[1] },
                new object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[1] },
                new object[] { s0Events[1], s1Events[1], s2Events[0], s3Events[1] }
            }, GetAndResetNewEvents());
        }
예제 #4
0
        private void TryAssertion(EPServiceProvider epService, SupportUpdateListener listener)
        {
            object[] s0Events;
            object[] s1Events;
            object[] s2Events;
            object[] s3Events;
            object[] s4Events;

            // Test s0 and s1=0, s2=0, s3=0, s4=0
            //
            s0Events = SupportBean_S0.MakeS0("A", new string[] { "A-s0-1" });
            SendEvent(epService, s0Events);
            Assert.IsFalse(listener.IsInvoked);

            // Test s0 and s1=1, s2=0, s3=0, s4=0
            //
            s1Events = SupportBean_S1.MakeS1("B", new string[] { "B-s1-1" });
            SendEvent(epService, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new object[][] { new object[] { null, s1Events[0], null, null, null } }, GetAndResetNewEvents(listener));

            s0Events = SupportBean_S0.MakeS0("B", new string[] { "B-s0-1" });
            SendEvent(epService, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new object[][] { new object[] { s0Events[0], s1Events[0], null, null, null } }, GetAndResetNewEvents(listener));

            // Test s0 and s1=1, s2=1, s3=0, s4=0
            //
            s1Events = SupportBean_S1.MakeS1("C", new string[] { "C-s1-1" });
            SendEventsAndReset(epService, listener, s1Events);

            s2Events = SupportBean_S2.MakeS2("C", new string[] { "C-s2-1" });
            SendEvent(epService, s2Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new object[][] { new object[] { null, s1Events[0], s2Events[0], null, null } }, GetAndResetNewEvents(listener));

            s0Events = SupportBean_S0.MakeS0("C", new string[] { "C-s0-1" });
            SendEvent(epService, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new object[][] { new object[] { s0Events[0], s1Events[0], s2Events[0], null, null } }, GetAndResetNewEvents(listener));

            // Test s0 and s1=1, s2=1, s3=1, s4=0
            //
            s1Events = SupportBean_S1.MakeS1("D", new string[] { "D-s1-1" });
            SendEventsAndReset(epService, listener, s1Events);

            s2Events = SupportBean_S2.MakeS2("D", new string[] { "D-s2-1" });
            SendEventsAndReset(epService, listener, s2Events);

            s3Events = SupportBean_S3.MakeS3("D", new string[] { "D-s2-1" });
            SendEvent(epService, s3Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new object[][] { new object[] { null, s1Events[0], s2Events[0], s3Events[0], null } }, GetAndResetNewEvents(listener));

            s0Events = SupportBean_S0.MakeS0("D", new string[] { "D-s0-1" });
            SendEvent(epService, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], null }
            }, GetAndResetNewEvents(listener));

            // Test s0 and s1=1, s2=1, s3=1, s4=1
            //
            s1Events = SupportBean_S1.MakeS1("E", new string[] { "E-s1-1" });
            SendEventsAndReset(epService, listener, s1Events);

            s2Events = SupportBean_S2.MakeS2("E", new string[] { "E-s2-1" });
            SendEventsAndReset(epService, listener, s2Events);

            s3Events = SupportBean_S3.MakeS3("E", new string[] { "E-s2-1" });
            SendEventsAndReset(epService, listener, s3Events);

            s4Events = SupportBean_S4.MakeS4("E", new string[] { "E-s2-1" });
            SendEvent(epService, s4Events);
            EPAssertionUtil.AssertSameAnyOrder(
                new object[][] { new object[] { null, s1Events[0], s2Events[0], s3Events[0], s4Events[0] } }, GetAndResetNewEvents(listener));

            s0Events = SupportBean_S0.MakeS0("E", new string[] { "E-s0-1" });
            SendEvent(epService, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0] }
            }, GetAndResetNewEvents(listener));

            // Test s0 and s1=2, s2=1, s3=1, s4=1
            //
            s1Events = SupportBean_S1.MakeS1("F", new string[] { "F-s1-1", "F-s1-2" });
            SendEventsAndReset(epService, listener, s1Events);

            s2Events = SupportBean_S2.MakeS2("F", new string[] { "F-s2-1" });
            SendEventsAndReset(epService, listener, s2Events);

            s3Events = SupportBean_S3.MakeS3("F", new string[] { "F-s3-1" });
            SendEventsAndReset(epService, listener, s3Events);

            s4Events = SupportBean_S4.MakeS4("F", new string[] { "F-s2-1" });
            SendEventsAndReset(epService, listener, s4Events);

            s0Events = SupportBean_S0.MakeS0("F", new string[] { "F-s0-1" });
            SendEvent(epService, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0] }
            }, GetAndResetNewEvents(listener));

            // Test s0 and s1=2, s2=2, s3=1, s4=1
            //
            s1Events = SupportBean_S1.MakeS1("G", new string[] { "G-s1-1", "G-s1-2" });
            SendEventsAndReset(epService, listener, s1Events);

            s2Events = SupportBean_S2.MakeS2("G", new string[] { "G-s2-1", "G-s2-2" });
            SendEventsAndReset(epService, listener, s2Events);

            s3Events = SupportBean_S3.MakeS3("G", new string[] { "G-s3-1" });
            SendEventsAndReset(epService, listener, s3Events);

            s4Events = SupportBean_S4.MakeS4("G", new string[] { "G-s2-1" });
            SendEventsAndReset(epService, listener, s4Events);

            s0Events = SupportBean_S0.MakeS0("G", new string[] { "G-s0-1" });
            SendEvent(epService, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[0] }
            }, GetAndResetNewEvents(listener));

            // Test s0 and s1=2, s2=2, s3=2, s4=1
            //
            s1Events = SupportBean_S1.MakeS1("H", new string[] { "H-s1-1", "H-s1-2" });
            SendEventsAndReset(epService, listener, s1Events);

            s2Events = SupportBean_S2.MakeS2("H", new string[] { "H-s2-1", "H-s2-2" });
            SendEventsAndReset(epService, listener, s2Events);

            s3Events = SupportBean_S3.MakeS3("H", new string[] { "H-s3-1", "H-s3-2" });
            SendEventsAndReset(epService, listener, s3Events);

            s4Events = SupportBean_S4.MakeS4("H", new string[] { "H-s2-1" });
            SendEventsAndReset(epService, listener, s4Events);

            s0Events = SupportBean_S0.MakeS0("H", new string[] { "H-s0-1" });
            SendEvent(epService, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[1], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[1], s4Events[0] }
            }, GetAndResetNewEvents(listener));

            // Test s0 and s1=2, s2=2, s3=2, s4=2
            //
            s1Events = SupportBean_S1.MakeS1("I", new string[] { "I-s1-1", "I-s1-2" });
            SendEventsAndReset(epService, listener, s1Events);

            s2Events = SupportBean_S2.MakeS2("I", new string[] { "I-s2-1", "I-s2-2" });
            SendEventsAndReset(epService, listener, s2Events);

            s3Events = SupportBean_S3.MakeS3("I", new string[] { "I-s3-1", "I-s3-2" });
            SendEventsAndReset(epService, listener, s3Events);

            s4Events = SupportBean_S4.MakeS4("I", new string[] { "I-s4-1", "I-s4-2" });
            SendEventsAndReset(epService, listener, s4Events);

            s0Events = SupportBean_S0.MakeS0("I", new string[] { "I-s0-1" });
            SendEvent(epService, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[1], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[1], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[1] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[1] },
                new object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[1] },
                new object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[1] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[1] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[1] },
                new object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[1], s4Events[1] },
                new object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[1], s4Events[1] }
            }, GetAndResetNewEvents(listener));

            // Test s0 and s1=1, s2=1, s3=2, s4=3
            //
            s1Events = SupportBean_S1.MakeS1("J", new string[] { "J-s1-1" });
            SendEventsAndReset(epService, listener, s1Events);

            s2Events = SupportBean_S2.MakeS2("J", new string[] { "J-s2-1" });
            SendEventsAndReset(epService, listener, s2Events);

            s3Events = SupportBean_S3.MakeS3("J", new string[] { "J-s3-1", "J-s3-2" });
            SendEventsAndReset(epService, listener, s3Events);

            s4Events = SupportBean_S4.MakeS4("J", new string[] { "J-s4-1", "J-s4-2", "J-s4-3" });
            SendEventsAndReset(epService, listener, s4Events);

            s0Events = SupportBean_S0.MakeS0("J", new string[] { "J-s0-1" });
            SendEvent(epService, s0Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[1] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[2] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[1] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[2] }
            }, GetAndResetNewEvents(listener));

            // Test s1 and s0=0, s2=1, s3=1, s4=1
            //
            s2Events = SupportBean_S2.MakeS2("K", new string[] { "K-s2-1" });
            SendEventsAndReset(epService, listener, s2Events);

            s3Events = SupportBean_S3.MakeS3("K", new string[] { "K-s3-1" });
            SendEventsAndReset(epService, listener, s3Events);

            s4Events = SupportBean_S4.MakeS4("K", new string[] { "K-s4-1" });
            SendEventsAndReset(epService, listener, s4Events);

            s1Events = SupportBean_S1.MakeS1("K", new string[] { "K-s1-1" });
            SendEvent(epService, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { null, s1Events[0], s2Events[0], s3Events[0], s4Events[0] }
            }, GetAndResetNewEvents(listener));

            // Test s1 and s0=0, s2=1, s3=0, s4=1
            //
            s2Events = SupportBean_S2.MakeS2("L", new string[] { "L-s2-1" });
            SendEventsAndReset(epService, listener, s2Events);

            s4Events = SupportBean_S4.MakeS4("L", new string[] { "L-s4-1" });
            SendEventsAndReset(epService, listener, s4Events);

            s1Events = SupportBean_S1.MakeS1("L", new string[] { "L-s1-1" });
            SendEvent(epService, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { null, s1Events[0], s2Events[0], null, s4Events[0] }
            }, GetAndResetNewEvents(listener));

            // Test s1 and s0=2, s2=1, s3=0, s4=1
            //
            s0Events = SupportBean_S0.MakeS0("M", new string[] { "M-s0-1", "M-s0-2" });
            SendEvent(epService, s0Events);

            s2Events = SupportBean_S2.MakeS2("M", new string[] { "M-s2-1" });
            SendEventsAndReset(epService, listener, s2Events);

            s4Events = SupportBean_S4.MakeS4("M", new string[] { "M-s4-1" });
            SendEventsAndReset(epService, listener, s4Events);

            s1Events = SupportBean_S1.MakeS1("M", new string[] { "M-s1-1" });
            SendEvent(epService, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], null, s4Events[0] },
                new object[] { s0Events[1], s1Events[0], s2Events[0], null, s4Events[0] }
            }, GetAndResetNewEvents(listener));

            // Test s1 and s0=1, s2=0, s3=0, s4=0
            //
            s0Events = SupportBean_S0.MakeS0("N", new string[] { "N-s0-1" });
            SendEvent(epService, s0Events);

            s1Events = SupportBean_S1.MakeS1("N", new string[] { "N-s1-1" });
            SendEvent(epService, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], null, null, null }
            }, GetAndResetNewEvents(listener));

            // Test s1 and s0=0, s2=0, s3=1, s4=0
            //
            s3Events = SupportBean_S3.MakeS3("O", new string[] { "O-s3-1" });
            SendEventsAndReset(epService, listener, s3Events);

            s1Events = SupportBean_S1.MakeS1("O", new string[] { "O-s1-1" });
            SendEvent(epService, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { null, s1Events[0], null, s3Events[0], null }
            }, GetAndResetNewEvents(listener));

            // Test s1 and s0=0, s2=0, s3=0, s4=1
            //
            s4Events = SupportBean_S4.MakeS4("P", new string[] { "P-s4-1" });
            SendEventsAndReset(epService, listener, s4Events);

            s1Events = SupportBean_S1.MakeS1("P", new string[] { "P-s1-1" });
            SendEvent(epService, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { null, s1Events[0], null, null, s4Events[0] }
            }, GetAndResetNewEvents(listener));

            // Test s1 and s0=0, s2=0, s3=0, s4=2
            //
            s4Events = SupportBean_S4.MakeS4("Q", new string[] { "Q-s4-1", "Q-s4-2" });
            SendEventsAndReset(epService, listener, s4Events);

            s1Events = SupportBean_S1.MakeS1("Q", new string[] { "Q-s1-1" });
            SendEvent(epService, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { null, s1Events[0], null, null, s4Events[0] },
                new object[] { null, s1Events[0], null, null, s4Events[1] }
            }, GetAndResetNewEvents(listener));

            // Test s1 and s0=0, s2=0, s3=2, s4=2
            //
            s3Events = SupportBean_S3.MakeS3("R", new string[] { "R-s3-1", "R-s3-2" });
            SendEventsAndReset(epService, listener, s3Events);

            s4Events = SupportBean_S4.MakeS4("R", new string[] { "R-s4-1", "R-s4-2" });
            SendEventsAndReset(epService, listener, s4Events);

            s1Events = SupportBean_S1.MakeS1("R", new string[] { "R-s1-1" });
            SendEvent(epService, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { null, s1Events[0], null, s3Events[0], s4Events[0] },
                new object[] { null, s1Events[0], null, s3Events[1], s4Events[0] },
                new object[] { null, s1Events[0], null, s3Events[0], s4Events[1] },
                new object[] { null, s1Events[0], null, s3Events[1], s4Events[1] }
            }, GetAndResetNewEvents(listener));

            // Test s1 and s0=0, s2=2, s3=0, s4=2
            //
            s4Events = SupportBean_S4.MakeS4("S", new string[] { "S-s4-1", "S-s4-2" });
            SendEventsAndReset(epService, listener, s4Events);

            s2Events = SupportBean_S2.MakeS2("S", new string[] { "S-s2-1", "S-s2-1" });
            SendEventsAndReset(epService, listener, s2Events);

            s1Events = SupportBean_S1.MakeS1("S", new string[] { "S-s1-1" });
            SendEvent(epService, s1Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { null, s1Events[0], s2Events[0], null, s4Events[0] },
                new object[] { null, s1Events[0], s2Events[0], null, s4Events[1] },
                new object[] { null, s1Events[0], s2Events[1], null, s4Events[0] },
                new object[] { null, s1Events[0], s2Events[1], null, s4Events[1] }
            }, GetAndResetNewEvents(listener));

            // Test s2 and s0=1, s1=2, s3=0, s4=2
            //
            s0Events = SupportBean_S0.MakeS0("U", new string[] { "U-s0-1" });
            SendEvent(epService, s0Events);

            s1Events = SupportBean_S1.MakeS1("U", new string[] { "U-s1-1" });
            SendEventsAndReset(epService, listener, s1Events);

            s4Events = SupportBean_S4.MakeS4("U", new string[] { "U-s4-1", "U-s4-2" });
            SendEventsAndReset(epService, listener, s4Events);

            s2Events = SupportBean_S2.MakeS2("U", new string[] { "U-s1-1" });
            SendEvent(epService, s2Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], null, s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], null, s4Events[1] }
            }, GetAndResetNewEvents(listener));

            // Test s2 and s0=3, s1=1, s3=2, s4=1
            //
            s0Events = SupportBean_S0.MakeS0("V", new string[] { "V-s0-1", "V-s0-2", "V-s0-3" });
            SendEvent(epService, s0Events);

            s1Events = SupportBean_S1.MakeS1("V", new string[] { "V-s1-1" });
            SendEventsAndReset(epService, listener, s1Events);

            s3Events = SupportBean_S3.MakeS3("V", new string[] { "V-s3-1", "V-s3-2" });
            SendEventsAndReset(epService, listener, s3Events);

            s4Events = SupportBean_S4.MakeS4("V", new string[] { "V-s4-1" });
            SendEventsAndReset(epService, listener, s4Events);

            s2Events = SupportBean_S2.MakeS2("V", new string[] { "V-s1-1" });
            SendEvent(epService, s2Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[2], s1Events[0], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0] },
                new object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[1], s4Events[0] },
                new object[] { s0Events[2], s1Events[0], s2Events[0], s3Events[1], s4Events[0] }
            }, GetAndResetNewEvents(listener));

            // Test s2 and s0=2, s1=2, s3=2, s4=1
            //
            s0Events = SupportBean_S0.MakeS0("W", new string[] { "W-s0-1", "W-s0-2" });
            SendEvent(epService, s0Events);

            s1Events = SupportBean_S1.MakeS1("W", new string[] { "W-s1-1", "W-s1-2" });
            SendEventsAndReset(epService, listener, s1Events);

            s3Events = SupportBean_S3.MakeS3("W", new string[] { "W-s3-1", "W-s3-2" });
            SendEventsAndReset(epService, listener, s3Events);

            s4Events = SupportBean_S4.MakeS4("W", new string[] { "W-s4-1", "W-s4-2" });
            SendEventsAndReset(epService, listener, s4Events);

            s2Events = SupportBean_S2.MakeS2("W", new string[] { "W-s1-1" });
            SendEvent(epService, s2Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[1], s1Events[1], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0] },
                new object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[1], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[0] },
                new object[] { s0Events[1], s1Events[1], s2Events[0], s3Events[1], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[1] },
                new object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[0], s4Events[1] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[1] },
                new object[] { s0Events[1], s1Events[1], s2Events[0], s3Events[0], s4Events[1] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[1] },
                new object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[1], s4Events[1] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[1] },
                new object[] { s0Events[1], s1Events[1], s2Events[0], s3Events[1], s4Events[1] }
            }, GetAndResetNewEvents(listener));

            // Test s4 and s0=2, s1=2, s2=2, s3=2
            //
            s0Events = SupportBean_S0.MakeS0("X", new string[] { "X-s0-1", "X-s0-2" });
            SendEvent(epService, s0Events);

            s1Events = SupportBean_S1.MakeS1("X", new string[] { "X-s1-1", "X-s1-2" });
            SendEventsAndReset(epService, listener, s1Events);

            s2Events = SupportBean_S2.MakeS2("X", new string[] { "X-s2-1", "X-s2-2" });
            SendEvent(epService, s2Events);

            s3Events = SupportBean_S3.MakeS3("X", new string[] { "X-s3-1", "X-s3-2" });
            SendEventsAndReset(epService, listener, s3Events);

            s4Events = SupportBean_S4.MakeS4("X", new string[] { "X-s4-1" });
            SendEvent(epService, s4Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[1], s1Events[1], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[0], s3Events[1], s4Events[0] },
                new object[] { s0Events[1], s1Events[0], s2Events[0], s3Events[1], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[0], s3Events[1], s4Events[0] },
                new object[] { s0Events[1], s1Events[1], s2Events[0], s3Events[1], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[0], s4Events[0] },
                new object[] { s0Events[1], s1Events[0], s2Events[1], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[0], s4Events[0] },
                new object[] { s0Events[1], s1Events[1], s2Events[1], s3Events[0], s4Events[0] },
                new object[] { s0Events[0], s1Events[0], s2Events[1], s3Events[1], s4Events[0] },
                new object[] { s0Events[1], s1Events[0], s2Events[1], s3Events[1], s4Events[0] },
                new object[] { s0Events[0], s1Events[1], s2Events[1], s3Events[1], s4Events[0] },
                new object[] { s0Events[1], s1Events[1], s2Events[1], s3Events[1], s4Events[0] }
            }, GetAndResetNewEvents(listener));

            // Test s4 and s0=0, s1=1, s2=1, s3=1
            //
            s1Events = SupportBean_S1.MakeS1("Y", new string[] { "Y-s1-1" });
            SendEventsAndReset(epService, listener, s1Events);

            s2Events = SupportBean_S2.MakeS2("Y", new string[] { "Y-s2-1" });
            SendEvent(epService, s2Events);

            s3Events = SupportBean_S3.MakeS3("Y", new string[] { "Y-s3-1" });
            SendEventsAndReset(epService, listener, s3Events);

            s4Events = SupportBean_S4.MakeS4("Y", new string[] { "Y-s4-1" });
            SendEvent(epService, s4Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { null, s1Events[0], s2Events[0], s3Events[0], s4Events[0] }
            }, GetAndResetNewEvents(listener));

            // Test s3 and s0=0, s1=2, s2=1, s4=1
            //
            s1Events = SupportBean_S1.MakeS1("Z", new string[] { "Z-s1-1", "Z-s1-2" });
            SendEventsAndReset(epService, listener, s1Events);

            s2Events = SupportBean_S2.MakeS2("Z", new string[] { "Z-s2-1" });
            SendEventsAndReset(epService, listener, s2Events);

            s4Events = SupportBean_S4.MakeS4("Z", new string[] { "Z-s4-1" });
            SendEventsAndReset(epService, listener, s4Events);

            s3Events = SupportBean_S3.MakeS3("Z", new string[] { "Z-s3-1" });
            SendEvent(epService, s3Events);
            EPAssertionUtil.AssertSameAnyOrder(new object[][] {
                new object[] { null, s1Events[0], s2Events[0], s3Events[0], s4Events[0] },
                new object[] { null, s1Events[1], s2Events[0], s3Events[0], s4Events[0] }
            }, GetAndResetNewEvents(listener));

            epService.EPAdministrator.DestroyAllStatements();
        }