jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1728418 - in /jmeter/trunk: src/functions/org/apache/jmeter/functions/ test/src/org/apache/jmeter/assertions/ test/src/org/apache/jmeter/engine/util/ test/src/org/apache/jmeter/functions/ test/src/org/apache/jmeter/gui/action/ test/src/org...
Date Thu, 04 Feb 2016 08:14:13 GMT
Author: pmouawad
Date: Thu Feb  4 08:14:13 2016
New Revision: 1728418

URL: http://svn.apache.org/viewvc?rev=1728418&view=rev
Log:
Bug 58897 - Improve JUnit Test code STEP 5
patch by B. Wiart
#resolve #104
Bugzilla Id: 58897

Added:
    jmeter/trunk/test/src/org/apache/jmeter/functions/EvalFunctionTest.java   (with props)
    jmeter/trunk/test/src/org/apache/jmeter/functions/FunctionTestHelper.java   (with props)
    jmeter/trunk/test/src/org/apache/jmeter/functions/RandomFunctionTest.java   (with props)
    jmeter/trunk/test/src/org/apache/jmeter/functions/StringFromFileFunctionTest.java   (with props)
    jmeter/trunk/test/src/org/apache/jmeter/functions/SumFunctionTest.java   (with props)
    jmeter/trunk/test/src/org/apache/jmeter/functions/VariableTest.java   (with props)
Removed:
    jmeter/trunk/test/src/org/apache/jmeter/gui/action/PackageTest.java
Modified:
    jmeter/trunk/src/functions/org/apache/jmeter/functions/EvalFunction.java
    jmeter/trunk/src/functions/org/apache/jmeter/functions/EvalVarFunction.java
    jmeter/trunk/test/src/org/apache/jmeter/assertions/SizeAssertionTest.java
    jmeter/trunk/test/src/org/apache/jmeter/assertions/XMLSchemaAssertionTest.java
    jmeter/trunk/test/src/org/apache/jmeter/assertions/XPathAssertionTest.java
    jmeter/trunk/test/src/org/apache/jmeter/engine/util/TestValueReplacer.java
    jmeter/trunk/test/src/org/apache/jmeter/functions/PackageTest.java
    jmeter/trunk/test/src/org/apache/jmeter/gui/action/TestLoad.java
    jmeter/trunk/test/src/org/apache/jmeter/protocol/http/modifier/TestURLRewritingModifier.java
    jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java
    jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PackageTest.java
    jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/PackageTest.java
    jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/TestBooleanPropertyEditor.java
    jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/TestComboStringEditor.java

Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/EvalFunction.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/EvalFunction.java?rev=1728418&r1=1728417&r2=1728418&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/EvalFunction.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/EvalFunction.java Thu Feb  4 08:14:13 2016
@@ -18,8 +18,6 @@
 
 package org.apache.jmeter.functions;
 
-// @see PackageTest for unit tests
-
 import java.util.Collection;
 import java.util.LinkedList;
 import java.util.List;

Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/EvalVarFunction.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/EvalVarFunction.java?rev=1728418&r1=1728417&r2=1728418&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/EvalVarFunction.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/EvalVarFunction.java Thu Feb  4 08:14:13 2016
@@ -18,8 +18,6 @@
 
 package org.apache.jmeter.functions;
 
-// @see PackageTest for unit tests
-
 import java.util.Collection;
 import java.util.LinkedList;
 import java.util.List;

Modified: jmeter/trunk/test/src/org/apache/jmeter/assertions/SizeAssertionTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/assertions/SizeAssertionTest.java?rev=1728418&r1=1728417&r2=1728418&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/assertions/SizeAssertionTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/assertions/SizeAssertionTest.java Thu Feb  4 08:14:13 2016
@@ -162,9 +162,6 @@ public class SizeAssertionTest extends J
 // TODO - need a lot more tests
       
       private void assertPassed() throws Exception{
-         // if (null != result.getFailureMessage()){
-              //System.out.println(result.getFailureMessage());// debug
-          //}
           assertNull("Failure message should be null",result.getFailureMessage());
           assertFalse(result.isError());
           assertFalse(result.isFailure());        
@@ -172,10 +169,8 @@ public class SizeAssertionTest extends J
       
       private void assertFailed() throws Exception{
           assertNotNull("Failure message should not be null",result.getFailureMessage());
-          //System.out.println(result.getFailureMessage());
           assertFalse("Should not be: Response was null","Response was null".equals(result.getFailureMessage()));
           assertFalse(result.isError());
           assertTrue(result.isFailure());     
-          
       }
 }

Modified: jmeter/trunk/test/src/org/apache/jmeter/assertions/XMLSchemaAssertionTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/assertions/XMLSchemaAssertionTest.java?rev=1728418&r1=1728417&r2=1728418&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/assertions/XMLSchemaAssertionTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/assertions/XMLSchemaAssertionTest.java Thu Feb  4 08:14:13 2016
@@ -35,8 +35,6 @@ import org.apache.jmeter.threads.JMeterV
 import org.junit.Before;
 import org.junit.Test;
 
-//import org.apache.jorphan.logging.LoggingManager;
-
 public class XMLSchemaAssertionTest extends JMeterTestCase {
 
     private XMLSchemaAssertion assertion;
@@ -56,7 +54,6 @@ public class XMLSchemaAssertionTest exte
         JMeterVariables vars = new JMeterVariables();
         jmctx.setVariables(vars);
         jmctx.setPreviousResult(result);
-        // LoggingManager.setPriority("DEBUG","jmeter");
     }
 
     private ByteArrayOutputStream readBA(String name) throws IOException {

Modified: jmeter/trunk/test/src/org/apache/jmeter/assertions/XPathAssertionTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/assertions/XPathAssertionTest.java?rev=1728418&r1=1728417&r2=1728418&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/assertions/XPathAssertionTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/assertions/XPathAssertionTest.java Thu Feb  4 08:14:13 2016
@@ -59,7 +59,6 @@ public class XPathAssertionTest extends
         vars = new JMeterVariables();
         jmctx.setVariables(vars);
         jmctx.setPreviousResult(result);
-        //testLog.setPriority(org.apache.log.Priority.DEBUG);
     }
 
     private void setAlternateResponseData(){

Modified: jmeter/trunk/test/src/org/apache/jmeter/engine/util/TestValueReplacer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/engine/util/TestValueReplacer.java?rev=1728418&r1=1728417&r2=1728418&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/engine/util/TestValueReplacer.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/engine/util/TestValueReplacer.java Thu Feb  4 08:14:13 2016
@@ -117,7 +117,6 @@ public class TestValueReplacer extends J
             TestElement element = new ConfigTestElement();
             element.setProperty(new StringProperty("domain", "${server}"));
             replacer.replaceValues(element);
-            //log.debug("domain property = " + element.getProperty("domain"));
             element.setRunningVersion(true);
             assertEquals("jakarta.apache.org", element.getPropertyAsString("domain"));
         }
