Package org.apache.jmeter.junit.stubs

Examples of org.apache.jmeter.junit.stubs.TestSampler


            GenericController controller = new GenericController();

            SwitchController switch_cont = new SwitchController();
            switch_cont.setSelection(cond);

            controller.addTestElement(new TestSampler("before"));
            controller.addTestElement(switch_cont);

            switch_cont.addTestElement(new TestSampler("zero"));
            switch_cont.addTestElement(new TestSampler("one"));
            switch_cont.addTestElement(new TestSampler("two"));
            switch_cont.addTestElement(new TestSampler("three"));

            controller.addTestElement(new TestSampler("after"));

            controller.initialize();

            for (int i = 1; i <= 3; i++) {
                assertEquals("Loop " + i, "before", nextName(controller));
View Full Code Here


            GenericController sub_2 = new GenericController();

            SwitchController switch_cont = new SwitchController();
            switch_cont.setSelection(cond);

            switch_cont.addTestElement(new TestSampler("zero"));
            switch_cont.addTestElement(sub_1);
            sub_1.addTestElement(new TestSampler("one"));
            sub_1.setName(sub1Name);

            switch_cont.addTestElement(new TestSampler("two"));

            switch_cont.addTestElement(sub_2);
            sub_2.addTestElement(new TestSampler("three"));
            sub_2.setName("three");

            controller.addTestElement(new TestSampler("before"));
            controller.addTestElement(switch_cont);
            controller.addTestElement(new TestSampler("after"));
            controller.initialize();
            for (int i = 1; i <= 3; i++) {
                assertEquals("Loop="+i,"before", nextName(controller));
                if (exp!=null){
                    assertEquals("Loop="+i,exp, nextName(controller));
View Full Code Here

            GenericController sub_2 = new GenericController();

            SwitchController switch_cont = new SwitchController();
            switch_cont.setSelection(cond);

            switch_cont.addTestElement(new TestSampler("zero"));
            switch_cont.addTestElement(sub_1);
            sub_1.addTestElement(new TestSampler("one"));
            sub_1.addTestElement(new TestSampler("two"));

            switch_cont.addTestElement(sub_2);
            sub_2.addTestElement(new TestSampler("three"));
            sub_2.addTestElement(new TestSampler("four"));

            switch_cont.addTestElement(new TestSampler("five"));
            switch_cont.addTestElement(new TestSampler("six"));

            controller.addTestElement(new TestSampler("before"));
            controller.addTestElement(switch_cont);
            controller.addTestElement(new TestSampler("after"));
            controller.setRunningVersion(true);
            sub_1.setRunningVersion(true);
            sub_2.setRunningVersion(true);
            switch_cont.setRunningVersion(true);
            controller.initialize();
View Full Code Here

            GenericController controller = new GenericController();

            SwitchController switch_cont = new SwitchController();
            switch_cont.setProperty(newProp);

            controller.addTestElement(new TestSampler("before"));
            controller.addTestElement(switch_cont);

            switch_cont.addTestElement(new TestSampler("0"));
            switch_cont.addTestElement(new TestSampler("1"));
            switch_cont.addTestElement(new TestSampler("2"));
            switch_cont.addTestElement(new TestSampler("3"));

            controller.addTestElement(new TestSampler("after"));

            controller.initialize();

            assertEquals("100",jmvars.get("VAR"));
           
View Full Code Here

        public void testProcessing() throws Exception {
            testLog.debug("Testing Interleave Controller 1");
            GenericController controller = new GenericController();
            InterleaveControl sub_1 = new InterleaveControl();
            sub_1.setStyle(InterleaveControl.IGNORE_SUB_CONTROLLERS);
            sub_1.addTestElement(new TestSampler("one"));
            sub_1.addTestElement(new TestSampler("two"));
            controller.addTestElement(sub_1);
            controller.addTestElement(new TestSampler("three"));
            LoopController sub_2 = new LoopController();
            sub_2.setLoops(3);
            GenericController sub_3 = new GenericController();
            sub_2.addTestElement(new TestSampler("four"));
            sub_3.addTestElement(new TestSampler("five"));
            sub_3.addTestElement(new TestSampler("six"));
            sub_2.addTestElement(sub_3);
            sub_2.addTestElement(new TestSampler("seven"));
            controller.addTestElement(sub_2);
            String[] interleaveOrder = new String[] { "one", "two" };
            String[] order = new String[] { "dummy", "three", "four", "five", "six", "seven", "four", "five", "six",
                    "seven", "four", "five", "six", "seven" };
            int counter = 14;
View Full Code Here

        public void testProcessing6() throws Exception {
            testLog.debug("Testing Interleave Controller 6");
            GenericController controller = new GenericController();
            InterleaveControl sub_1 = new InterleaveControl();
            controller.addTestElement(new TestSampler("one"));
            sub_1.setStyle(InterleaveControl.IGNORE_SUB_CONTROLLERS);
            controller.addTestElement(sub_1);
            LoopController sub_2 = new LoopController();
            sub_1.addTestElement(sub_2);
            sub_2.setLoops(3);
View Full Code Here

        public void testProcessing2() throws Exception {
            testLog.debug("Testing Interleave Controller 2");
            GenericController controller = new GenericController();
            InterleaveControl sub_1 = new InterleaveControl();
            sub_1.setStyle(InterleaveControl.IGNORE_SUB_CONTROLLERS);
            sub_1.addTestElement(new TestSampler("one"));
            sub_1.addTestElement(new TestSampler("two"));
            controller.addTestElement(sub_1);
            controller.addTestElement(new TestSampler("three"));
            LoopController sub_2 = new LoopController();
            sub_2.setLoops(3);
            GenericController sub_3 = new GenericController();
            sub_2.addTestElement(new TestSampler("four"));
            sub_3.addTestElement(new TestSampler("five"));
            sub_3.addTestElement(new TestSampler("six"));
            sub_2.addTestElement(sub_3);
            sub_2.addTestElement(new TestSampler("seven"));
            sub_1.addTestElement(sub_2);
            String[] order = new String[] { "one", "three", "two", "three", "four", "three", "one", "three", "two",
                    "three", "five", "three", "one", "three", "two", "three", "six", "three", "one", "three" };
            int counter = 0;
            controller.setRunningVersion(true);
View Full Code Here

        public void testProcessing3() throws Exception {
            testLog.debug("Testing Interleave Controller 3");
            GenericController controller = new GenericController();
            InterleaveControl sub_1 = new InterleaveControl();
            sub_1.setStyle(InterleaveControl.USE_SUB_CONTROLLERS);
            sub_1.addTestElement(new TestSampler("one"));
            sub_1.addTestElement(new TestSampler("two"));
            controller.addTestElement(sub_1);
            controller.addTestElement(new TestSampler("three"));
            LoopController sub_2 = new LoopController();
            sub_2.setLoops(3);
            GenericController sub_3 = new GenericController();
            sub_2.addTestElement(new TestSampler("four"));
            sub_3.addTestElement(new TestSampler("five"));
            sub_3.addTestElement(new TestSampler("six"));
            sub_2.addTestElement(sub_3);
            sub_2.addTestElement(new TestSampler("seven"));
            sub_1.addTestElement(sub_2);
            String[] order = new String[] { "one", "three", "two", "three", "four", "five", "six", "seven", "four",
                    "five", "six", "seven", "four", "five", "six", "seven", "three", "one", "three", "two", "three" };
            int counter = 0;
            controller.setRunningVersion(true);
View Full Code Here

            GenericController controller = new GenericController();
            InterleaveControl sub_1 = new InterleaveControl();
            sub_1.setStyle(InterleaveControl.IGNORE_SUB_CONTROLLERS);
            controller.addTestElement(sub_1);
            GenericController sub_2 = new GenericController();
            sub_2.addTestElement(new TestSampler("one"));
            sub_2.addTestElement(new TestSampler("two"));
            sub_1.addTestElement(sub_2);
            GenericController sub_3 = new GenericController();
            sub_3.addTestElement(new TestSampler("three"));
            sub_3.addTestElement(new TestSampler("four"));
            sub_1.addTestElement(sub_3);
            String[] order = new String[] { "one", "three", "two", "four" };
            int counter = 0;
            controller.setRunningVersion(true);
            sub_1.setRunningVersion(true);
View Full Code Here

            GenericController controller = new GenericController();
            InterleaveControl sub_1 = new InterleaveControl();
            sub_1.setStyle(InterleaveControl.USE_SUB_CONTROLLERS);
            controller.addTestElement(sub_1);
            GenericController sub_2 = new GenericController();
            sub_2.addTestElement(new TestSampler("one"));
            sub_2.addTestElement(new TestSampler("two"));
            sub_1.addTestElement(sub_2);
            GenericController sub_3 = new GenericController();
            sub_3.addTestElement(new TestSampler("three"));
            sub_3.addTestElement(new TestSampler("four"));
            sub_1.addTestElement(sub_3);
            String[] order = new String[] { "one", "two", "three", "four" };
            int counter = 0;
            controller.setRunningVersion(true);
            sub_1.setRunningVersion(true);
View Full Code Here

TOP

Related Classes of org.apache.jmeter.junit.stubs.TestSampler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.