jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1728223 [2/2] - in /jmeter/trunk: test/src/org/apache/commons/cli/avalon/ test/src/org/apache/jmeter/ test/src/org/apache/jmeter/assertions/ test/src/org/apache/jmeter/config/ test/src/org/apache/jmeter/config/gui/ test/src/org/apache/jmet...
Date Tue, 02 Feb 2016 21:45:58 GMT
Modified: jmeter/trunk/test/src/org/apache/jmeter/extractor/TestRegexExtractor.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/extractor/TestRegexExtractor.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/extractor/TestRegexExtractor.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/extractor/TestRegexExtractor.java Tue Feb  2 21:45:57 2016
@@ -19,29 +19,31 @@
 package org.apache.jmeter.extractor;
 
 
-import java.net.URL;
-
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
+import java.net.URL;
 import org.apache.jmeter.samplers.SampleResult;
 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 TestRegexExtractor extends TestCase {
+public class TestRegexExtractor {
+    
         private RegexExtractor extractor;
 
         private SampleResult result;
 
         private JMeterVariables vars;
 
-        public TestRegexExtractor(String name) {
-            super(name);
-        }
-
         private JMeterContext jmctx;
 
-        @Override
+        @Before
         public void setUp() {
             jmctx = JMeterContextService.getContext();
             extractor = new RegexExtractor();
@@ -65,6 +67,7 @@ public class TestRegexExtractor extends
             jmctx.setPreviousResult(result);
         }
 
+        @Test
         public void testEmptyDefaultVariable() throws Exception {
             extractor.setRegex("<value name=\"positioncount\">(.+?)</value>");
             extractor.setTemplate("$1$");
@@ -74,6 +77,7 @@ public class TestRegexExtractor extends
             assertEquals("", vars.get("regVal"));
         }
         
+        @Test
         public void testNotEmptyDefaultVariable() throws Exception {
             extractor.setRegex("<value name=\"positioncount\">(.+?)</value>");
             extractor.setTemplate("$1$");
@@ -83,6 +87,7 @@ public class TestRegexExtractor extends
             assertNull(vars.get("regVal"));
         }
         
+        @Test
         public void testVariableExtraction0() throws Exception {
             extractor.setRegex("<(value) field=\"");
             extractor.setTemplate("$1$");
@@ -91,6 +96,7 @@ public class TestRegexExtractor extends
             assertEquals("value", vars.get("regVal"));
         }
 
+        @Test
         public void testVariableExtraction() throws Exception {
             extractor.setRegex("<value field=\"(pinposition\\d+)\">(\\d+)</value>");
             extractor.setTemplate("$2$");
@@ -111,6 +117,7 @@ public class TestRegexExtractor extends
             rex.process();
         }
 
+        @Test
         public void testTemplate1() throws Exception {
             templateSetup(extractor, "");
             assertEquals("<company-xmlext-query-ret>", vars.get("regVal_g0"));
@@ -121,36 +128,43 @@ public class TestRegexExtractor extends
             assertEquals("3",vars.get("regVal_g"));
         }
 
+        @Test
         public void testTemplate2() throws Exception {
             templateSetup(extractor, "ABC");
             assertEquals("ABC", vars.get("regVal"));
         }
 
+        @Test
         public void testTemplate3() throws Exception {
             templateSetup(extractor, "$2$");
             assertEquals("query", vars.get("regVal"));
         }
 
+        @Test
         public void testTemplate4() throws Exception {
             templateSetup(extractor, "PRE$2$");
             assertEquals("PREquery", vars.get("regVal"));
         }
 
+        @Test
         public void testTemplate5() throws Exception {
             templateSetup(extractor, "$2$POST");
             assertEquals("queryPOST", vars.get("regVal"));
         }
 
+        @Test
         public void testTemplate6() throws Exception {
             templateSetup(extractor, "$2$$1$");
             assertEquals("queryxmlext", vars.get("regVal"));
         }
 
+        @Test
         public void testTemplate7() throws Exception {
             templateSetup(extractor, "$2$MID$1$");
             assertEquals("queryMIDxmlext", vars.get("regVal"));
         }
 
+        @Test
         public void testVariableExtraction2() throws Exception {
             extractor.setRegex("<value field=\"(pinposition\\d+)\">(\\d+)</value>");
             extractor.setTemplate("$1$");
@@ -159,6 +173,7 @@ public class TestRegexExtractor extends
             assertEquals("pinposition3", vars.get("regVal"));
         }
 
+        @Test
         public void testVariableExtraction6() throws Exception {
             extractor.setRegex("<value field=\"(pinposition\\d+)\">(\\d+)</value>");
             extractor.setTemplate("$2$");
@@ -168,6 +183,7 @@ public class TestRegexExtractor extends
             assertEquals("default", vars.get("regVal"));
         }
 
+        @Test
         public void testVariableExtraction3() throws Exception {
             extractor.setRegex("<value field=\"(pinposition\\d+)\">(\\d+)</value>");
             extractor.setTemplate("_$1$");
@@ -176,6 +192,7 @@ public class TestRegexExtractor extends
             assertEquals("_pinposition2", vars.get("regVal"));
         }
 
+        @Test
         public void testVariableExtraction5() throws Exception {
             extractor.setRegex("<value field=\"(pinposition\\d+)\">(\\d+)</value>");
             extractor.setTemplate("$1$");
@@ -233,6 +250,7 @@ public class TestRegexExtractor extends
             assertNull("Unused variables should be null", vars.get("regVal_1_g2"));
         }
 
+        @Test
         public void testVariableExtraction7() throws Exception {
             extractor.setRegex("Header1: (\\S+)");
             extractor.setTemplate("$1$");
@@ -256,6 +274,7 @@ public class TestRegexExtractor extends
             assertTrue("useURL should be true", extractor.useUrl());
         }
 
+        @Test
         public void testVariableExtraction8() throws Exception {
             extractor.setRegex("http://jakarta\\.apache\\.org/(\\w+)");
             extractor.setTemplate("$1$");
@@ -271,6 +290,7 @@ public class TestRegexExtractor extends
             assertEquals("index",vars.get("regVal"));
         }
 
+        @Test
         public void testVariableExtraction9() throws Exception {
             extractor.setRegex("(\\w+)");
             extractor.setTemplate("$1$");
@@ -294,6 +314,7 @@ public class TestRegexExtractor extends
             assertEquals("brown",vars.get("regVal"));
         }
 
+        @Test
         public void testNoDefault() throws Exception {
             extractor.setRegex("<value field=\"(pinposition\\d+)\">(\\d+)</value>");
             extractor.setTemplate("$2$");
@@ -305,6 +326,7 @@ public class TestRegexExtractor extends
             assertEquals("initial", vars.get("regVal"));
         }
 
+        @Test
         public void testDefault() throws Exception {
             extractor.setRegex("<value field=\"(pinposition\\d+)\">(\\d+)</value>");
             extractor.setTemplate("$2$");
@@ -318,6 +340,7 @@ public class TestRegexExtractor extends
             assertNull(vars.get("regVal_g1"));
         }
 
+        @Test
         public void testStaleVariables() throws Exception {
             extractor.setRegex("<value field=\"(pinposition\\d+)\">(\\d+)</value>");
             extractor.setTemplate("$2$");
@@ -338,6 +361,7 @@ public class TestRegexExtractor extends
             assertNull(vars.get("regVal_g"));
         }
 
+    @Test
     public void testScope1() throws Exception {
         result.setResponseData("<title>ONE</title>", "ISO-8859-1");
         extractor.setScopeParent();
@@ -355,6 +379,7 @@ public class TestRegexExtractor extends
         assertEquals("NOTFOUND", vars.get("regVal"));
     }
 
+    @Test
     public void testScope2() throws Exception {
         result.sampleStart();
         result.setResponseData("<title>PARENT</title>", "ISO-8859-1");

Modified: jmeter/trunk/test/src/org/apache/jmeter/extractor/TestXPathExtractor.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/extractor/TestXPathExtractor.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/extractor/TestXPathExtractor.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/extractor/TestXPathExtractor.java Tue Feb  2 21:45:57 2016
@@ -19,16 +19,18 @@
 package org.apache.jmeter.extractor;
 
 
-import java.io.UnsupportedEncodingException;
-
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
 
+import java.io.UnsupportedEncodingException;
 import org.apache.jmeter.samplers.SampleResult;
 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 TestXPathExtractor extends TestCase {
+public class TestXPathExtractor {
         private XPathExtractor extractor;
 
         private SampleResult result;
@@ -37,15 +39,13 @@ public class TestXPathExtractor extends
         
         private JMeterVariables vars;
 
-        public TestXPathExtractor(String name) {
-            super(name);
-        }
 
         private JMeterContext jmctx;
 
         private static final String VAL_NAME = "value";
         private static final String VAL_NAME_NR = "value_matchNr";
-        @Override
+        
+        @Before
         public void setUp() throws UnsupportedEncodingException {
             jmctx = JMeterContextService.getContext();
             extractor = new XPathExtractor();
@@ -60,6 +60,7 @@ public class TestXPathExtractor extends
             jmctx.setPreviousResult(result);
         }
 
+        @Test
         public void testAttributeExtraction() throws Exception {
             extractor.setXPathQuery("/book/preface/@title");
             extractor.process();
@@ -89,6 +90,7 @@ public class TestXPathExtractor extends
             assertNull(vars.get(VAL_NAME+"_1"));
         }
         
+        @Test
         public void testVariableExtraction() throws Exception {
             extractor.setXPathQuery("/book/preface");
             extractor.process();
@@ -154,6 +156,7 @@ public class TestXPathExtractor extends
             assertEquals("<a><b/></a>", vars.get(VAL_NAME));
         }
 
+        @Test
         public void testScope(){
             extractor.setXPathQuery("/book/preface");
             extractor.process();
@@ -204,6 +207,7 @@ public class TestXPathExtractor extends
             
         }
 
+        @Test
         public void testInvalidXpath() throws Exception {
             extractor.setXPathQuery("<");
             extractor.process();
@@ -211,6 +215,7 @@ public class TestXPathExtractor extends
             assertEquals("0", vars.get(VAL_NAME_NR));
         }
 
+        @Test
         public void testInvalidDocument() throws Exception {
             result.setResponseData("<z>", null);
             extractor.setXPathQuery("<");

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=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/PackageTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/PackageTest.java Tue Feb  2 21:45:57 2016
@@ -30,12 +30,8 @@ import java.io.FileNotFoundException;
 import java.util.Collection;
 import java.util.LinkedList;
 
-import junit.extensions.ActiveTestSuite;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 import org.apache.jmeter.engine.util.CompoundVariable;
-import org.apache.jmeter.junit.JMeterTestCase;
+import org.apache.jmeter.junit.JMeterTestCaseJUnit3;
 import org.apache.jmeter.threads.JMeterContext;
 import org.apache.jmeter.threads.JMeterContextService;
 import org.apache.jmeter.threads.JMeterVariables;
@@ -45,10 +41,14 @@ import org.apache.jorphan.logging.Loggin
 import org.apache.jorphan.util.JMeterStopThreadException;
 import org.apache.log.Logger;
 
+import junit.extensions.ActiveTestSuite;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
 /**
  * Test cases for Functions
  */
-public class PackageTest extends JMeterTestCase {
+public class PackageTest extends JMeterTestCaseJUnit3 {
 
     private static final Logger log = LoggingManager.getLoggerForClass();
 

Modified: jmeter/trunk/test/src/org/apache/jmeter/functions/TestFileRowColContainer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/TestFileRowColContainer.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/TestFileRowColContainer.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/TestFileRowColContainer.java Tue Feb  2 21:45:57 2016
@@ -18,9 +18,15 @@
 
 package org.apache.jmeter.functions;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.FileNotFoundException;
 
 import org.apache.jmeter.junit.JMeterTestCase;
+import org.junit.Test;
 
 /**
  * File data container for CSV (and similar delimited) files Data is accessible
@@ -30,6 +36,7 @@ import org.apache.jmeter.junit.JMeterTes
  */
 public class TestFileRowColContainer extends JMeterTestCase {
 
+    @Test
     public void testNull() throws Exception {
         try {
             new FileRowColContainer(findTestPath("testfiles/xyzxyz"));
@@ -38,6 +45,7 @@ public class TestFileRowColContainer ext
         }
     }
 
+    @Test
     public void testrowNum() throws Exception {
         FileRowColContainer f = new FileRowColContainer(findTestPath("testfiles/test.csv"));
         assertNotNull(f);
@@ -51,6 +59,7 @@ public class TestFileRowColContainer ext
 
     }
 
+    @Test
     public void testColumns() throws Exception {
         FileRowColContainer f = new FileRowColContainer(findTestPath("testfiles/test.csv"));
         assertNotNull(f);
@@ -72,6 +81,7 @@ public class TestFileRowColContainer ext
         assertEquals("c2", f.getColumn(myRow, 2));
     }
 
+    @Test
     public void testColumnsComma() throws Exception {
         FileRowColContainer f = new FileRowColContainer(findTestPath("testfiles/test.csv"), ",");
         assertNotNull(f);
@@ -93,6 +103,7 @@ public class TestFileRowColContainer ext
         assertEquals("c2", f.getColumn(myRow, 2));
     }
 
+    @Test
     public void testColumnsTab() throws Exception {
         FileRowColContainer f = new FileRowColContainer(findTestPath("testfiles/test.tsv"), "\t");
         assertNotNull(f);
@@ -114,6 +125,7 @@ public class TestFileRowColContainer ext
         assertEquals("c2", f.getColumn(myRow, 2));
     }
 
+    @Test
     public void testEmptyCols() throws Exception {
         FileRowColContainer f = new FileRowColContainer(findTestPath("testfiles/testempty.csv"));
         assertNotNull(f);

Modified: jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexl2Function.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexl2Function.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexl2Function.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexl2Function.java Tue Feb  2 21:45:57 2016
@@ -18,6 +18,8 @@
 
 package org.apache.jmeter.functions;
 
+import static org.junit.Assert.assertEquals;
+
 import java.util.Collection;
 import java.util.LinkedList;
 
@@ -27,6 +29,8 @@ import org.apache.jmeter.samplers.Sample
 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 TestJexl2Function extends JMeterTestCase {
     protected AbstractFunction function;
@@ -39,11 +43,7 @@ public class TestJexl2Function extends J
 
     private JMeterContext jmctx;
 
-    public TestJexl2Function(String name) {
-        super(name);
-    }
-
-    @Override
+    @Before
     public void setUp() {
         function = new Jexl2Function();
         result = new SampleResult();
@@ -56,10 +56,12 @@ public class TestJexl2Function extends J
         params = new LinkedList<>();
     }
 
+    @Test
     public void testParameterCount() throws Exception {
         checkInvalidParameterCounts(function, 1, 2);
     }
 
+    @Test
     public void testSum() throws Exception {
         params.add(new CompoundVariable("1+2+3"));
         function.setParameters(params);
@@ -67,6 +69,7 @@ public class TestJexl2Function extends J
         assertEquals("6", ret);
     }
 
+    @Test
     public void testSumVar() throws Exception {
         params.add(new CompoundVariable("1+2+3"));
         params.add(new CompoundVariable("TOTAL"));
@@ -76,6 +79,7 @@ public class TestJexl2Function extends J
         assertEquals("6", vars.get("TOTAL"));
     }
 
+    @Test
     public void testReplace1() throws Exception {
         params.add(new CompoundVariable(
                 "sampleResult.getResponseDataAsString().replaceAll('T','t')"));
@@ -84,6 +88,7 @@ public class TestJexl2Function extends J
         assertEquals("the quick brown fox", ret);
     }
     
+    @Test
     public void testReplace2() throws Exception {
         vars.put("URL", "/query.cgi?s1=1&amp;s2=2&amp;s3=3");
         params.add(new CompoundVariable("vars.get('URL').replaceAll('&amp;','&')"));

Modified: jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexl3Function.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexl3Function.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexl3Function.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexl3Function.java Tue Feb  2 21:45:57 2016
@@ -18,13 +18,11 @@
 
 package org.apache.jmeter.functions;
 
+import org.junit.Before;
 
 public class TestJexl3Function extends TestJexl2Function {
-    
-    public TestJexl3Function(String name) {
-        super(name);
-    }
 
+    @Before
     @Override
     public void setUp() {
         super.setUp();

Modified: jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexlFunction.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexlFunction.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexlFunction.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexlFunction.java Tue Feb  2 21:45:57 2016
@@ -18,6 +18,8 @@
 
 package org.apache.jmeter.functions;
 
+import static org.junit.Assert.assertEquals;
+
 import java.util.Collection;
 import java.util.LinkedList;
 
@@ -27,6 +29,8 @@ import org.apache.jmeter.samplers.Sample
 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 TestJexlFunction extends JMeterTestCase {
     private JexlFunction function;
@@ -39,11 +43,7 @@ public class TestJexlFunction extends JM
 
     private JMeterContext jmctx;
 
-    public TestJexlFunction(String name) {
-        super(name);
-    }
-
-    @Override
+    @Before
     public void setUp() {
         function = new JexlFunction();
         result = new SampleResult();
@@ -56,10 +56,12 @@ public class TestJexlFunction extends JM
         params = new LinkedList<>();
     }
 
+    @Test
     public void testParameterCount() throws Exception {
         checkInvalidParameterCounts(function, 1, 2);
     }
 
+    @Test
     public void testSum() throws Exception {
         params.add(new CompoundVariable("1+2+3"));
         function.setParameters(params);
@@ -67,6 +69,7 @@ public class TestJexlFunction extends JM
         assertEquals("6", ret);
     }
 
+    @Test
     public void testSumVar() throws Exception {
         params.add(new CompoundVariable("1+2+3"));
         params.add(new CompoundVariable("TOTAL"));
@@ -76,6 +79,7 @@ public class TestJexlFunction extends JM
         assertEquals("6", vars.get("TOTAL"));
     }
 
+    @Test
     public void testReplace1() throws Exception {
         params.add(new CompoundVariable(
                 "sampleResult.getResponseDataAsString().replaceAll('T','t')"));
@@ -84,6 +88,7 @@ public class TestJexlFunction extends JM
         assertEquals("the quick brown fox", ret);
     }
     
+    @Test
     public void testReplace2() throws Exception {
         vars.put("URL", "/query.cgi?s1=1&amp;s2=2&amp;s3=3");
         params.add(new CompoundVariable("vars.get('URL').replaceAll('&amp;','&')"));

Modified: jmeter/trunk/test/src/org/apache/jmeter/functions/TestRegexFunction.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/TestRegexFunction.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/TestRegexFunction.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/TestRegexFunction.java Tue Feb  2 21:45:57 2016
@@ -18,6 +18,9 @@
 
 package org.apache.jmeter.functions;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
 import java.util.Collection;
 import java.util.LinkedList;
 
@@ -27,6 +30,8 @@ import org.apache.jmeter.samplers.Sample
 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 TestRegexFunction extends JMeterTestCase {
         private static final String INPUT_VARIABLE_NAME = "INVAR";
@@ -41,11 +46,7 @@ public class TestRegexFunction extends J
 
         private JMeterContext jmctx;
 
-        public TestRegexFunction(String name) {
-            super(name);
-        }
-
-        @Override
+        @Before
         public void setUp() {
             variable = new RegexFunction();
             result = new SampleResult();
@@ -65,6 +66,7 @@ public class TestRegexFunction extends J
             jmctx.setPreviousResult(result);
         }
 
+        @Test
         public void testVariableExtraction() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
@@ -76,6 +78,7 @@ public class TestRegexFunction extends J
         }
 
         // Test with output variable name
+        @Test
         public void testVariableExtraction1a() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
@@ -95,6 +98,7 @@ public class TestRegexFunction extends J
         }
 
         // Test with empty output variable name
+        @Test
         public void testVariableExtraction1b() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
@@ -109,6 +113,7 @@ public class TestRegexFunction extends J
             assertNull(vars.getObject("OUTVAR"));
         }
 
+        @Test
         public void testVariableExtractionFromVariable() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
@@ -128,6 +133,7 @@ public class TestRegexFunction extends J
             assertEquals("times", vars.getObject("OUTVAR_g2"));
         }
 
+        @Test
         public void testVariableExtractionFromVariable2() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
@@ -147,6 +153,7 @@ public class TestRegexFunction extends J
             assertEquals("times", vars.getObject("OUTVAR_g2"));
         }
 
+        @Test
         public void testVariableExtractionFromVariable3() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
@@ -166,6 +173,7 @@ public class TestRegexFunction extends J
             assertEquals("times", vars.getObject("OUTVAR_g2"));
         }
 
+        @Test
         public void testVariableExtractionFromVariable4() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
@@ -185,6 +193,7 @@ public class TestRegexFunction extends J
             assertEquals("times", vars.getObject("OUTVAR_g2"));
         }
 
+        @Test
         public void testVariableExtractionFromVariable5() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
@@ -204,6 +213,7 @@ public class TestRegexFunction extends J
             assertEquals("times", vars.getObject("OUTVAR_g2"));
         }
 
+        @Test
         public void testVariableExtractionFromVariable6() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
@@ -223,6 +233,7 @@ public class TestRegexFunction extends J
             assertEquals("times", vars.getObject("OUTVAR_g2"));
         }
 
+        @Test
         public void testVariableExtractionFromVariable7() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
@@ -242,6 +253,7 @@ public class TestRegexFunction extends J
             assertEquals("times", vars.getObject("OUTVAR_g2"));
         }
 
+        @Test
         public void testVariableExtractionFromVariable8() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
@@ -261,6 +273,7 @@ public class TestRegexFunction extends J
             assertEquals("times", vars.getObject("OUTVAR_g2"));
         }
 
+        @Test
         public void testVariableExtractionFromVariable9() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
@@ -280,6 +293,7 @@ public class TestRegexFunction extends J
             assertEquals("times", vars.getObject("OUTVAR_g2"));
         }
 
+        @Test
         public void testVariableExtraction2() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
@@ -290,6 +304,7 @@ public class TestRegexFunction extends J
             assertEquals("pinposition3", match);
         }
 
+        @Test
         public void testVariableExtraction5() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
@@ -301,6 +316,7 @@ public class TestRegexFunction extends J
             assertEquals("pinposition1_pinposition2_pinposition3", match);
         }
 
+        @Test
         public void testVariableExtraction6() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
@@ -313,6 +329,7 @@ public class TestRegexFunction extends J
             assertEquals("default", match);
         }
 
+        @Test
         public void testComma() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("<value,? field=\"(pinposition\\d+)\">(\\d+)</value>"));
@@ -323,6 +340,7 @@ public class TestRegexFunction extends J
             assertEquals("pinposition3", match);
         }
 