@@ -130,7 +129,6 @@ public class TestValueReplacer extends J
             String input = "\\${server} \\ \\\\ \\\\\\ \\, ";
             element.setProperty(new StringProperty("domain", input));
             replacer.replaceValues(element);
-            //log.debug("domain property = " + element.getProperty("domain"));
             element.setRunningVersion(true);
             assertEquals(input, element.getPropertyAsString("domain"));
         }
@@ -150,7 +148,6 @@ public class TestValueReplacer extends J
             String input = "${server} \\ \\\\ \\\\\\ \\, ";
             element.setProperty(new StringProperty("domain", input));
             replacer.replaceValues(element);
-            //log.debug("domain property = " + element.getProperty("domain"));
             element.setRunningVersion(true);
             assertEquals("jakarta.apache.org \\ \\ \\\\ , ", element.getPropertyAsString("domain"));
         }

Added: jmeter/trunk/test/src/org/apache/jmeter/functions/EvalFunctionTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/EvalFunctionTest.java?rev=1728418&view=auto
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/EvalFunctionTest.java (added)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/EvalFunctionTest.java Thu Feb  4 08:14:13 2016
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+
+package org.apache.jmeter.functions;
+
+import java.util.Collection;
+
+import org.apache.jmeter.engine.util.CompoundVariable;
+import org.apache.jmeter.junit.JMeterTestCase;
+import org.apache.jmeter.threads.JMeterContext;
+import org.apache.jmeter.threads.JMeterContextService;
+import org.apache.jmeter.threads.JMeterVariables;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.apache.jmeter.functions.FunctionTestHelper.makeParams;
+
+public class EvalFunctionTest extends JMeterTestCase {
+
+    private JMeterContext jmctx = null;
+    private JMeterVariables vars = null;
+    
+    @Before
+    public void setUp() {
+        jmctx = JMeterContextService.getContext();
+        jmctx.setVariables(new JMeterVariables());
+        vars = jmctx.getVariables();
+    }
+    
+    @Test
+    public void evalTest1() throws Exception {
+        EvalFunction eval = new EvalFunction();
+        vars.put("query","select ${column} from ${table}");
+        vars.put("column","name");
+        vars.put("table","customers");
+        Collection<CompoundVariable> parms;
+        String s;
+        
+        parms = makeParams("${query}",null,null);
+        eval.setParameters(parms);
+        s = eval.execute(null,null);
+        assertEquals("select name from customers",s);
+        
+    }
+
+    @Test
+    public void evalTest2() throws Exception {
+        EvalVarFunction evalVar = new EvalVarFunction();
+        vars.put("query","select ${column} from ${table}");
+        vars.put("column","name");
+        vars.put("table","customers");
+        Collection<CompoundVariable> parms;
+        String s;
+        
+        parms = makeParams("query",null,null);
+        evalVar.setParameters(parms);
+        s = evalVar.execute(null,null);
+        assertEquals("select name from customers",s);
+    }
+}

Propchange: jmeter/trunk/test/src/org/apache/jmeter/functions/EvalFunctionTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: jmeter/trunk/test/src/org/apache/jmeter/functions/FunctionTestHelper.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/FunctionTestHelper.java?rev=1728418&view=auto
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/FunctionTestHelper.java (added)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/FunctionTestHelper.java Thu Feb  4 08:14:13 2016
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+
+package org.apache.jmeter.functions;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+import org.apache.jmeter.engine.util.CompoundVariable;
+
+public class FunctionTestHelper {
+
+    public static Collection<CompoundVariable> makeParams(String p1, String p2, String p3) {
+        Collection<CompoundVariable> parms = new LinkedList<>();
+        if (p1 != null) {
+            parms.add(new CompoundVariable(p1));
+        }
+        if (p2 != null) {
+            parms.add(new CompoundVariable(p2));
+        }
+        if (p3 != null) {
+            parms.add(new CompoundVariable(p3));
+        }
+        return parms;
+    }
+}

Propchange: jmeter/trunk/test/src/org/apache/jmeter/functions/FunctionTestHelper.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: jmeter/trunk/test/src/org/apache/jmeter/functions/PackageTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/PackageTest.java?rev=1728418&r1=1728417&r2=1728418&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/PackageTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/PackageTest.java Thu Feb  4 08:14:13 2016
@@ -26,6 +26,8 @@
  */
 package org.apache.jmeter.functions;
 
+import static org.apache.jmeter.functions.FunctionTestHelper.makeParams;
+
 import java.io.FileNotFoundException;
 import java.util.Collection;
 import java.util.LinkedList;
@@ -38,7 +40,6 @@ import org.apache.jmeter.threads.JMeterV
 import org.apache.jmeter.util.BeanShellInterpreter;
 import org.apache.jmeter.util.JMeterUtils;
 import org.apache.jorphan.logging.LoggingManager;
-import org.apache.jorphan.util.JMeterStopThreadException;
 import org.apache.log.Logger;
 
 import junit.extensions.ActiveTestSuite;
@@ -75,25 +76,6 @@ public class PackageTest extends JMeterT
         return cr;
     }
 
