01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18:
19: package org.apache.jmeter.control;
20:
21: import org.apache.jmeter.junit.JMeterTestCase;
22:
23: //import org.apache.jmeter.testelement.TestElement;
24:
25: public class TestIfController extends JMeterTestCase {
26: public TestIfController(String name) {
27: super (name);
28: }
29:
30: public void testProcessing() throws Exception {
31:
32: GenericController controller = new GenericController();
33:
34: controller.addTestElement(new IfController("false==false"));
35: controller.addTestElement(new IfController(
36: " \"a\".equals(\"a\")"));
37: controller.addTestElement(new IfController("2<100"));
38:
39: //TODO enable some proper tests!!
40:
41: /*
42: * GenericController sub_1 = new GenericController();
43: * sub_1.addTestElement(new IfController("3==3"));
44: * controller.addTestElement(sub_1); controller.addTestElement(new
45: * IfController("false==true"));
46: */
47:
48: /*
49: * GenericController controller = new GenericController();
50: * GenericController sub_1 = new GenericController();
51: * sub_1.addTestElement(new IfController("10<100"));
52: * sub_1.addTestElement(new IfController("true==false"));
53: * controller.addTestElement(sub_1); controller.addTestElement(new
54: * IfController("false==false"));
55: *
56: * IfController sub_2 = new IfController(); sub_2.setCondition( "10<10000");
57: * GenericController sub_3 = new GenericController();
58: *
59: * sub_2.addTestElement(new IfController( " \"a\".equals(\"a\")" ) );
60: * sub_3.addTestElement(new IfController("2>100"));
61: * sub_3.addTestElement(new IfController("false==true"));
62: * sub_2.addTestElement(sub_3); sub_2.addTestElement(new
63: * IfController("2==3")); controller.addTestElement(sub_2);
64: */
65:
66: /*
67: * IfController controller = new IfController("12==12");
68: * controller.initialize();
69: */
70: // TestElement sampler = null;
71: // while ((sampler = controller.next()) != null) {
72: // logger.debug(" ->>> Gonna assertTrue :" + sampler.getClass().getName() + " Property is ---->>>"
73: // + sampler.getPropertyAsString(TestElement.NAME));
74: // }
75: }
76: }
|