+        @Test
         public void testVariableExtraction3() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
@@ -333,6 +351,7 @@ public class TestRegexFunction extends J
             assertEquals("_pinposition2", match);
         }
 
+        @Test
         public void testVariableExtraction4() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
@@ -343,6 +362,7 @@ public class TestRegexFunction extends J
             assertEquals("1, ", match);
         }
 
+        @Test
         public void testDefaultValue() throws Exception {
             params = new LinkedList<>();
             params.add(new CompoundVariable("<value,, field=\"(pinposition\\d+)\">(\\d+)</value>"));

Modified: jmeter/trunk/test/src/org/apache/jmeter/functions/TestTimeFunction.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/functions/TestTimeFunction.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/functions/TestTimeFunction.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/functions/TestTimeFunction.java Tue Feb  2 21:45:57 2016
@@ -18,6 +18,11 @@
 
 package org.apache.jmeter.functions;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.util.Collection;
 import java.util.LinkedList;
 import java.util.Locale;
@@ -28,6 +33,8 @@ import org.apache.jmeter.samplers.Sample
 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 TestTimeFunction extends JMeterTestCase {
         private Function variable;
@@ -42,11 +49,7 @@ public class TestTimeFunction extends JM
 
         private String value;
         
-        public TestTimeFunction(String name) {
-            super(name);
-        }
-
-        @Override
+        @Before
         public void setUp() {
             jmctx = JMeterContextService.getContext();
             vars = new JMeterVariables();
@@ -57,6 +60,7 @@ public class TestTimeFunction extends JM
             variable = new TimeFunction();
         }
 
+        @Test
         public void testDefault() throws Exception {
             variable.setParameters(params);
             long before = System.currentTimeMillis();
@@ -66,6 +70,7 @@ public class TestTimeFunction extends JM
             assertTrue(now >= before && now <= after);
         }
         
+        @Test
         public void testDefault1() throws Exception {
             params.add(new CompoundVariable());
             variable.setParameters(params);
@@ -76,6 +81,7 @@ public class TestTimeFunction extends JM
             assertTrue(now >= before && now <= after);
         }
         
+        @Test
         public void testDefault2() throws Exception {
             params.add(new CompoundVariable());
             params.add(new CompoundVariable());
@@ -87,6 +93,7 @@ public class TestTimeFunction extends JM
             assertTrue(now >= before && now <= after);
         }
         
+        @Test
         public void testDefaultNone() throws Exception {
             long before = System.currentTimeMillis();
             value = variable.execute(result, null);
@@ -95,6 +102,7 @@ public class TestTimeFunction extends JM
             assertTrue(now >= before && now <= after);
         }
         
+        @Test
         public void testTooMany() throws Exception {
             params.add(new CompoundVariable("YMD"));
             params.add(new CompoundVariable("NAME"));
@@ -106,6 +114,7 @@ public class TestTimeFunction extends JM
             }
         }
         
+        @Test
         public void testYMD() throws Exception {
             params.add(new CompoundVariable("YMD"));
             params.add(new CompoundVariable("NAME"));
@@ -115,6 +124,7 @@ public class TestTimeFunction extends JM
             assertEquals(value,vars.get("NAME"));
         }
 
+        @Test
         public void testYMDnoV() throws Exception {
             params.add(new CompoundVariable("YMD"));
             variable.setParameters(params);
@@ -123,6 +133,7 @@ public class TestTimeFunction extends JM
             assertNull(vars.get("NAME"));
         }
 
+        @Test
         public void testHMS() throws Exception {
             params.add(new CompoundVariable("HMS"));
             variable.setParameters(params);
@@ -130,6 +141,7 @@ public class TestTimeFunction extends JM
             assertEquals(6,value.length());
         }
 
+        @Test
         public void testYMDHMS() throws Exception {
             params.add(new CompoundVariable("YMDHMS"));
             variable.setParameters(params);
@@ -137,6 +149,7 @@ public class TestTimeFunction extends JM
             assertEquals(15,value.length());
         }
 
+        @Test
         public void testUSER1() throws Exception {
             params.add(new CompoundVariable("USER1"));
             variable.setParameters(params);
@@ -144,6 +157,7 @@ public class TestTimeFunction extends JM
             assertEquals(0,value.length());
         }
 
+        @Test
         public void testUSER2() throws Exception {
             params.add(new CompoundVariable("USER2"));
             variable.setParameters(params);
@@ -151,6 +165,7 @@ public class TestTimeFunction extends JM
             assertEquals(0,value.length());
         }
 
+        @Test
         public void testFixed() throws Exception {
             params.add(new CompoundVariable("'Fixed text'"));
             variable.setParameters(params);
@@ -158,6 +173,7 @@ public class TestTimeFunction extends JM
             assertEquals("Fixed text",value);
         }
 
+        @Test
         public void testMixed() throws Exception {
             params.add(new CompoundVariable("G"));
             variable.setParameters(params);
@@ -168,6 +184,7 @@ public class TestTimeFunction extends JM
             assertEquals("AD",value);
         }
 
+        @Test
         public void testDivisor() throws Exception {
             params.add(new CompoundVariable("/1000"));
             variable.setParameters(params);
@@ -178,6 +195,7 @@ public class TestTimeFunction extends JM
             assertTrue(now >= before && now <= after);
         }
 
+        @Test
         public void testDivisorNoMatch() throws Exception {
             params.add(new CompoundVariable("/1000 ")); // trailing space
             variable.setParameters(params);

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=1728223&r1=1728222&r2=1728223&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 Tue Feb  2 21:45:57 2016
@@ -23,17 +23,17 @@ import java.io.FilenameFilter;
 import java.util.HashSet;
 import java.util.Set;
 
-import junit.framework.TestSuite;
-
-import org.apache.jmeter.junit.JMeterTestCase;
+import org.apache.jmeter.junit.JMeterTestCaseJUnit3;
 import org.apache.jmeter.save.SaveService;
 import org.apache.jorphan.collections.HashTree;
 
+import junit.framework.TestSuite;
+
 /**
  * 
  * Test JMX files to check that they can be loaded OK.
  */
-public class TestLoad extends JMeterTestCase {
+public class TestLoad extends JMeterTestCaseJUnit3 {
 
     private static final String basedir = new File(System.getProperty("user.dir")).getParent();
     private static final File testfiledir = new File(basedir,"bin/testfiles");

Modified: jmeter/trunk/test/src/org/apache/jmeter/gui/action/TestSave.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/gui/action/TestSave.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/gui/action/TestSave.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/gui/action/TestSave.java Tue Feb  2 21:45:57 2016
@@ -18,23 +18,25 @@
 
 package org.apache.jmeter.gui.action;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.jmeter.config.Arguments;
 import org.apache.jmeter.gui.tree.JMeterTreeNode;
 import org.apache.jorphan.collections.HashTree;
 import org.apache.jorphan.collections.ListedHashTree;
+import org.junit.Before;
+import org.junit.Test;
 
-public class TestSave extends junit.framework.TestCase {
+public class TestSave {
         private Save save;
 
-        public TestSave(String name) {
-            super(name);
-        }
 
-        @Override
+        @Before
         public void setUp() {
             save = new Save();
         }
 
+        @Test
         public void testTreeConversion() throws Exception {
             HashTree tree = new ListedHashTree();
             JMeterTreeNode root = new JMeterTreeNode(new Arguments(), null);

Modified: jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java Tue Feb  2 21:45:57 2016
@@ -18,6 +18,9 @@
 
 package org.apache.jmeter.gui.util;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
 import java.awt.HeadlessException;
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
@@ -27,9 +30,11 @@ import java.util.Properties;
 import org.apache.jmeter.junit.JMeterTestCase;
 import org.apache.jmeter.util.JMeterUtils;
 import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
+import org.junit.Test;
 
 public class JSyntaxTextAreaTest extends JMeterTestCase {
 
+    @Test
     public void testSetLanguage() {
         try {
             JSyntaxTextArea textArea = new JSyntaxTextArea(30, 50, false);
@@ -40,6 +45,7 @@ public class JSyntaxTextAreaTest extends
         }
     }
   
+    @Test
     public void testSyntaxNames() throws IllegalArgumentException,
             IllegalAccessException {
         HashSet<String> values = new HashSet<>();

Modified: jmeter/trunk/test/src/org/apache/jmeter/gui/util/TestMenuFactory.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/gui/util/TestMenuFactory.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/gui/util/TestMenuFactory.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/gui/util/TestMenuFactory.java Tue Feb  2 21:45:57 2016
@@ -18,28 +18,24 @@
 
 package org.apache.jmeter.gui.util;
 
+import static org.junit.Assert.assertFalse;
+
 import java.awt.GraphicsEnvironment;
 
 import org.apache.jmeter.junit.JMeterTestCase;
 import org.apache.jorphan.logging.LoggingManager;
 import org.apache.log.Logger;
+import org.junit.Test;
 
 public final class TestMenuFactory extends JMeterTestCase {
 
     private static final Logger log = LoggingManager.getLoggerForClass();
     
-        public TestMenuFactory() {
-            super();
-        }
-
-        public TestMenuFactory(String name) {
-            super(name);
-        }
-
-        private static void check(String s, int i) throws Exception {
-            assertFalse("The number of " + s + " should not be 0", 0 == i);
-        }
+    private static void check(String s, int i) throws Exception {
+        assertFalse("The number of " + s + " should not be 0", 0 == i);
+    }
 
+        @Test
         public void testMenu() throws Exception {
             if(GraphicsEnvironment.isHeadless()) {
                 System.out.println("Skipping test:"+getClass().getName()+"#testCloneSampler"+", cannot run in Headless mode");
@@ -59,6 +55,5 @@ public final class TestMenuFactory exten
             check("timers", MenuFactory.timers_size());
 
             check("elementstoskip", MenuFactory.elementsToSkip_size());
-
         }
 }

Modified: jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTest.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTest.java Tue Feb  2 21:45:57 2016
@@ -61,7 +61,7 @@ import org.jdom.Document;
 import org.jdom.Element;
 import org.jdom.input.SAXBuilder;
 
-public class JMeterTest extends JMeterTestCase {
+public class JMeterTest extends JMeterTestCaseJUnit3 {
     private static final Logger log = LoggingManager.getLoggerForClass();
 
     private static Map<String, Boolean> guiTitles;

Modified: jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTestCase.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTestCase.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTestCase.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTestCase.java Tue Feb  2 21:45:57 2016
@@ -18,15 +18,14 @@
 
 package org.apache.jmeter.junit;
 
+import static org.junit.Assert.fail;
+
 import java.io.File;
 import java.nio.charset.Charset;
 import java.util.Collection;
 import java.util.LinkedList;
 import java.util.Locale;
 import java.util.MissingResourceException;
-
-import junit.framework.TestCase;
-
 import org.apache.jmeter.engine.util.CompoundVariable;
 import org.apache.jmeter.functions.AbstractFunction;
 import org.apache.jmeter.functions.InvalidVariableException;
@@ -37,17 +36,10 @@ import org.apache.log.Logger;
 /*
  * Extend JUnit TestCase to provide common setup
  */
-public abstract class JMeterTestCase extends TestCase {
+public abstract class JMeterTestCase {
     // Used by findTestFile
     private static final String filePrefix;
 
-    public JMeterTestCase() {
-        super();
-    }
-
-    public JMeterTestCase(String name) {
-        super(name);
-    }
 
     /*
      * If not running under AllTests.java, make sure that the properties (and
@@ -100,12 +92,6 @@ public abstract class JMeterTestCase ext
             logprop("os.version");
             logprop("os.arch");
             logprop("java.class.path");
-            // String cp = System.getProperty("java.class.path");
-            // String cpe[]= JOrphanUtils.split(cp,File.pathSeparator);
-            // System.out.println("java.class.path=");
-            // for (int i=0;i<cpe.length;i++){
-            // System.out.println(cpe[i]);
-            // }
         } else {
             filePrefix = "";
         }

Added: jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTestCaseJUnit3.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTestCaseJUnit3.java?rev=1728223&view=auto
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTestCaseJUnit3.java (added)
+++ jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTestCaseJUnit3.java Tue Feb  2 21:45:57 2016
@@ -0,0 +1,133 @@
+/*
+ * 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.junit;
+
+import java.io.File;
+import java.nio.charset.Charset;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Locale;
+import java.util.MissingResourceException;
+
+import org.apache.jmeter.engine.util.CompoundVariable;
+import org.apache.jmeter.functions.AbstractFunction;
+import org.apache.jmeter.functions.InvalidVariableException;
+import org.apache.jmeter.util.JMeterUtils;
+
+import junit.framework.TestCase;
+
+/*
+ * Extend JUnit TestCase to provide common setup
+ */
+public abstract class JMeterTestCaseJUnit3 extends TestCase {
+    // Used by findTestFile
+    private static final String filePrefix;
+
+    public JMeterTestCaseJUnit3() {
+        super();
+    }
+
+    public JMeterTestCaseJUnit3(String name) {
+        super(name);
+    }
+
+    /*
+     * If not running under AllTests.java, make sure that the properties (and
+     * log file) are set up correctly.
+     * 
+     * N.B. In order for this to work correctly, the JUnit test must be started
+     * in the bin directory, and all the JMeter jars (plus any others needed at
+     * run-time) need to be on the classpath.
+     * 
+     */
+    static {
+        if (JMeterUtils.getJMeterProperties() == null) {
+            String file = "testfiles/jmetertest.properties";
+            File f = new File(file);
+            if (!f.canRead()) {
+                System.out.println("Can't find " + file + " - trying bin directory");
+                file = "bin/" + file;// JMeterUtils assumes Unix-style separators
+                filePrefix = "bin/";
+            } else {
+                filePrefix = "";
+            }
+            // Used to be done in initializeProperties
+            String home=new File(System.getProperty("user.dir"),filePrefix).getParent();
+            System.out.println("Setting JMeterHome: "+home);
+            JMeterUtils.setJMeterHome(home);
+            System.setProperty("jmeter.home", home); // needed for scripts
+            JMeterUtils jmu = new JMeterUtils();
+            try {
+                jmu.initializeProperties(file);
+            } catch (MissingResourceException e) {
+                System.out.println("** Can't find resources - continuing anyway **");
+            }
+            System.out.println("JMeterVersion="+JMeterUtils.getJMeterVersion());
+            logprop("java.version");
+            logprop("java.vm.name");
+            logprop("java.vendor");
+            logprop("java.home");
+            logprop("file.encoding");
+            // Display actual encoding used (will differ if file.encoding is not recognised)
+            System.out.println("default encoding="+Charset.defaultCharset());
+            logprop("user.home");
+            logprop("user.dir");
+            logprop("user.language");
+            logprop("user.region");
+            logprop("user.country");
+            logprop("user.variant");
+            System.out.println("Locale="+Locale.getDefault().toString());
+            logprop("java.class.version");
+            logprop("os.name");
+            logprop("os.version");
+            logprop("os.arch");
+            logprop("java.class.path");
+        } else {
+            filePrefix = "";
+        }
+    }
+
+    private static void logprop(String prop) {
+        System.out.println(prop + "=" + System.getProperty(prop));
+    }
+
+    // Helper method to find a file
+    protected static File findTestFile(String file) {
+        File f = new File(file);
+        if (filePrefix.length() > 0 && !f.isAbsolute()) {
+            f = new File(filePrefix, file);// Add the offset
+        }
+        return f;
+    }
+
+    protected void checkInvalidParameterCounts(AbstractFunction func, int minimum)
+            throws Exception {
+        Collection<CompoundVariable> parms = new LinkedList<>();
+        for (int c = 0; c < minimum; c++) {
+            try {
+                func.setParameters(parms);
+                fail("Should have generated InvalidVariableException for " + parms.size()
+                        + " parameters");
+            } catch (InvalidVariableException ignored) {
+            }
+            parms.add(new CompoundVariable());
+        }
+        func.setParameters(parms);
+    }
+}

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

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Tue Feb  2 21:45:57 2016
@@ -217,6 +217,7 @@ Summary
 <li><bug>58704</bug>Non regression testing : Ant task batchtest fails if tests and run in a non en_EN locale and use a JMX file that uses a Csv DataSet</li>
 <li><bug>58897</bug>Improve JUnit Test code. Contributed by Benoit Wiart (benoit dot wiart at gmail.com)</li>
 <li><bug>58949</bug>Cleanup of ldap code. Based on a patch by Benoit Wiart (benoit dot wiart at gmail.com)</li>
+<li><bug>58897</bug>Improve JUnit Test code. Contributed by Benoit Wiart (benoit dot wiart at gmail.com)</li>
 </ul>
  
  <!-- =================== Bug fixes =================== -->



Mime
View raw message