-    // Create the StringFromFile function and set its parameters.
-    private static StringFromFile SFFParams(String p1, String p2, String p3, String p4) throws Exception {
-        StringFromFile sff = new StringFromFile();
-        Collection<CompoundVariable> parms = new LinkedList<>();
-        if (p1 != null) {
-            parms.add(new CompoundVariable(p1));
-        }
-        if (p2 != null) {
-            parms.add(new CompoundVariable(p2));
-        }
-        if (p3 != null) {
-            parms.add(new CompoundVariable(p3));
-        }
-        if (p4 != null) {
-            parms.add(new CompoundVariable(p4));
-        }
-        sff.setParameters(parms);
-        return sff;
-    }
 
     // Create the SplitFile function and set its parameters.
     private static SplitFunction splitParams(String p1, String p2, String p3) throws Exception {
@@ -117,24 +99,12 @@ public class PackageTest extends JMeterT
         return bsh;
     }
 
-    private static Collection<CompoundVariable> makeParams(String p1, String p2, String p3) {
-        Collection<CompoundVariable> parms = new LinkedList<>();
-        if (p1 != null) {
-            parms.add(new CompoundVariable(p1));
-        }
-        if (p2 != null) {
-            parms.add(new CompoundVariable(p2));
-        }
-        if (p3 != null) {
-            parms.add(new CompoundVariable(p3));
-        }
-        return parms;
-    }
+    
 
     public static Test suite() throws Exception {
         TestSuite allsuites = new TestSuite("Function PackageTest");
 
-        if (!BeanShellInterpreter.isInterpreterPresent()){
+        if (!BeanShellInterpreter.isInterpreterPresent()) {
             final String msg = "BeanShell jar not present, tests ignored";
             log.warn(msg);
         } else {
@@ -160,14 +130,6 @@ public class PackageTest extends JMeterT
         par.addTest(new PackageTest("CSVThread2"));
         allsuites.addTest(par);
 
-        TestSuite sff = new TestSuite("StringFromFile");
-        sff.addTest(new PackageTest("SFFTest1"));
-        sff.addTest(new PackageTest("SFFTest2"));
-        sff.addTest(new PackageTest("SFFTest3"));
-        sff.addTest(new PackageTest("SFFTest4"));
-        sff.addTest(new PackageTest("SFFTest5"));
-        allsuites.addTest(sff);
-
         TestSuite split = new TestSuite("SplitFunction");
         split.addTest(new PackageTest("splitTest1"));
         allsuites.addTest(split);
@@ -184,10 +146,6 @@ public class PackageTest extends JMeterT
 
         allsuites.addTest(xpath);
         
-        TestSuite random = new TestSuite("Random");
-        random.addTest(new PackageTest("randomTest1"));
-        allsuites.addTest(random);
-
         allsuites.addTest(new PackageTest("XPathSetup1"));
         TestSuite par2 = new ActiveTestSuite("ParallelXPath1");
         par2.addTest(new PackageTest("XPathThread1"));
@@ -200,19 +158,6 @@ public class PackageTest extends JMeterT
         par3.addTest(new PackageTest("XPathThread2"));
         allsuites.addTest(par3);
 
-        TestSuite variable = new TestSuite("Variable");
-        variable.addTest(new PackageTest("variableTest1"));
-        allsuites.addTest(variable);
-        
-        TestSuite eval = new TestSuite("Eval");
-        eval.addTest(new PackageTest("evalTest1"));
-        eval.addTest(new PackageTest("evalTest2"));
-        allsuites.addTest(eval);
-
-        TestSuite intSum = new TestSuite("Sums");
-        intSum.addTest(new PackageTest("sumTest"));
-        allsuites.addTest(intSum);
-
         return allsuites;
     }
 
@@ -377,88 +322,9 @@ public class PackageTest extends JMeterT
         assertEquals("c", vars.get("VAR5_3"));
         assertEquals("?", vars.get("VAR5_4"));
         assertNull(vars.get("VAR5_5"));
-
-}
-
-    public void SFFTest1() throws Exception {
-        StringFromFile sff1 = SFFParams("testfiles/SFFTest#'.'txt", "", "1", "3");
-        assertEquals("uno", sff1.execute());
-        assertEquals("dos", sff1.execute());
-        assertEquals("tres", sff1.execute());
-        assertEquals("cuatro", sff1.execute());
-        assertEquals("cinco", sff1.execute());
-        assertEquals("one", sff1.execute());
-        assertEquals("two", sff1.execute());
-        sff1.execute();
-        sff1.execute();
-        assertEquals("five", sff1.execute());
-        assertEquals("eins", sff1.execute());
-        sff1.execute();
-        sff1.execute();
-        sff1.execute();
-        assertEquals("fuenf", sff1.execute());
-        try {
-            sff1.execute();
-            fail("Should have thrown JMeterStopThreadException");
-        } catch (JMeterStopThreadException e) {
-            // expected
-        }
     }
 
-    public void SFFTest2() throws Exception {
-        StringFromFile sff = SFFParams("testfiles/SFFTest1.txt", "", null, null);
-        assertEquals("uno", sff.execute());
-        assertEquals("dos", sff.execute());
-        assertEquals("tres", sff.execute());
-        assertEquals("cuatro", sff.execute());
-        assertEquals("cinco", sff.execute());
-        assertEquals("uno", sff.execute()); // Restarts
-        assertEquals("dos", sff.execute());
-        assertEquals("tres", sff.execute());
-        assertEquals("cuatro", sff.execute());
-        assertEquals("cinco", sff.execute());
-    }
-
-    public void SFFTest3() throws Exception {
-        StringFromFile sff = SFFParams("testfiles/SFFTest1.txt", "", "", "");
-        assertEquals("uno", sff.execute());
-        assertEquals("dos", sff.execute());
-        assertEquals("tres", sff.execute());
-        assertEquals("cuatro", sff.execute());
-        assertEquals("cinco", sff.execute());
-        assertEquals("uno", sff.execute()); // Restarts
-        assertEquals("dos", sff.execute());
-        assertEquals("tres", sff.execute());
-        assertEquals("cuatro", sff.execute());
-        assertEquals("cinco", sff.execute());
-    }
-
-    public void SFFTest4() throws Exception {
-        StringFromFile sff = SFFParams("xxtestfiles/SFFTest1.txt", "", "", "");
-        assertEquals(StringFromFile.ERR_IND, sff.execute());
-        assertEquals(StringFromFile.ERR_IND, sff.execute());
-    }
-
-    // Test that only loops twice
-    public void SFFTest5() throws Exception {
-        StringFromFile sff = SFFParams("testfiles/SFFTest1.txt", "", "", "2");
-        assertEquals("uno", sff.execute());
-        assertEquals("dos", sff.execute());
-        assertEquals("tres", sff.execute());
-        assertEquals("cuatro", sff.execute());
-        assertEquals("cinco", sff.execute());
-        assertEquals("uno", sff.execute());
-        assertEquals("dos", sff.execute());
-        assertEquals("tres", sff.execute());
-        assertEquals("cuatro", sff.execute());
-        assertEquals("cinco", sff.execute());
-        try {
-            sff.execute();
-            fail("Should have thrown JMeterStopThreadException");
-        } catch (JMeterStopThreadException e) {
-            // expected
-        }
-    }
+   
 
     // Function objects to be tested
     private static CSVRead cr1, cr2, cr3, cr4, cr5, cr6;
@@ -696,7 +562,6 @@ public class PackageTest extends JMeterT
     public void XPathtestrowNum() throws Exception {
         XPathFileContainer f = new XPathFileContainer("../build.xml", "/project/target/@name");
         assertNotNull(f);
-        // assertEquals("Expected 4 lines",4,f.size());
 
         int myRow = f.nextRow();
         assertEquals(0, myRow);
@@ -709,15 +574,6 @@ public class PackageTest extends JMeterT
         myRow = f.nextRow();
         assertEquals(2, myRow);
         assertEquals(3, f.getNextRow());
-
-        // myRow = f.nextRow();
-        // assertEquals(3,myRow);
-        // assertEquals(0,f.getNextRow());
-
-        // myRow = f.nextRow();
-        // assertEquals(0,myRow);
-        // assertEquals(1,f.getNextRow());
-
     }
 
     public void XPathtestColumns() throws Exception {
@@ -830,153 +686,5 @@ public class PackageTest extends JMeterT
         xp.setParameters(parms);
         return xp;        
     }
-    
-
-    
-    public void randomTest1() throws Exception {
-        Random r = new Random();
-        Collection<CompoundVariable> parms = makeParams("0","10000000000","VAR");
-        r.setParameters(parms);
-        String s = 
-            r.execute(null,null);
-        long l = Long.parseLong(s);
-        assertTrue(l>=0 && l<=10000000000L);
-        
-        
-        parms = makeParams("1","1","VAR");
-        r.setParameters(parms);
-        s = 
-            r.execute(null,null);
-        l = Long.parseLong(s);
-        assertTrue(l==1);
-
-    }
 
-    public void variableTest1() throws Exception {
-        Variable r = new Variable();
-        vars.put("A_1","a1");
-        vars.put("A_2","a2");
-        vars.put("one","1");
-        vars.put("two","2");
-        vars.put("V","A");
-        Collection<CompoundVariable> parms;
-        String s;
-        
-        parms = makeParams("V",null,null);
-        r.setParameters(parms);
-        s = r.execute(null,null);
-        assertEquals("A",s);
-        
-        parms = makeParams("X",null,null);
-        r.setParameters(parms);
-        s = r.execute(null,null);
-        assertEquals("X",s);
-        
-        parms = makeParams("A${X}",null,null);
-        r.setParameters(parms);
-        s = r.execute(null,null);
-        assertEquals("A${X}",s);
-        
-        parms = makeParams("A_1",null,null);
-        r.setParameters(parms);
-        s = r.execute(null,null);
-        assertEquals("a1",s);
-        
-        parms = makeParams("A_2",null,null);
-        r.setParameters(parms);
-        s = r.execute(null,null);
-        assertEquals("a2",s);
-        
-        parms = makeParams("A_${two}",null,null);
-        r.setParameters(parms);
-        s = r.execute(null,null);
-        assertEquals("a2",s);
-        
-        parms = makeParams("${V}_${one}",null,null);
-        r.setParameters(parms);
-        s = r.execute(null,null);
-        assertEquals("a1",s);
-    }        
-
-    public void evalTest1() throws Exception {
-        EvalFunction eval = new EvalFunction();
-        vars.put("query","select ${column} from ${table}");
-        vars.put("column","name");
-        vars.put("table","customers");
-        Collection<CompoundVariable> parms;
-        String s;
-        
-        parms = makeParams("${query}",null,null);
-        eval.setParameters(parms);
-        s = eval.execute(null,null);
-        assertEquals("select name from customers",s);
-        
-    }
-
-    public void evalTest2() throws Exception {
-        EvalVarFunction evalVar = new EvalVarFunction();
-        vars.put("query","select ${column} from ${table}");
-        vars.put("column","name");
-        vars.put("table","customers");
-        Collection<CompoundVariable> parms;
-        String s;
-        
-        parms = makeParams("query",null,null);
-        evalVar.setParameters(parms);
-        s = evalVar.execute(null,null);
-        assertEquals("select name from customers",s);
-    }
-    
-    public void sumTest() throws Exception {
-        String maxIntVal = Integer.toString(Integer.MAX_VALUE);
-        String minIntVal = Integer.toString(Integer.MIN_VALUE);
-
-        { // prevent accidental use of is below
-        IntSum is = new IntSum();
-        checkInvalidParameterCounts(is,2);
-        checkSum(is,"3", new String[]{"1","2"});
-        checkSumNoVar(is,"3", new String[]{"1","2"});
-        checkSum(is,"1", new String[]{"-1","1","1","1","-2","1"});
-        checkSumNoVar(is,"1", new String[]{"-1","1","1","1","-2","1"});
-        checkSumNoVar(is,"-1", new String[]{"-1","1","1","1","-2","-1"});
-        checkSum(is,maxIntVal, new String[]{maxIntVal,"0"});
-        checkSum(is,minIntVal, new String[]{maxIntVal,"1"}); // wrap-round check
-        }
-
-        LongSum ls = new LongSum();
-        checkInvalidParameterCounts(ls,2);
-        checkSum(ls,"3", new String[]{"1","2"});
-        checkSum(ls,"1", new String[]{"-1","1","1","1","-1","0"});
-        checkSumNoVar(ls,"3", new String[]{"1","2"});
-        checkSumNoVar(ls,"1", new String[]{"-1","1","1","1","-1","0"});
-        checkSumNoVar(ls,"0", new String[]{"-1","1","1","1","-1","-1"});
-        String maxIntVal_1 = Long.toString(1+(long)Integer.MAX_VALUE);
-        checkSum(ls,maxIntVal, new String[]{maxIntVal,"0"});
-        checkSum(ls,maxIntVal_1, new String[]{maxIntVal,"1"}); // no wrap-round check
-        String maxLongVal = Long.toString(Long.MAX_VALUE);
-        String minLongVal = Long.toString(Long.MIN_VALUE);
-        checkSum(ls,maxLongVal, new String[]{maxLongVal,"0"});
-        checkSum(ls,minLongVal, new String[]{maxLongVal,"1"}); // wrap-round check
-    }
-    
-    // Perform a sum and check the results
-    private void checkSum(AbstractFunction func, String value, String [] addends)  throws Exception {
-        Collection<CompoundVariable> parms = new LinkedList<>();
-        for (int i=0; i< addends.length; i++){
-            parms.add(new CompoundVariable(addends[i]));
-        }
-        parms.add(new CompoundVariable("Result"));
-        func.setParameters(parms);
-        assertEquals(value,func.execute(null,null));
-        assertEquals(value,vars.getObject("Result"));       
-    }
-    // Perform a sum and check the results
-    private void checkSumNoVar(AbstractFunction func, String value, String [] addends)  throws Exception {
-        Collection<CompoundVariable> parms = new LinkedList<>();
-        for (int i=0; i< addends.length; i++){
-            parms.add(new CompoundVariable(addends[i]));
-        }
-        func.setParameters(parms);
-        assertEquals(value,func.execute(null,null));
-    }
 }

