Author: sebb
Date: Sat Nov 17 07:43:13 2007
New Revision: 595966

URL: http://svn.apache.org/viewvc?rev=595966&view=rev
Log:
Convert static test variables to instance variables

Modified:
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java
    
jakarta/jmeter/trunk/test/src/org/apache/jmeter/control/TestWhileController.java

Modified: 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java?rev=595966&r1=595965&r2=595966&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java 
(original)
+++ 
jakarta/jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java 
Sat Nov 17 07:43:13 2007
@@ -39,9 +39,9 @@
 
        private final static String CONDITION = "WhileController.condition"; // 
$NON-NLS-1$
 
-       static boolean testMode = false; // To make testing easier
+       boolean testMode = false; // To make testing easier
 
-       static boolean testModeResult = false; // dummy sample result
+       boolean testModeResult = false; // dummy sample result
 
        public WhileController() {
        }

Modified: 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/control/TestWhileController.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/control/TestWhileController.java?rev=595966&r1=595965&r2=595966&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/control/TestWhileController.java
 (original)
+++ 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/control/TestWhileController.java
 Sat Nov 17 07:43:13 2007
@@ -68,10 +68,10 @@
                }
 
                public void runtestPrevOK(String type) throws Exception {
-            WhileController.testMode = true;
-            WhileController.testModeResult = true;
                        GenericController controller = new GenericController();
                        WhileController while_cont = new WhileController();
+                       while_cont.testMode = true;
+                       while_cont.testModeResult = true;
                        while_cont.setCondition(type);
                        while_cont.addTestElement(new TestSampler("one"));
                        while_cont.addTestElement(new TestSampler("two"));
@@ -86,23 +86,23 @@
                        assertEquals("two", nextName(controller));
                        assertEquals("three", nextName(controller));
                        assertEquals("one", nextName(controller));
-                       WhileController.testModeResult = false;// one and two 
fail
+                       while_cont.testModeResult = false;// one and two fail
                        if (type.equals(OTHER))
                                while_cont.setCondition("false");
                        assertEquals("two", nextName(controller));
                        assertEquals("three", nextName(controller));
-                       WhileController.testModeResult = true;// but three OK, 
so does not exit
+                       while_cont.testModeResult = true;// but three OK, so 
does not exit
                        if (type.equals(OTHER))
                                while_cont.setCondition(OTHER);
                        assertEquals("one", nextName(controller));
                        assertEquals("two", nextName(controller));
                        assertEquals("three", nextName(controller));
-                       WhileController.testModeResult = false;// three fails, 
so exits while
+                       while_cont.testModeResult = false;// three fails, so 
exits while
                        if (type.equals(OTHER))
                                while_cont.setCondition("false");
                        assertEquals("four", nextName(controller));
                        assertNull(nextName(controller));
-                       WhileController.testModeResult = true;
+                       while_cont.testModeResult = true;
                        if (type.equals(OTHER))
                                while_cont.setCondition(OTHER);
                        assertEquals("one", nextName(controller));
@@ -111,10 +111,10 @@
                // While (blank), previous sample failed - should run once
                public void testBlankPrevFailed() throws Exception {
 //                     log.info("testBlankPrevFailed");
-                       WhileController.testMode = true;
-                       WhileController.testModeResult = false;
                        GenericController controller = new GenericController();
                        WhileController while_cont = new WhileController();
+                       while_cont.testMode = true;
+                       while_cont.testModeResult = false;
                        while_cont.setCondition("");
                        while_cont.addTestElement(new TestSampler("one"));
                        while_cont.addTestElement(new TestSampler("two"));
@@ -144,10 +144,10 @@
                }
 
                public void runTestPrevFailed(String s) throws Exception {
-                       WhileController.testMode = true;
-                       WhileController.testModeResult = false;
                        GenericController controller = new GenericController();
                        WhileController while_cont = new WhileController();
+                       while_cont.testMode = true;
+                       while_cont.testModeResult = false;
                        while_cont.setCondition(s);
                        while_cont.addTestElement(new TestSampler("one"));
                        while_cont.addTestElement(new TestSampler("two"));
@@ -170,12 +170,12 @@
                }
 
                public void runTestAlwaysFail(boolean other) {
-                       WhileController.testMode = true;
-                       WhileController.testModeResult = false;
                        LoopController controller = new LoopController();
                        controller.setContinueForever(true);
                        controller.setLoops(-1);
                        WhileController while_cont = new WhileController();
+                       while_cont.testMode = true;
+                       while_cont.testModeResult = false;
                        while_cont.setCondition("false");
                        while_cont.addTestElement(new TestSampler("one"));
                        while_cont.addTestElement(new TestSampler("two"));



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to