Added: jmeter/trunk/test/src/org/apache/jmeter/functions/RandomFunctionTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/RandomFunctionTest.java?rev=1728418&view=auto
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/RandomFunctionTest.java (added)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/RandomFunctionTest.java Thu Feb  4 08:14:13 2016
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+
+package org.apache.jmeter.functions;
+
+import static org.apache.jmeter.functions.FunctionTestHelper.makeParams;
+
+import java.util.Collection;
+
+import org.apache.jmeter.engine.util.CompoundVariable;
+import org.apache.jmeter.junit.JMeterTestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+
+public class RandomFunctionTest extends JMeterTestCase {
+
+    @Test
+    public void randomTest1() throws Exception {
+        Random r = new Random();
+        Collection<CompoundVariable> parms = makeParams("0","10000000000","VAR");
+        r.setParameters(parms);
+        String s = r.execute(null,null);
+        long l = Long.parseLong(s);
+        assertTrue(l>=0 && l<=10000000000L);
+        
+        parms = makeParams("1","1","VAR");
+        r.setParameters(parms);
+        s = r.execute(null,null);
+        l = Long.parseLong(s);
+        assertEquals(1, l);
+    }
+}

Propchange: jmeter/trunk/test/src/org/apache/jmeter/functions/RandomFunctionTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: jmeter/trunk/test/src/org/apache/jmeter/functions/StringFromFileFunctionTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/StringFromFileFunctionTest.java?rev=1728418&view=auto
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/StringFromFileFunctionTest.java (added)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/StringFromFileFunctionTest.java Thu Feb  4 08:14:13 2016
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+
+package org.apache.jmeter.functions;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+import org.apache.jmeter.engine.util.CompoundVariable;
+import org.apache.jmeter.junit.JMeterTestCase;
+import org.apache.jorphan.util.JMeterStopThreadException;
+import org.junit.Test;
+
+public class StringFromFileFunctionTest extends JMeterTestCase {
+
+    @Test
+    public void SFFTest1() throws Exception {
+        StringFromFile sff1 = SFFParams("testfiles/SFFTest#'.'txt", "", "1", "3");
+        assertEquals("uno", sff1.execute());
+        assertEquals("dos", sff1.execute());
+        assertEquals("tres", sff1.execute());
+        assertEquals("cuatro", sff1.execute());
+        assertEquals("cinco", sff1.execute());
+        assertEquals("one", sff1.execute());
+        assertEquals("two", sff1.execute());
+        sff1.execute();
+        sff1.execute();
+        assertEquals("five", sff1.execute());
+        assertEquals("eins", sff1.execute());
+        sff1.execute();
+        sff1.execute();
+        sff1.execute();
+        assertEquals("fuenf", sff1.execute());
+        try {
+            sff1.execute();
+            fail("Should have thrown JMeterStopThreadException");
+        } catch (JMeterStopThreadException e) {
+            // expected
+        }
+    }
+
+    @Test
+    public void SFFTest2() throws Exception {
+        StringFromFile sff = SFFParams("testfiles/SFFTest1.txt", "", null, null);
+        assertEquals("uno", sff.execute());
+        assertEquals("dos", sff.execute());
+        assertEquals("tres", sff.execute());
+        assertEquals("cuatro", sff.execute());
+        assertEquals("cinco", sff.execute());
+        assertEquals("uno", sff.execute()); // Restarts
+        assertEquals("dos", sff.execute());
+        assertEquals("tres", sff.execute());
+        assertEquals("cuatro", sff.execute());
+        assertEquals("cinco", sff.execute());
+    }
+
+    @Test
+    public void SFFTest3() throws Exception {
+        StringFromFile sff = SFFParams("testfiles/SFFTest1.txt", "", "", "");
+        assertEquals("uno", sff.execute());
+        assertEquals("dos", sff.execute());
+        assertEquals("tres", sff.execute());
+        assertEquals("cuatro", sff.execute());
+        assertEquals("cinco", sff.execute());
+        assertEquals("uno", sff.execute()); // Restarts
+        assertEquals("dos", sff.execute());
+        assertEquals("tres", sff.execute());
+        assertEquals("cuatro", sff.execute());
+        assertEquals("cinco", sff.execute());
+    }
+
+    @Test
+    public void SFFTest4() throws Exception {
+        StringFromFile sff = SFFParams("xxtestfiles/SFFTest1.txt", "", "", "");
+        assertEquals(StringFromFile.ERR_IND, sff.execute());
+        assertEquals(StringFromFile.ERR_IND, sff.execute());
+    }
+
+    // Test that only loops twice
+    @Test
+    public void SFFTest5() throws Exception {
+        StringFromFile sff = SFFParams("testfiles/SFFTest1.txt", "", "", "2");
+        assertEquals("uno", sff.execute());
+        assertEquals("dos", sff.execute());
+        assertEquals("tres", sff.execute());
+        assertEquals("cuatro", sff.execute());
+        assertEquals("cinco", sff.execute());
+        assertEquals("uno", sff.execute());
+        assertEquals("dos", sff.execute());
+        assertEquals("tres", sff.execute());
+        assertEquals("cuatro", sff.execute());
+        assertEquals("cinco", sff.execute());
+        try {
+            sff.execute();
+            fail("Should have thrown JMeterStopThreadException");
+        } catch (JMeterStopThreadException e) {
+            // expected
+        }
+    }
+    
+    // Create the StringFromFile function and set its parameters.
+    private static StringFromFile SFFParams(String p1, String p2, String p3, String p4) throws Exception {
+        StringFromFile sff = new StringFromFile();
+        Collection<CompoundVariable> parms = new LinkedList<>();
+        if (p1 != null) {
+            parms.add(new CompoundVariable(p1));
+        }
+        if (p2 != null) {
+            parms.add(new CompoundVariable(p2));
+        }
+        if (p3 != null) {
+            parms.add(new CompoundVariable(p3));
+        }
+        if (p4 != null) {
+            parms.add(new CompoundVariable(p4));
+        }
+        sff.setParameters(parms);
+        return sff;
+    }
+}

Propchange: jmeter/trunk/test/src/org/apache/jmeter/functions/StringFromFileFunctionTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: jmeter/trunk/test/src/org/apache/jmeter/functions/SumFunctionTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/SumFunctionTest.java?rev=1728418&view=auto
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/SumFunctionTest.java (added)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/SumFunctionTest.java Thu Feb  4 08:14:13 2016
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+
+package org.apache.jmeter.functions;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+import org.apache.jmeter.engine.util.CompoundVariable;
+import org.apache.jmeter.junit.JMeterTestCase;
+import org.apache.jmeter.threads.JMeterContext;
+import org.apache.jmeter.threads.JMeterContextService;
+import org.apache.jmeter.threads.JMeterVariables;
+import org.junit.Before;
+import org.junit.Test;
+
+public class SumFunctionTest extends JMeterTestCase {
+
+    private JMeterContext jmctx = null;
+    private JMeterVariables vars = null;
+    
+    @Before
+    public void setUp() {
+        jmctx = JMeterContextService.getContext();
+        jmctx.setVariables(new JMeterVariables());
+        vars = jmctx.getVariables();
+    }
+    
+    @Test
+    public void sumTest() throws Exception {
+        String maxIntVal = Integer.toString(Integer.MAX_VALUE);
+        String minIntVal = Integer.toString(Integer.MIN_VALUE);
+
+        { // prevent accidental use of is below
+            IntSum is = new IntSum();
+            checkInvalidParameterCounts(is, 2);
+            checkSum(is,"3", new String[]{"1","2"});
+            checkSumNoVar(is,"3", new String[]{"1","2"});
+            checkSum(is,"1", new String[]{"-1","1","1","1","-2","1"});
+            checkSumNoVar(is,"1", new String[]{"-1","1","1","1","-2","1"});
+            checkSumNoVar(is,"-1", new String[]{"-1","1","1","1","-2","-1"});
+            checkSum(is,maxIntVal, new String[]{maxIntVal,"0"});
+            checkSum(is,minIntVal, new String[]{maxIntVal,"1"}); // wrap-round check
+        }
+
+        LongSum ls = new LongSum();
+        checkInvalidParameterCounts(ls, 2);
+        checkSum(ls,"3", new String[]{"1","2"});
+        checkSum(ls,"1", new String[]{"-1","1","1","1","-1","0"});
+        checkSumNoVar(ls,"3", new String[]{"1","2"});
+        checkSumNoVar(ls,"1", new String[]{"-1","1","1","1","-1","0"});
+        checkSumNoVar(ls,"0", new String[]{"-1","1","1","1","-1","-1"});
+        String maxIntVal_1 = Long.toString(1+(long)Integer.MAX_VALUE);
+        checkSum(ls,maxIntVal, new String[]{maxIntVal,"0"});
+        checkSum(ls,maxIntVal_1, new String[]{maxIntVal,"1"}); // no wrap-round check
+        String maxLongVal = Long.toString(Long.MAX_VALUE);
+        String minLongVal = Long.toString(Long.MIN_VALUE);
+        checkSum(ls,maxLongVal, new String[]{maxLongVal,"0"});
+        checkSum(ls,minLongVal, new String[]{maxLongVal,"1"}); // wrap-round check
+    }
+    
+    // Perform a sum and check the results
+    private void checkSum(AbstractFunction func, String value, String [] addends)  throws Exception {
+        Collection<CompoundVariable> parms = new LinkedList<>();
+        for (int i=0; i< addends.length; i++){
+            parms.add(new CompoundVariable(addends[i]));
+        }
+        parms.add(new CompoundVariable("Result"));
+        func.setParameters(parms);
+        assertEquals(value, func.execute(null,null));
+        assertEquals(value, vars.getObject("Result"));       
+    }
+    
+    // Perform a sum and check the results
+    private void checkSumNoVar(AbstractFunction func, String value, String [] addends)  throws Exception {
+        Collection<CompoundVariable> parms = new LinkedList<>();
+        for (int i=0; i< addends.length; i++){
+            parms.add(new CompoundVariable(addends[i]));
+        }
+        func.setParameters(parms);
+        assertEquals(value,func.execute(null,null));
+    }
+}

Propchange: jmeter/trunk/test/src/org/apache/jmeter/functions/SumFunctionTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: jmeter/trunk/test/src/org/apache/jmeter/functions/VariableTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/VariableTest.java?rev=1728418&view=auto
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/VariableTest.java (added)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/VariableTest.java Thu Feb  4 08:14:13 2016
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+
+package org.apache.jmeter.functions;
+
+import static org.apache.jmeter.functions.FunctionTestHelper.makeParams;
+import static org.junit.Assert.assertEquals;
+
+import java.util.Collection;
+
+import org.apache.jmeter.engine.util.CompoundVariable;
+import org.apache.jmeter.junit.JMeterTestCase;
+import org.apache.jmeter.threads.JMeterContext;
+import org.apache.jmeter.threads.JMeterContextService;
+import org.apache.jmeter.threads.JMeterVariables;
+import org.junit.Before;
+import org.junit.Test;
+
+public class VariableTest extends JMeterTestCase {
+
+    private JMeterContext jmctx = null;
+    private JMeterVariables vars = null;
+    
+    @Before
+    public void setUp() {
+        jmctx = JMeterContextService.getContext();
+        jmctx.setVariables(new JMeterVariables());
+        vars = jmctx.getVariables();
+    }
+    
+    @Test
+    public void variableTest1() throws Exception {
+        Variable r = new Variable();
+        vars.put("A_1","a1");
+        vars.put("A_2","a2");
+        vars.put("one","1");
+        vars.put("two","2");
+        vars.put("V","A");
+        Collection<CompoundVariable> parms;
+        String s;
+        
+        parms = makeParams("V",null,null);
+        r.setParameters(parms);
+        s = r.execute(null,null);
+        assertEquals("A",s);
+        
+        parms = makeParams("X",null,null);
+        r.setParameters(parms);
+        s = r.execute(null,null);
+        assertEquals("X",s);
+        
+        parms = makeParams("A${X}",null,null);
+        r.setParameters(parms);
+        s = r.execute(null,null);
+        assertEquals("A${X}",s);
+        
+        parms = makeParams("A_1",null,null);
+        r.setParameters(parms);
+        s = r.execute(null,null);
+        assertEquals("a1",s);
+        
+        parms = makeParams("A_2",null,null);
+        r.setParameters(parms);
+        s = r.execute(null,null);
+        assertEquals("a2",s);
+        
+        parms = makeParams("A_${two}",null,null);
+        r.setParameters(parms);
+        s = r.execute(null,null);
+        assertEquals("a2",s);
+        
+        parms = makeParams("${V}_${one}",null,null);
+        r.setParameters(parms);
+        s = r.execute(null,null);
+        assertEquals("a1",s);
+    }
+}

Propchange: jmeter/trunk/test/src/org/apache/jmeter/functions/VariableTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: jmeter/trunk/test/src/org/apache/jmeter/gui/action/TestLoad.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/gui/action/TestLoad.java?rev=1728418&r1=1728417&r2=1728418&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/gui/action/TestLoad.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/gui/action/TestLoad.java Thu Feb  4 08:14:13 2016
@@ -70,18 +70,17 @@ public class TestLoad extends JMeterTest
     }
 
     public static TestSuite suite(){
-        TestSuite suite=new TestSuite("Load Test");
-        //suite.addTest(new TestLoad("checkGuiPackage"));
-        scanFiles(suite,testfiledir);
-        scanFiles(suite,demofiledir);
+        TestSuite suite = new TestSuite("Load Test");
+        scanFiles(suite, testfiledir);
+        scanFiles(suite, demofiledir);
         return suite;
     }
 
     private static void scanFiles(TestSuite suite, File parent) {
-        File testFiles[]=parent.listFiles(jmxFilter);
         String dir = parent.getName();
-        for (int i=0; i<testFiles.length; i++){
-            suite.addTest(new TestLoad("checkTestFile",testFiles[i],dir));
+        File[] testFiles = parent.listFiles(jmxFilter);
+        for (File file : testFiles) {
+            suite.addTest(new TestLoad("checkTestFile", file, dir));
         }
     }
     

Modified: jmeter/trunk/test/src/org/apache/jmeter/protocol/http/modifier/TestURLRewritingModifier.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/modifier/TestURLRewritingModifier.java?rev=1728418&r1=1728417&r2=1728418&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/protocol/http/modifier/TestURLRewritingModifier.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/protocol/http/modifier/TestURLRewritingModifier.java Thu Feb  4 08:14:13 2016
@@ -203,7 +203,6 @@ public class TestURLRewritingModifier ex
             context.setCurrentSampler(sampler);
             context.setPreviousResult(response);
             mod.process();
-            // Arguments args = sampler.getArguments();
             assertEquals("index.html;%24sid%24KQNq3AAADQZoEQAxlkX8uQV5bjqVBPbT", sampler.getPath());
         }
 

Modified: jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java?rev=1728418&r1=1728417&r2=1728418&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java Thu Feb  4 08:14:13 2016
@@ -122,9 +122,6 @@ public class TestHTMLParser extends JMet
                 this.userAgent = userAgent;
             }
 
-//            private TestData(String f, String b, String s) {
-//                this(f, b, s, null);
-//            }
         }
         
         private static final String DEFAULT_JMETER_PARSER = 

Modified: jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PackageTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PackageTest.java?rev=1728418&r1=1728417&r2=1728418&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PackageTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PackageTest.java Thu Feb  4 08:14:13 2016
@@ -21,9 +21,9 @@
  */
 package org.apache.jmeter.protocol.http.sampler;
 
-import java.awt.HeadlessException;
+import static org.junit.Assert.assertEquals;
 
-import junit.framework.TestCase;
+import java.awt.GraphicsEnvironment;
 
 import org.apache.jmeter.config.Arguments;
 import org.apache.jmeter.config.ConfigTestElement;
@@ -32,22 +32,21 @@ import org.apache.jmeter.protocol.http.c
 import org.apache.jmeter.protocol.http.util.HTTPArgument;
 import org.apache.jorphan.logging.LoggingManager;
 import org.apache.log.Logger;
+import org.junit.Test;
 
-public class PackageTest extends TestCase {
+public class PackageTest {
     private static final Logger log = LoggingManager.getLoggerForClass();
 
-    public PackageTest(String arg0) {
-        super(arg0);
-    }
-
+    @Test
     public void testConfiguring() throws Exception {
-        try {
-            HTTPSamplerBase sampler = (HTTPSamplerBase) new HttpTestSampleGui().createTestElement();
-            configure(sampler);
-        } catch (HeadlessException e) {
-            System.out.println("o.a.j.junit.JMeterTest Error running testConfiguring due to Headless mode, "+e.toString());
-            log.warn("o.a.j.junit.JMeterTest Error running testConfiguring due to Headless mode, "+e.toString());
+        if(GraphicsEnvironment.isHeadless()) {
+            System.out.println("Skipping test:"+getClass().getName()+"#testConfiguring"+", cannot run in Headless mode");
+            log.warn("Skipping test:"+getClass().getName()+"#testConfiguring"+", cannot run in Headless mode");
+            return;
         }
+        
+        HTTPSamplerBase sampler = (HTTPSamplerBase) new HttpTestSampleGui().createTestElement();
+        configure(sampler);
     }
 
     private void configure(HTTPSamplerBase sampler) throws Exception {

Modified: jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/PackageTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/PackageTest.java?rev=1728418&r1=1728417&r2=1728418&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/PackageTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/PackageTest.java Thu Feb  4 08:14:13 2016
@@ -35,7 +35,6 @@ import org.apache.jorphan.reflect.ClassF
 import org.apache.log.Logger;
 
 import junit.framework.Test;
-// import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
 /*
@@ -50,9 +49,7 @@ import junit.framework.TestSuite;
 public final class PackageTest extends JMeterTestCaseJUnit3 {
     private static final Logger log = LoggingManager.getLoggerForClass();
 
-    // ResourceBundle i18nEdit=
-    // ResourceBundle.getBundle("org.apache.jmeter.resources.i18nedit");
-    private static final Locale defaultLocale = new Locale("en",""); // i18nEdit.getString("locale.default");
+    private static final Locale defaultLocale = new Locale("en","");
 
     private final ResourceBundle defaultBundle;
 
@@ -81,7 +78,7 @@ public final class PackageTest extends J
     @Override
     public void setUp() {
         if (testLocale == null) {
-            return;// errorDetected()
+            return;
         }
         JMeterUtils.setLocale(testLocale);
         Introspector.flushFromCaches(testBeanClass);
@@ -106,7 +103,7 @@ public final class PackageTest extends J
     public void runTest() throws Throwable {
         if (testLocale == null) {
             super.runTest();
-            return;// errorDetected()
+            return;
         }
         if (bundle == defaultBundle) {
             checkAllNecessaryKeysPresent();
@@ -155,7 +152,6 @@ public final class PackageTest extends J
             String name = descriptors[i].getName();
 
             bundle.getString(name + ".displayName");
-            // bundle.getString(name+".shortDescription"); NOT MANDATORY
 
             String group = (String) descriptors[i].getValue(GenericTestBeanCustomizer.GROUP);
             if (group != null) {
@@ -179,8 +175,7 @@ public final class PackageTest extends J
                         GenericTestBeanCustomizer.RESOURCE_BUNDLE);
             } catch (IntrospectionException e) {
                 log.error("Can't get beanInfo for " + testBeanClass.getName(), e);
-                throw new Error(e.toString(), e); // Programming error. Don't
-                                                // continue.
+                throw new Error(e.toString(), e); // Programming error. Don't continue.
             }
 
             if (defaultBundle == null) {
@@ -190,15 +185,14 @@ public final class PackageTest extends J
                 }
                 errorDetected=true;
                 log.error("No default bundle found for " + className + " using " + defaultLocale.toString());
-                //throw new Error("No default bundle for class " + className);
                 continue;
             }
 
             suite.addTest(new PackageTest(testBeanClass, defaultLocale, defaultBundle));
 
-            String [] languages = JMeterMenuBar.getLanguages();
-            for (int i=0; i < languages.length; i++){
-                final String[] language = languages[i].split("_");
+            String[] languages = JMeterMenuBar.getLanguages();
+            for (String lang : languages) {
+                final String[] language = lang.split("_");
                 if (language.length == 1){
                     suite.addTest(new PackageTest(testBeanClass, new Locale(language[0]), defaultBundle));                                    
                 } else if (language.length == 2){

Modified: jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/TestBooleanPropertyEditor.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/TestBooleanPropertyEditor.java?rev=1728418&r1=1728417&r2=1728418&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/TestBooleanPropertyEditor.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/TestBooleanPropertyEditor.java Thu Feb  4 08:14:13 2016
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertNot
 
 import java.beans.PropertyEditor;
 import java.beans.PropertyEditorManager;
+
 import org.junit.Test;
 
 /**
@@ -29,7 +30,7 @@ import org.junit.Test;
  *
  * Also checks that BooleanPropertyEditor behaves in the same way.
  */
-public class TestBooleanPropertyEditor extends junit.framework.TestCase {
+public class TestBooleanPropertyEditor {
  
     /*
      * N.B.

Modified: jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/TestComboStringEditor.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/TestComboStringEditor.java?rev=1728418&r1=1728417&r2=1728418&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/TestComboStringEditor.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/TestComboStringEditor.java Thu Feb  4 08:14:13 2016
@@ -21,7 +21,7 @@ import static org.junit.Assert.assertNot
 
 import org.junit.Test;
 
-public class TestComboStringEditor extends junit.framework.TestCase {
+public class TestComboStringEditor {
 
         private void testSetGet(ComboStringEditor e, Object value) throws Exception {
             e.setValue(value);



Mime
View raw message