jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1728223 [1/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
Author: pmouawad
Date: Tue Feb  2 21:45:57 2016
New Revision: 1728223

URL: http://svn.apache.org/viewvc?rev=1728223&view=rev
Log:
Bug 58897 - Improve JUnit Test code
#resolve #100
Bugzilla Id: 58897

Added:
    jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTestCaseJUnit3.java   (with props)
Modified:
    jmeter/trunk/test/src/org/apache/commons/cli/avalon/ClutilTestCase.java
    jmeter/trunk/test/src/org/apache/jmeter/JMeterVersionTest.java
    jmeter/trunk/test/src/org/apache/jmeter/assertions/MD5HexAssertionTest.java
    jmeter/trunk/test/src/org/apache/jmeter/assertions/ResponseAssertionTest.java
    jmeter/trunk/test/src/org/apache/jmeter/assertions/SMIMEAssertionTest.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/config/TestCVSDataSet.java
    jmeter/trunk/test/src/org/apache/jmeter/config/gui/TestArgumentsPanel.java
    jmeter/trunk/test/src/org/apache/jmeter/control/TestGenericController.java
    jmeter/trunk/test/src/org/apache/jmeter/control/TestIfController.java
    jmeter/trunk/test/src/org/apache/jmeter/control/TestInterleaveControl.java
    jmeter/trunk/test/src/org/apache/jmeter/control/TestLoopController.java
    jmeter/trunk/test/src/org/apache/jmeter/control/TestOnceOnlyController.java
    jmeter/trunk/test/src/org/apache/jmeter/control/TestRandomOrderController.java
    jmeter/trunk/test/src/org/apache/jmeter/control/TestRunTime.java
    jmeter/trunk/test/src/org/apache/jmeter/control/TestSwitchController.java
    jmeter/trunk/test/src/org/apache/jmeter/control/TestThroughputController.java
    jmeter/trunk/test/src/org/apache/jmeter/control/TestWhileController.java
    jmeter/trunk/test/src/org/apache/jmeter/engine/DistributedRunnerTest.java
    jmeter/trunk/test/src/org/apache/jmeter/engine/TestTreeCloner.java
    jmeter/trunk/test/src/org/apache/jmeter/engine/util/PackageTest.java
    jmeter/trunk/test/src/org/apache/jmeter/engine/util/TestValueReplacer.java
    jmeter/trunk/test/src/org/apache/jmeter/extractor/TestRegexExtractor.java
    jmeter/trunk/test/src/org/apache/jmeter/extractor/TestXPathExtractor.java
    jmeter/trunk/test/src/org/apache/jmeter/functions/PackageTest.java
    jmeter/trunk/test/src/org/apache/jmeter/functions/TestFileRowColContainer.java
    jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexl2Function.java
    jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexl3Function.java
    jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexlFunction.java
    jmeter/trunk/test/src/org/apache/jmeter/functions/TestRegexFunction.java
    jmeter/trunk/test/src/org/apache/jmeter/functions/TestTimeFunction.java
    jmeter/trunk/test/src/org/apache/jmeter/gui/action/TestLoad.java
    jmeter/trunk/test/src/org/apache/jmeter/gui/action/TestSave.java
    jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java
    jmeter/trunk/test/src/org/apache/jmeter/gui/util/TestMenuFactory.java
    jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTest.java
    jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTestCase.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/test/src/org/apache/commons/cli/avalon/ClutilTestCase.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/commons/cli/avalon/ClutilTestCase.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/commons/cli/avalon/ClutilTestCase.java (original)
+++ jmeter/trunk/test/src/org/apache/commons/cli/avalon/ClutilTestCase.java Tue Feb  2 21:45:57 2016
@@ -18,16 +18,19 @@
  */
 package org.apache.commons.cli.avalon;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
 // Renamed from org.apache.avalon.excalibur.cli
 
 import java.util.List;
-
-import junit.framework.TestCase;
+import org.junit.Test;
 
 /**
  * 
  */
-public final class ClutilTestCase extends TestCase {
+public final class ClutilTestCase {
     private static final String[] ARGLIST1 = new String[] { "--you", "are", "--all", "-cler", "kid" };
 
     private static final String[] ARGLIST2 = new String[] { "-Dstupid=idiot", "are", "--all", "here", "-d" };
@@ -119,17 +122,7 @@ public final class ClutilTestCase extend
                     '2', "two parameters")
     };
 
-
-    
-
-    public ClutilTestCase() {
-        this("Command Line Interpreter Test Case");
-    }
-
-    public ClutilTestCase(String name) {
-        super(name);
-    }
-
+    @Test
     public void testOptionalArgWithSpace() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { ALL, TAINT };
 
@@ -157,6 +150,7 @@ public final class ClutilTestCase extend
         assertEquals(option2.getArgument(0), null);
     }
 
+    @Test
     public void testOptionalArgLong() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { ALL, TAINT };
 
@@ -185,6 +179,7 @@ public final class ClutilTestCase extend
         assertEquals(option2.getArgument(0), null);
     }
 
+    @Test
     public void testOptionalArgLongEquals() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { ALL, TAINT };
 
@@ -209,6 +204,7 @@ public final class ClutilTestCase extend
         assertEquals(option2.getArgument(0), null);
     }
 
+    @Test
     public void testShortOptArgUnenteredBeforeOtherOpt() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { ALL, TAINT };
 
@@ -232,6 +228,7 @@ public final class ClutilTestCase extend
         assertEquals(option1.getArgument(0), null);
     }
 
+    @Test
     public void testOptionalArgsWithArgShortBeforeOtherOpt() {
         // "-T3","-a"
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { ALL, TAINT };
@@ -255,6 +252,7 @@ public final class ClutilTestCase extend
         assertEquals(null, option1.getArgument(0));
     }
 
+    @Test
     public void testOptionalArgsWithArgShortEqualsBeforeOtherOpt() {
         // "-T3","-a"
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { ALL, TAINT };
@@ -278,6 +276,7 @@ public final class ClutilTestCase extend
         assertEquals(null, option1.getArgument(0));
     }
 
+    @Test
     public void testOptionalArgsNoArgShortBeforeOtherOpt() {
         // "-T","-a"
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { ALL, TAINT };
@@ -301,6 +300,7 @@ public final class ClutilTestCase extend
         assertEquals(null, option1.getArgument(0));
     }
 
+    @Test
     public void testFullParse() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { YOU, ALL, CLEAR1, CLEAR2, CLEAR3, CLEAR5 };
 
@@ -322,6 +322,7 @@ public final class ClutilTestCase extend
         assertEquals(clOptions.get(7).getDescriptor().getId(), 0);
     }
 
+    @Test
     public void testDuplicateOptions() {
         // "-Dstupid=idiot","are","--all","--all","here"
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { DEFINE, ALL, CLEAR1 };
@@ -341,6 +342,7 @@ public final class ClutilTestCase extend
         assertEquals(clOptions.get(4).getDescriptor().getId(), 0);
     }
 
+    @Test
     public void testIncompatableOptions() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { DEFINE, ALL, CLEAR1, BLEE };
 
@@ -359,6 +361,7 @@ public final class ClutilTestCase extend
         assertEquals(clOptions.get(4).getDescriptor().getId(), 0);
     }
 
+    @Test
     public void testSingleArg() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { FILE };
 
@@ -374,6 +377,7 @@ public final class ClutilTestCase extend
         assertEquals(clOptions.get(0).getArgument(), "myfile.txt");
     }
 
+    @Test
     public void testSingleArg2() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { FILE };
 
@@ -393,6 +397,7 @@ public final class ClutilTestCase extend
         assertEquals("-=,=-", clOptions.get(0).getArgument());
     }
 
+    @Test
     public void testSingleArg3() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { FILE };
 
@@ -412,6 +417,7 @@ public final class ClutilTestCase extend
         assertEquals("-=,-", clOptions.get(0).getArgument());
     }
 
+    @Test
     public void testSingleArg4() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { FILE };
 
@@ -427,6 +433,7 @@ public final class ClutilTestCase extend
         assertEquals("myfile.txt", clOptions.get(0).getArgument());
     }
 
+    @Test
     public void testSingleArg5() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { FILE };
 
@@ -442,6 +449,7 @@ public final class ClutilTestCase extend
         assertEquals("myfile.txt", clOptions.get(0).getArgument());
     }
 
+    @Test
     public void testSingleArg6() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { FILE };
 
@@ -457,6 +465,7 @@ public final class ClutilTestCase extend
         assertEquals("-=-", clOptions.get(0).getArgument());
     }
 
+    @Test
     public void testSingleArg7() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { FILE };
 
@@ -472,6 +481,7 @@ public final class ClutilTestCase extend
         assertEquals("-=-", clOptions.get(0).getArgument());
     }
 
+    @Test
     public void testSingleArg8() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { FILE };
 
@@ -487,6 +497,7 @@ public final class ClutilTestCase extend
         assertEquals("-=-", clOptions.get(0).getArgument());
     }
 
+    @Test
     public void testSingleArg9() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { FILE };
 
@@ -502,6 +513,7 @@ public final class ClutilTestCase extend
         assertEquals("-=-", clOptions.get(0).getArgument());
     }
 
+    @Test
     public void testCombinedArgs1() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { BLEE, TAINT };
 
@@ -518,6 +530,7 @@ public final class ClutilTestCase extend
         assertEquals("rest", clOptions.get(2).getArgument());
     }
 
+    @Test
     public void testCombinedArgs2() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { BLEE, TAINT, FILE };
 
@@ -534,6 +547,7 @@ public final class ClutilTestCase extend
         assertEquals("a", clOptions.get(2).getArgument());
     }
 
+    @Test
     public void testCombinedArgs3() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { BLEE, TAINT, FILE };
 
@@ -555,6 +569,7 @@ public final class ClutilTestCase extend
         assertEquals("-fa", clOptions.get(2).getArgument());
     }
 
+    @Test
     public void testCombinedArgs4() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { BLEE, TAINT, FILE };
 
@@ -577,6 +592,7 @@ public final class ClutilTestCase extend
         assertEquals("a", clOptions.get(3).getArgument());
     }
 
+    @Test
     public void test2ArgsParse() {
         // "-Dstupid=idiot","are","--all","here"
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { DEFINE, ALL, CLEAR1, CASE_CHECK };
@@ -600,6 +616,7 @@ public final class ClutilTestCase extend
         assertEquals("idiot", option.getArgument(1));
     }
 
+    @Test
     public void test2ArgsParse2() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { DEFINE };
 
@@ -624,6 +641,7 @@ public final class ClutilTestCase extend
         assertEquals("d-e,f", option.getArgument(1));
     }
 
+    @Test
     public void test2ArgsParse3() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { DEFINE };
 
@@ -642,6 +660,7 @@ public final class ClutilTestCase extend
         assertEquals("G-e,f", option.getArgument(1));
     }
 
+    @Test
     public void test2ArgsParse4() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { DEFINE_MANY };
 
@@ -676,6 +695,7 @@ public final class ClutilTestCase extend
         assertEquals("-4", option.getArgument(1));
     }
 
+    @Test
     public void testPartParse() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { YOU };
 
@@ -697,6 +717,7 @@ public final class ClutilTestCase extend
         assertEquals(clOptions.get(0).getDescriptor().getId(), YOU_OPT);
     }
 
+    @Test
     public void test2PartParse() {
         final CLOptionDescriptor[] options1 = new CLOptionDescriptor[] { YOU };
 
@@ -736,6 +757,7 @@ public final class ClutilTestCase extend
         assertEquals(clOptions2.get(6).getDescriptor().getId(), 0);
     }
 
+    @Test
     public void test2PartPartialParse() {
         final CLOptionDescriptor[] options1 = new CLOptionDescriptor[] { YOU, ALL, CLEAR1 };
 
@@ -775,6 +797,7 @@ public final class ClutilTestCase extend
         assertEquals(clOptions2.get(1).getDescriptor().getId(), 0);
     }
 
+    @Test
     public void testDuplicatesFail() {
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { YOU, ALL, CLEAR1, CLEAR2, CLEAR3, CLEAR5 };
 
@@ -783,6 +806,7 @@ public final class ClutilTestCase extend
         assertNull(parser.getErrorString(), parser.getErrorString());
     }
 
+    @Test
     public void testIncomplete2Args() {
         // "-Dstupid="
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { DEFINE };
@@ -801,6 +825,7 @@ public final class ClutilTestCase extend
         assertEquals(option.getArgument(1), "");
     }
 
+    @Test
     public void testIncomplete2ArgsMixed() {
         // "-Dstupid=","-c"
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { DEFINE, CLEAR1 };
@@ -822,6 +847,7 @@ public final class ClutilTestCase extend
         assertEquals(option.getArgument(1), "");
     }
 
+    @Test
     public void testIncomplete2ArgsMixedNoEq() {
         // "-Dstupid","-c"
         final CLOptionDescriptor[] options = new CLOptionDescriptor[] { DEFINE, CLEAR1 };
@@ -846,6 +872,7 @@ public final class ClutilTestCase extend
     /**
      * Test the getArgumentById and getArgumentByName lookup methods.
      */
+    @Test
     public void testArgumentLookup() {
         final String[] args = { "-f", "testarg" };
         final CLOptionDescriptor[] options = { FILE };
@@ -867,6 +894,7 @@ public final class ClutilTestCase extend
     /**
      * Test that you can have null long forms.
      */
+    @Test
     public void testNullLongForm() {
         final CLOptionDescriptor test = new CLOptionDescriptor(null, CLOptionDescriptor.ARGUMENT_DISALLOWED, 'n',
                 "test null long form");
@@ -888,6 +916,7 @@ public final class ClutilTestCase extend
     /**
      * Test that you can have null descriptions.
      */
+    @Test
     public void testNullDescription() {
         final CLOptionDescriptor test = new CLOptionDescriptor("nulltest", CLOptionDescriptor.ARGUMENT_DISALLOWED, 'n',
                 null);
@@ -907,6 +936,7 @@ public final class ClutilTestCase extend
         assertEquals("Testing display of null description", "\t-n, --nulltest" + lineSeparator, sb.toString());
     }
     
+    @Test
     public void testCombinations() throws Exception {
         check(new String [] {},"");    
         check(new String [] {"--none",

Modified: jmeter/trunk/test/src/org/apache/jmeter/JMeterVersionTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/JMeterVersionTest.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/JMeterVersionTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/JMeterVersionTest.java Tue Feb  2 21:45:57 2016
@@ -18,6 +18,10 @@
 
 package org.apache.jmeter;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
@@ -36,6 +40,8 @@ import java.util.regex.Pattern;
 
 import org.apache.jmeter.junit.JMeterTestCase;
 import org.apache.jmeter.util.JMeterUtils;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * Check the eclipse and Maven version definitions against build.properties
@@ -57,14 +63,6 @@ public class JMeterVersionTest extends J
 
     private static final File JMETER_HOME = new File(JMeterUtils.getJMeterHome());
 
-    public JMeterVersionTest() {
-        super();
-    }
-
-    public JMeterVersionTest(String arg0) {
-        super(arg0);
-    }
-    
     /**
      * Versions of libraries mentioned in build.properties
      */
@@ -80,8 +78,8 @@ public class JMeterVersionTest extends J
 
     private Properties prop;
 
-    @Override
-    protected void setUp() throws Exception {
+    @Before
+    public void setUp() throws Exception {
         final Properties buildProp = new Properties();
         final FileInputStream bp = new FileInputStream(getFileFromHome("build.properties"));
         buildProp.load(bp);
@@ -112,6 +110,7 @@ public class JMeterVersionTest extends J
      * Check eclipse.classpath contains the jars declared in build.properties
      * @throws Exception if something fails
      */
+    @Test
     public void testEclipse() throws Exception {
         final BufferedReader eclipse = new BufferedReader(
                 new FileReader(getFileFromHome("eclipse.classpath"))); // assume default charset is OK here
@@ -170,6 +169,7 @@ public class JMeterVersionTest extends J
         }
     }
 
+    @Test
     public void testMaven() throws Exception {
         final BufferedReader maven = new BufferedReader(
                 new FileReader(getFileFromHome("res/maven/ApacheJMeter_parent.pom"))); // assume default charset is OK here
@@ -199,6 +199,7 @@ public class JMeterVersionTest extends J
         }
    }
 
+    @Test
     public void testLicences() {
         Set<String> liceNames = new HashSet<>();
         for (Map.Entry<String, String> me : versions.entrySet()) {
@@ -227,6 +228,7 @@ public class JMeterVersionTest extends J
     /**
      * Check that all downloads use Maven Central
      */
+    @Test
     public void testMavenDownload() {
         int fails = 0;
         for (Entry<Object, Object> entry : prop.entrySet()) {

Modified: jmeter/trunk/test/src/org/apache/jmeter/assertions/MD5HexAssertionTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/assertions/MD5HexAssertionTest.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/assertions/MD5HexAssertionTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/assertions/MD5HexAssertionTest.java Tue Feb  2 21:45:57 2016
@@ -18,19 +18,14 @@
 
 package org.apache.jmeter.assertions;
 
-import junit.framework.TestCase;
-public class MD5HexAssertionTest extends TestCase {
+import org.junit.Assert;
+import org.junit.Test;
 
-    public MD5HexAssertionTest() {
-        super();
-    }
-
-    public MD5HexAssertionTest(String arg0) {
-        super(arg0);
-    }
+public class MD5HexAssertionTest {
 
+    @Test
     public void testMD5() throws Exception {
-        assertEquals("D41D8CD98F00B204E9800998ECF8427E", MD5HexAssertion.baMD5Hex(new byte[] {}).toUpperCase(java.util.Locale.ENGLISH));
+        Assert.assertEquals("D41D8CD98F00B204E9800998ECF8427E", MD5HexAssertion.baMD5Hex(new byte[] {}).toUpperCase(java.util.Locale.ENGLISH));
     }
 
 }

Modified: jmeter/trunk/test/src/org/apache/jmeter/assertions/ResponseAssertionTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/assertions/ResponseAssertionTest.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/assertions/ResponseAssertionTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/assertions/ResponseAssertionTest.java Tue Feb  2 21:45:57 2016
@@ -18,19 +18,24 @@
 
 package org.apache.jmeter.assertions;
 
+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.MalformedURLException;
 import java.net.URL;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicInteger;
-
-import junit.framework.TestCase;
-
 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 ResponseAssertionTest  extends TestCase {
+public class ResponseAssertionTest {
 
     public ResponseAssertionTest() {
     }
@@ -39,7 +44,7 @@ public class ResponseAssertionTest  exte
     private SampleResult sample;
     private AssertionResult result;
     
-    @Override
+    @Before
     public void setUp() throws MalformedURLException {
         JMeterContext jmctx = JMeterContextService.getContext();
         assertion = new ResponseAssertion();
@@ -54,6 +59,7 @@ public class ResponseAssertionTest  exte
         sample.setResponseHeaders("X-Header: abcd");
     }
 
+    @Test
     public void testResponseAssertionEquals() throws Exception{
         assertion.unsetNotType();
         assertion.setToEqualsType();
@@ -71,6 +77,7 @@ public class ResponseAssertionTest  exte
         assertPassed();
     }
     
+    @Test
     public void testResponseAssertionHeaders() throws Exception{
         assertion.unsetNotType();
         assertion.setToEqualsType();
@@ -86,6 +93,7 @@ public class ResponseAssertionTest  exte
         assertPassed();
     }
     
+    @Test
     public void testResponseAssertionContains() throws Exception{
         assertion.unsetNotType();
         assertion.setToContainsType();
@@ -130,6 +138,7 @@ public class ResponseAssertionTest  exte
     }
 
     // Bug 46831 - check can match dollars
+    @Test
     public void testResponseAssertionContainsDollar() throws Exception {
         sample.setResponseData("value=\"${ID}\" Group$ctl00$drpEmails", null);
         assertion.unsetNotType();
@@ -141,6 +150,7 @@ public class ResponseAssertionTest  exte
         assertPassed();        
     }
     
+    @Test
     public void testResponseAssertionSubstring() throws Exception{
         assertion.unsetNotType();
         assertion.setToSubstringType();
@@ -202,6 +212,7 @@ public class ResponseAssertionTest  exte
     }
     private AtomicInteger failed;
 
+    @Test
     public void testThreadSafety() throws Exception {
         Thread[] threads = new Thread[100];
         CountDownLatch latch = new CountDownLatch(threads.length);

Modified: jmeter/trunk/test/src/org/apache/jmeter/assertions/SMIMEAssertionTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/assertions/SMIMEAssertionTest.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/assertions/SMIMEAssertionTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/assertions/SMIMEAssertionTest.java Tue Feb  2 21:45:57 2016
@@ -18,6 +18,8 @@
 
 package org.apache.jmeter.assertions;
 
+import static org.junit.Assert.assertFalse;
+
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.Properties;
@@ -25,10 +27,9 @@ import java.util.Properties;
 import javax.mail.MessagingException;
 import javax.mail.Session;
 import javax.mail.internet.MimeMessage;
-
-import junit.framework.TestCase;
-
 import org.apache.jmeter.samplers.SampleResult;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * Tests for the SMIMEAssertion.
@@ -87,12 +88,12 @@ import org.apache.jmeter.samplers.Sample
  * If a new signed email is generated, the signer key and certificate will
  * change, and thus the tests will have to be changed as well (serial number!).
  */
-public class SMIMEAssertionTest extends TestCase {
+public class SMIMEAssertionTest {
 
     private MimeMessage msg;
     private SampleResult parent;
 
-    @Override
+    @Before
     public void setUp() throws MessagingException, IOException {
         Session mailSession = Session.getDefaultInstance(new Properties());
         msg = new MimeMessage(mailSession, this.getClass().getResourceAsStream(
@@ -102,6 +103,7 @@ public class SMIMEAssertionTest extends
         parent.addSubResult(createChildSample());
     }
 
+    @Test
     public void testSignature() {
         SMIMEAssertionTestElement testElement = new SMIMEAssertionTestElement();
         testElement.setVerifySignature(true);
@@ -112,6 +114,7 @@ public class SMIMEAssertionTest extends
                 result.isFailure());
     }
 
+    @Test
     public void testSignerEmail() {
         SMIMEAssertionTestElement testElement = new SMIMEAssertionTestElement();
         testElement.setSignerCheckConstraints(true);
@@ -123,6 +126,7 @@ public class SMIMEAssertionTest extends
                 result.isFailure());
     }
 
+    @Test
     public void testSignerSerial() {
         SMIMEAssertionTestElement testElement = new SMIMEAssertionTestElement();
         testElement.setSignerCheckConstraints(true);
@@ -134,6 +138,7 @@ public class SMIMEAssertionTest extends
                 result.isFailure());
     }
 
+    @Test
     public void testSignerSignerDN() {
         SMIMEAssertionTestElement testElement = new SMIMEAssertionTestElement();
         testElement.setSignerCheckConstraints(true);
@@ -148,6 +153,7 @@ public class SMIMEAssertionTest extends
                 result.isFailure());
     }
 
+    @Test
     public void testSignerIssuerDN() {
         SMIMEAssertionTestElement testElement = new SMIMEAssertionTestElement();
         testElement.setSignerCheckConstraints(true);
@@ -161,6 +167,7 @@ public class SMIMEAssertionTest extends
                 result.isFailure());
     }
 
+    @Test
     public void testSignerCert() {
         SMIMEAssertionTestElement testElement = new SMIMEAssertionTestElement();
         testElement.setSignerCheckConstraints(true);

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=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/assertions/SizeAssertionTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/assertions/SizeAssertionTest.java Tue Feb  2 21:45:57 2016
@@ -18,11 +18,18 @@
 
 package org.apache.jmeter.assertions;
 
+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 org.apache.jmeter.junit.JMeterTestCase;
 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 SizeAssertionTest extends JMeterTestCase{
 
@@ -32,7 +39,7 @@ public class SizeAssertionTest extends J
       private final String data1 = "response Data\n" +  "line 2\n\nEOF";
       private final int data1Len=data1.length();
       
-      @Override
+      @Before
     public void setUp() {
           JMeterContext jmctx = JMeterContextService.getContext();
           assertion = new SizeAssertion();
@@ -45,7 +52,8 @@ public class SizeAssertionTest extends J
           sample1.setResponseData(data1, null);
       }
 
-      public void testSizeAssertionEquals() throws Exception{
+      @Test
+    public void testSizeAssertionEquals() throws Exception{
           assertion.setCompOper(SizeAssertion.EQUAL);
           assertion.setAllowedSize(0);
           result = assertion.getResult(sample1);
@@ -62,7 +70,8 @@ public class SizeAssertionTest extends J
           assertFailed();
         }
       
-      public void testSizeAssertionNotEquals() throws Exception{
+      @Test
+    public void testSizeAssertionNotEquals() throws Exception{
           assertion.setCompOper(SizeAssertion.NOTEQUAL);
           assertion.setAllowedSize(0);
           result = assertion.getResult(sample1);
@@ -79,7 +88,8 @@ public class SizeAssertionTest extends J
           assertPassed();
         }
 
-      public void testSizeAssertionGreaterThan() throws Exception{
+      @Test
+    public void testSizeAssertionGreaterThan() throws Exception{
           assertion.setCompOper(SizeAssertion.GREATERTHAN);
           assertion.setAllowedSize(0);
           result = assertion.getResult(sample1);
@@ -96,7 +106,8 @@ public class SizeAssertionTest extends J
           assertFailed();
         }
       
-      public void testSizeAssertionGreaterThanEqual() throws Exception{
+      @Test
+    public void testSizeAssertionGreaterThanEqual() throws Exception{
           assertion.setCompOper(SizeAssertion.GREATERTHANEQUAL);
           assertion.setAllowedSize(0);
           result = assertion.getResult(sample1);
@@ -113,7 +124,8 @@ public class SizeAssertionTest extends J
           assertFailed();
         }
       
-      public void testSizeAssertionLessThan() throws Exception{
+      @Test
+    public void testSizeAssertionLessThan() throws Exception{
           assertion.setCompOper(SizeAssertion.LESSTHAN);
           assertion.setAllowedSize(0);
           result = assertion.getResult(sample1);
@@ -130,7 +142,8 @@ public class SizeAssertionTest extends J
           assertPassed();
         }
 
-      public void testSizeAssertionLessThanEqual() throws Exception{
+      @Test
+    public void testSizeAssertionLessThanEqual() throws Exception{
           assertion.setCompOper(SizeAssertion.LESSTHANEQUAL);
           assertion.setAllowedSize(0);
           result = assertion.getResult(sample1);

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=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/assertions/XMLSchemaAssertionTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/assertions/XMLSchemaAssertionTest.java Tue Feb  2 21:45:57 2016
@@ -18,6 +18,10 @@
 
 package org.apache.jmeter.assertions;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.io.BufferedInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.FileInputStream;
@@ -28,6 +32,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;
 
 //import org.apache.jorphan.logging.LoggingManager;
 
@@ -39,13 +45,9 @@ public class XMLSchemaAssertionTest exte
 
     private JMeterContext jmctx;
 
-    public XMLSchemaAssertionTest(String arg0) {
-        super(arg0);
-    }
 
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
+    @Before
+    public void setUp() throws Exception {
         jmctx = JMeterContextService.getContext();
         assertion = new XMLSchemaAssertion();
         assertion.setThreadContext(jmctx);// This would be done by the run
@@ -73,6 +75,7 @@ public class XMLSchemaAssertionTest exte
         return readBA(name).toByteArray();
     }
 
+    @Test
     public void testAssertionOK() throws Exception {
         result.setResponseData(readFile("testfiles/XMLSchematest.xml"));
         assertion.setXsdFileName(findTestPath("testfiles/XMLSchema-pass.xsd"));
@@ -83,6 +86,7 @@ public class XMLSchemaAssertionTest exte
         assertFalse("Should not be a failure", res.isFailure());
     }
 
+    @Test
     public void testAssertionFail() throws Exception {
         result.setResponseData(readFile("testfiles/XMLSchematest.xml"));
         assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd");
@@ -93,6 +97,7 @@ public class XMLSchemaAssertionTest exte
         assertFalse(res.isFailure());
     }
 
+    @Test
     public void testAssertionBadXSDFile() throws Exception {
         result.setResponseData(readFile("testfiles/XMLSchematest.xml"));
         assertion.setXsdFileName("xtestfiles/XMLSchema-fail.xsd");
@@ -104,6 +109,7 @@ public class XMLSchemaAssertionTest exte
         assertFalse(res.isFailure());
     }
 
+    @Test
     public void testAssertionNoFile() throws Exception {
         result.setResponseData(readFile("testfiles/XMLSchematest.xml"));
         assertion.setXsdFileName("");
@@ -115,6 +121,7 @@ public class XMLSchemaAssertionTest exte
         assertTrue(res.isFailure());
     }
 
+    @Test
     public void testAssertionNoResult() throws Exception {
         // result.setResponseData - not set
         assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd");
@@ -126,6 +133,7 @@ public class XMLSchemaAssertionTest exte
         assertTrue(res.isFailure());
     }
 
+    @Test
     public void testAssertionEmptyResult() throws Exception {
         result.setResponseData("", null);
         assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd");
@@ -137,6 +145,7 @@ public class XMLSchemaAssertionTest exte
         assertTrue(res.isFailure());
     }
 
+    @Test
     public void testAssertionBlankResult() throws Exception {
         result.setResponseData(" ", null);
         assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd");
@@ -148,6 +157,7 @@ public class XMLSchemaAssertionTest exte
         assertFalse(res.isFailure());
     }
 
+    @Test
     public void testXMLTrailingContent() throws Exception {
         ByteArrayOutputStream baos = readBA("testfiles/XMLSchematest.xml");
         baos.write("extra".getBytes()); // TODO - charset?
@@ -161,6 +171,7 @@ public class XMLSchemaAssertionTest exte
         assertFalse(res.isFailure());
     }
 
+    @Test
     public void testXMLTrailingWhitespace() throws Exception {
         ByteArrayOutputStream baos = readBA("testfiles/XMLSchematest.xml");
         baos.write(" \t\n".getBytes()); // TODO - charset?

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=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/assertions/XPathAssertionTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/assertions/XPathAssertionTest.java Tue Feb  2 21:45:57 2016
@@ -18,6 +18,10 @@
 
 package org.apache.jmeter.assertions;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.io.BufferedInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.FileInputStream;
@@ -30,6 +34,8 @@ import org.apache.jmeter.threads.JMeterC
 import org.apache.jmeter.threads.JMeterVariables;
 import org.apache.jorphan.logging.LoggingManager;
 import org.apache.log.Logger;
+import org.junit.Before;
+import org.junit.Test;
 
 public class XPathAssertionTest extends JMeterTestCase {
     private static final Logger log = LoggingManager.getLoggerForClass();
@@ -42,13 +48,9 @@ public class XPathAssertionTest extends
 
     private JMeterContext jmctx;
 
-    public XPathAssertionTest(String arg0) {
-        super(arg0);
-    }
 
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
+    @Before
+    public void setUp() throws Exception {
         jmctx = JMeterContextService.getContext();
         assertion = new XPathAssertion();
         assertion.setThreadContext(jmctx);// This would be done by the run command
@@ -87,6 +89,7 @@ public class XPathAssertionTest extends
         return readBA(name).toByteArray();
     }
 
+    @Test
     public void testAssertionOK() throws Exception {
         assertion.setXPathString("/");
         AssertionResult res = assertion.getResult(result);
@@ -96,6 +99,7 @@ public class XPathAssertionTest extends
         assertFalse("Should not be a failure", res.isFailure());
     }
 
+    @Test
     public void testAssertionFail() throws Exception {
         assertion.setXPathString("//x");
         AssertionResult res = assertion.getResult(result);
@@ -105,6 +109,7 @@ public class XPathAssertionTest extends
         assertTrue("Should be a failure",res.isFailure());
     }
 
+    @Test
     public void testAssertionPath1() throws Exception {
         assertion.setXPathString("//*[code=1]");
         AssertionResult res = assertion.getResult(result);
@@ -114,6 +119,7 @@ public class XPathAssertionTest extends
         assertFalse("Should not be a failure",res.isFailure());
     }
 
+    @Test
     public void testAssertionPath2() throws Exception {
         assertion.setXPathString("//*[code=2]"); // Not present
         AssertionResult res = assertion.getResult(result);
@@ -123,6 +129,7 @@ public class XPathAssertionTest extends
         assertTrue("Should be a failure",res.isFailure());
     }
 
+    @Test
     public void testAssertionBool1() throws Exception {
         assertion.setXPathString("count(//error)=2");
         AssertionResult res = assertion.getResult(result);
@@ -132,6 +139,7 @@ public class XPathAssertionTest extends
         assertFalse("Should not be a failure",res.isFailure());
     }
 
+    @Test
     public void testAssertionBool2() throws Exception {
         assertion.setXPathString("count(//*[code=1])=1");
         AssertionResult res = assertion.getResult(result);
@@ -141,6 +149,7 @@ public class XPathAssertionTest extends
         assertFalse("Should not be a failure",res.isFailure());
     }
 
+    @Test
     public void testAssertionBool3() throws Exception {
         assertion.setXPathString("count(//error)=1"); // wrong
         AssertionResult res = assertion.getResult(result);
@@ -150,6 +159,7 @@ public class XPathAssertionTest extends
         assertTrue("Should be a failure",res.isFailure());
     }
 
+    @Test
     public void testAssertionBool4() throws Exception {
         assertion.setXPathString("count(//*[code=2])=1"); //Wrong
         AssertionResult res = assertion.getResult(result);
@@ -159,6 +169,7 @@ public class XPathAssertionTest extends
         assertTrue("Should be a failure",res.isFailure());
     }
 
+    @Test
     public void testAssertionNumber() throws Exception {
         assertion.setXPathString("count(//error)");// not yet handled
         AssertionResult res = assertion.getResult(result);
@@ -168,6 +179,7 @@ public class XPathAssertionTest extends
         assertTrue("Should be a failure",res.isFailure());
     }
 
+    @Test
     public void testAssertionNoResult() throws Exception {
         // result.setResponseData - not set
         result = new SampleResult();
@@ -179,6 +191,7 @@ public class XPathAssertionTest extends
         assertTrue("Should be a failure",res.isFailure());
     }
 
+    @Test
     public void testAssertionEmptyResult() throws Exception {
         result.setResponseData("", null);
         AssertionResult res = assertion.getResult(result);
@@ -189,6 +202,7 @@ public class XPathAssertionTest extends
         assertTrue("Should be a failure",res.isFailure());
     }
 
+    @Test
     public void testAssertionBlankResult() throws Exception {
         result.setResponseData(" ", null);
         AssertionResult res = assertion.getResult(result);
@@ -199,6 +213,7 @@ public class XPathAssertionTest extends
         assertFalse("Should not be a failure", res.isFailure());
     }
 
+    @Test
     public void testNoTolerance() throws Exception {
         String data = "<html><head><title>testtitle</title></head>" + "<body>"
                 + "<p><i><b>invalid tag nesting</i></b><hr>" + "</body></html>";
@@ -216,6 +231,7 @@ public class XPathAssertionTest extends
         assertFalse(res.isFailure());
     }
 
+    @Test
     public void testAssertion() throws Exception {
         setAlternateResponseData();
         assertion.setXPathString("//row/value[@field = 'alias']");
@@ -226,6 +242,7 @@ public class XPathAssertionTest extends
         assertFalse(res.isFailure());
     }
 
+    @Test
     public void testNegateAssertion() throws Exception {
         setAlternateResponseData();
         assertion.setXPathString("//row/value[@field = 'noalias']");
@@ -238,6 +255,7 @@ public class XPathAssertionTest extends
         assertFalse(res.isFailure());
     }
 
+    @Test
     public void testValidationFailure() throws Exception {
         setAlternateResponseData();
         assertion.setXPathString("//row/value[@field = 'alias']");
@@ -249,6 +267,7 @@ public class XPathAssertionTest extends
         assertFalse(res.isFailure());
     }
 
+    @Test
     public void testValidationSuccess() throws Exception {
         String data = "<?xml version=\"1.0\"?>" + "<!DOCTYPE BOOK [" + "<!ELEMENT p (#PCDATA)>"
                 + "<!ELEMENT BOOK         (OPENER,SUBTITLE?,INTRODUCTION?,(SECTION | PART)+)>"
@@ -275,6 +294,7 @@ public class XPathAssertionTest extends
         assertFalse(res.isFailure());
     }
 
+    @Test
     public void testValidationFailureWithDTD() throws Exception {
         String data = "<?xml version=\"1.0\"?>" + "<!DOCTYPE BOOK [" + "<!ELEMENT p (#PCDATA)>"
                 + "<!ELEMENT BOOK         (OPENER,SUBTITLE?,INTRODUCTION?,(SECTION | PART)+)>"
@@ -302,6 +322,7 @@ public class XPathAssertionTest extends
         assertFalse(res.isFailure());
     }
 
+    @Test
     public void testTolerance() throws Exception {
         String data = "<html><head><title>testtitle</title></head>" + "<body>"
                 + "<p><i><b>invalid tag nesting</i></b><hr>" + "</body></html>";

Modified: jmeter/trunk/test/src/org/apache/jmeter/config/TestCVSDataSet.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/config/TestCVSDataSet.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/config/TestCVSDataSet.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/config/TestCVSDataSet.java Tue Feb  2 21:45:57 2016
@@ -22,6 +22,10 @@
      
 package org.apache.jmeter.config;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
 import java.io.IOException;
 
 import org.apache.jmeter.junit.JMeterTestCase;
@@ -30,16 +34,16 @@ import org.apache.jmeter.threads.JMeterC
 import org.apache.jmeter.threads.JMeterContextService;
 import org.apache.jmeter.threads.JMeterVariables;
 import org.apache.jorphan.util.JMeterStopThreadException;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
 
 public class TestCVSDataSet extends JMeterTestCase {
 
     private JMeterVariables threadVars;
     
-    public TestCVSDataSet(String arg0) {
-        super(arg0);
-    }
 
-    @Override
+    @Before
     public void setUp(){
         JMeterContext jmcx = JMeterContextService.getContext();
         jmcx.setVariables(new JMeterVariables());
@@ -47,11 +51,12 @@ public class TestCVSDataSet extends JMet
         threadVars.put("b", "value");
     }
 
-    @Override
+    @After
     public void tearDown() throws IOException{
         FileServer.getFileServer().closeFiles();
     }
     
+    @Test
     public void testopen() throws Exception {
         CSVDataSet csv = new CSVDataSet();
         csv.setFilename("No.such.filename");
@@ -94,6 +99,7 @@ public class TestCVSDataSet extends JMet
         assertEquals("c1",threadVars.get("c"));
     }
     
+    @Test
     public void testutf8() throws Exception {
 
         CSVDataSet csv = new CSVDataSet();
@@ -129,6 +135,7 @@ public class TestCVSDataSet extends JMet
     }
 
     // Test CSV file with a header line
+    @Test
     public void testHeaderOpen(){
         CSVDataSet csv = new CSVDataSet();
         csv.setFilename(findTestPath("testfiles/testheader.csv"));
@@ -149,6 +156,7 @@ public class TestCVSDataSet extends JMet
     }
     
     // Test CSV file with a header line and recycle is true
+    @Test
     public void testHeaderOpenAndRecycle(){
         CSVDataSet csv = new CSVDataSet();
         csv.setFilename(findTestPath("testfiles/testheader.csv"));
@@ -168,6 +176,7 @@ public class TestCVSDataSet extends JMet
     }
     
     // Test CSV file with a header line
+    @Test
     public void testHeaderQuotes(){
         CSVDataSet csv = new CSVDataSet();
         csv.setFilename(findTestPath("testfiles/testquoted.csv"));
@@ -210,6 +219,7 @@ public class TestCVSDataSet extends JMet
         return csv;
     }
 
+    @Test
     public void testShareMode(){
         
         new CSVDataSetBeanInfo(); // needs to be initialised

Modified: jmeter/trunk/test/src/org/apache/jmeter/config/gui/TestArgumentsPanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/config/gui/TestArgumentsPanel.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/config/gui/TestArgumentsPanel.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/config/gui/TestArgumentsPanel.java Tue Feb  2 21:45:57 2016
@@ -18,10 +18,11 @@
 
 package org.apache.jmeter.config.gui;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
 
 import org.apache.jmeter.config.Argument;
 import org.apache.jmeter.config.Arguments;
+import org.junit.Test;
 
 /**
  * A GUI panel allowing the user to enter name-value argument pairs. These
@@ -29,16 +30,8 @@ import org.apache.jmeter.config.Argument
  * for some other component.
  * 
  */
-public class TestArgumentsPanel extends TestCase {
-        /**
-         * Create a new test.
-         * 
-         * @param name
-         *            the name of the test
-         */
-        public TestArgumentsPanel(String name) {
-            super(name);
-        }
+public class TestArgumentsPanel {
+        
 
         /**
          * Test that adding an argument to the table results in an appropriate
@@ -47,6 +40,7 @@ public class TestArgumentsPanel extends
          * @throws Exception
          *             if an exception occurred during the test
          */
+        @Test
         public void testArgumentCreation() throws Exception {
             ArgumentsPanel gui = new ArgumentsPanel();
             gui.tableModel.addRow(new Argument());

Modified: jmeter/trunk/test/src/org/apache/jmeter/control/TestGenericController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/control/TestGenericController.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/control/TestGenericController.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/control/TestGenericController.java Tue Feb  2 21:45:57 2016
@@ -18,15 +18,16 @@
 
 package org.apache.jmeter.control;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.jmeter.junit.JMeterTestCase;
 import org.apache.jmeter.junit.stubs.TestSampler;
 import org.apache.jmeter.testelement.TestElement;
+import org.junit.Test;
 
 public class TestGenericController extends JMeterTestCase {
-        public TestGenericController(String name) {
-            super(name);
-        }
 
+        @Test
         public void testProcessing() throws Exception {
             testLog.debug("Testing Generic Controller");
             GenericController controller = new GenericController();

Modified: jmeter/trunk/test/src/org/apache/jmeter/control/TestIfController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/control/TestIfController.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/control/TestIfController.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/control/TestIfController.java Tue Feb  2 21:45:57 2016
@@ -18,6 +18,9 @@
 
 package org.apache.jmeter.control;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
 import org.apache.jmeter.config.Arguments;
 import org.apache.jmeter.junit.JMeterTestCase;
 import org.apache.jmeter.junit.stubs.TestSampler;
@@ -27,16 +30,15 @@ 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.Test;
 
 public class TestIfController extends JMeterTestCase {
-        public TestIfController(String name) {
-            super(name);
-        }
         
         /**
          * See Bug 56160
          * @throws Exception if something fails
          */
+        @Test
         public void testStackOverflow() throws Exception {
             LoopController controller = new LoopController();
             controller.setLoops(1);
@@ -75,6 +77,7 @@ public class TestIfController extends JM
          * See Bug 53768
          * @throws Exception if something fails
          */
+        @Test
         public void testBug53768() throws Exception {
             LoopController controller = new LoopController();
             controller.setLoops(1);
@@ -140,6 +143,7 @@ public class TestIfController extends JM
             }
         }
 
+        @Test
         public void testProcessing() throws Exception {
 
             GenericController controller = new GenericController();
@@ -186,6 +190,7 @@ public class TestIfController extends JM
 //          }
         }
    
+        @Test
         public void testProcessingTrue() throws Exception {
             LoopController controller = new LoopController();
             controller.setLoops(2);
@@ -217,6 +222,7 @@ public class TestIfController extends JM
          * Test false return on sample3 (sample4 doesn't execute)
          * @throws Exception if something fails
          */
+        @Test
         public void testEvaluateAllChildrenWithoutSubController() throws Exception {
             LoopController controller = new LoopController();
             controller.setLoops(2);
@@ -254,6 +260,7 @@ public class TestIfController extends JM
          * test 2 loops with a sub generic controller (sample4 doesn't execute)
          * @throws Exception if something fails
          */
+        @Test
         public void testEvaluateAllChildrenWithSubController() throws Exception {
             LoopController controller = new LoopController();
             controller.setLoops(2);

Modified: jmeter/trunk/test/src/org/apache/jmeter/control/TestInterleaveControl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/control/TestInterleaveControl.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/control/TestInterleaveControl.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/control/TestInterleaveControl.java Tue Feb  2 21:45:57 2016
@@ -18,15 +18,16 @@
 
 package org.apache.jmeter.control;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.jmeter.junit.JMeterTestCase;
 import org.apache.jmeter.junit.stubs.TestSampler;
 import org.apache.jmeter.testelement.TestElement;
+import org.junit.Test;
 
 public class TestInterleaveControl extends JMeterTestCase {
-        public TestInterleaveControl(String name) {
-            super(name);
-        }
 
+        @Test
         public void testProcessing() throws Exception {
             testLog.debug("Testing Interleave Controller 1");
             GenericController controller = new GenericController();
@@ -69,6 +70,7 @@ public class TestInterleaveControl exten
             }
         }
 
+        @Test
         public void testProcessing6() throws Exception {
             testLog.debug("Testing Interleave Controller 6");
             GenericController controller = new GenericController();
@@ -95,6 +97,7 @@ public class TestInterleaveControl exten
             }
         }
 
+        @Test
         public void testProcessing2() throws Exception {
             testLog.debug("Testing Interleave Controller 2");
             GenericController controller = new GenericController();
@@ -130,6 +133,7 @@ public class TestInterleaveControl exten
             }
         }
 
+        @Test
         public void testProcessing3() throws Exception {
             testLog.debug("Testing Interleave Controller 3");
             GenericController controller = new GenericController();
@@ -165,6 +169,7 @@ public class TestInterleaveControl exten
             }
         }
 
+        @Test
         public void testProcessing4() throws Exception {
             testLog.debug("Testing Interleave Controller 4");
             GenericController controller = new GenericController();
@@ -195,6 +200,7 @@ public class TestInterleaveControl exten
             }
         }
 
+        @Test
         public void testProcessing5() throws Exception {
             testLog.debug("Testing Interleave Controller 5");
             GenericController controller = new GenericController();

Modified: jmeter/trunk/test/src/org/apache/jmeter/control/TestLoopController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/control/TestLoopController.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/control/TestLoopController.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/control/TestLoopController.java Tue Feb  2 21:45:57 2016
@@ -18,6 +18,10 @@
 
 package org.apache.jmeter.control;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -32,12 +36,11 @@ import org.apache.jmeter.testelement.pro
 import org.apache.jmeter.threads.JMeterContext;
 import org.apache.jmeter.threads.JMeterContextService;
 import org.apache.jmeter.threads.JMeterVariables;
+import org.junit.Test;
 
 public class TestLoopController extends JMeterTestCase {
-        public TestLoopController(String name) {
-            super(name);
-        }
 
+        @Test
         public void testProcessing() throws Exception {
             GenericController controller = new GenericController();
             GenericController sub_1 = new GenericController();
@@ -72,6 +75,7 @@ public class TestLoopController extends
             }
         }
 
+        @Test
         public void testLoopZeroTimes() throws Exception {
             LoopController loop = new LoopController();
             loop.setLoops(0);
@@ -80,6 +84,7 @@ public class TestLoopController extends
             assertNull(loop.next());
         }
 
+        @Test
         public void testInfiniteLoop() throws Exception {
             LoopController loop = new LoopController();
             loop.setLoops(LoopController.INFINITE_LOOP_COUNT);
@@ -91,6 +96,7 @@ public class TestLoopController extends
             }
         }
             
+        @Test
         public void testBug54467() throws Exception {
             JMeterContext jmctx = JMeterContextService.getContext();
             LoopController loop = new LoopController();

Modified: jmeter/trunk/test/src/org/apache/jmeter/control/TestOnceOnlyController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/control/TestOnceOnlyController.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/control/TestOnceOnlyController.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/control/TestOnceOnlyController.java Tue Feb  2 21:45:57 2016
@@ -18,15 +18,16 @@
 
 package org.apache.jmeter.control;
 
+import static org.junit.Assert.assertEquals;
+
 import org.apache.jmeter.junit.JMeterTestCase;
 import org.apache.jmeter.junit.stubs.TestSampler;
 import org.apache.jmeter.testelement.TestElement;
+import org.junit.Test;
 
 public class TestOnceOnlyController extends JMeterTestCase {
-    public TestOnceOnlyController(String name) {
-        super(name);
-    }
 
+    @Test
     public void testProcessing() throws Exception {
         GenericController controller = new GenericController();
         GenericController sub_1 = new OnceOnlyController();
@@ -70,6 +71,7 @@ public class TestOnceOnlyController exte
         }
     }
 
+    @Test
     public void testProcessing2() throws Exception {
         GenericController controller = new GenericController();
         GenericController sub_1 = new OnceOnlyController();
@@ -114,6 +116,7 @@ public class TestOnceOnlyController exte
         }
     }
 
+    @Test
     public void testInOuterLoop() throws Exception {
         // Set up the test plan
         LoopController controller = new LoopController();
@@ -172,6 +175,7 @@ public class TestOnceOnlyController exte
         assertEquals(expectedNoSamples, counter);
     }
 
+    @Test
     public void testInsideInnerLoop() throws Exception {
         // Test plan with OnlyOnceController inside inner loop
         // Set up the test plan

Modified: jmeter/trunk/test/src/org/apache/jmeter/control/TestRandomOrderController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/control/TestRandomOrderController.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/control/TestRandomOrderController.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/control/TestRandomOrderController.java Tue Feb  2 21:45:57 2016
@@ -16,19 +16,22 @@
  */
 package org.apache.jmeter.control;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.jmeter.junit.JMeterTestCase;
 import org.apache.jmeter.junit.stubs.TestSampler;
 import org.apache.jmeter.testelement.TestElement;
+import org.junit.Test;
 
 public class TestRandomOrderController extends JMeterTestCase {
 
-        public TestRandomOrderController(String name) {
-            super(name);
-        }
 
+        @Test
         public void testRandomOrder() {
             testLog.debug("Testing RandomOrderController");
             RandomOrderController roc = new RandomOrderController();
@@ -49,12 +52,14 @@ public class TestRandomOrderController e
             assertEquals("All samplers were returned", 4, usedSamplers.size());
         }
 
+        @Test
         public void testRandomOrderNoElements() {
             RandomOrderController roc = new RandomOrderController();
             roc.initialize();
             assertNull(roc.next());
         }
 
+        @Test
         public void testRandomOrderOneElement() {
             RandomOrderController roc = new RandomOrderController();
             roc.addTestElement(new TestSampler("zero"));

Modified: jmeter/trunk/test/src/org/apache/jmeter/control/TestRunTime.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/control/TestRunTime.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/control/TestRunTime.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/control/TestRunTime.java Tue Feb  2 21:45:57 2016
@@ -18,18 +18,19 @@
 
 package org.apache.jmeter.control;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.jmeter.junit.JMeterTestCase;
 import org.apache.jmeter.junit.stubs.TestSampler;
 import org.apache.jmeter.samplers.Sampler;
-
+import org.junit.Test;
 /**
  * @version $Revision$
  */
 public class TestRunTime extends JMeterTestCase {
-        public TestRunTime(String name) {
-            super(name);
-        }
 
+    @Test
         public void testProcessing() throws Exception {
 
             RunTime controller = new RunTime();

Modified: jmeter/trunk/test/src/org/apache/jmeter/control/TestSwitchController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/control/TestSwitchController.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/control/TestSwitchController.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/control/TestSwitchController.java Tue Feb  2 21:45:57 2016
@@ -18,6 +18,9 @@
 
 package org.apache.jmeter.control;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -31,6 +34,7 @@ import org.apache.jmeter.testelement.pro
 import org.apache.jmeter.threads.JMeterContext;
 import org.apache.jmeter.threads.JMeterContextService;
 import org.apache.jmeter.threads.JMeterVariables;
+import org.junit.Test;
 
 public class TestSwitchController extends JMeterTestCase {
 //      static {
@@ -38,10 +42,6 @@ public class TestSwitchController extend
 //           LoggingManager.setTarget(new java.io.PrintWriter(System.out));
 //      }
 
-        public TestSwitchController(String name) {
-            super(name);
-        }
-
         // Get next sample and its name
         private String nextName(GenericController c) {
             Sampler s = c.next();
@@ -53,33 +53,40 @@ public class TestSwitchController extend
             return n;
         }
 
+        @Test
         public void test() throws Exception {
             runSimpleTests("", "zero");
         }
 
+        @Test
         public void test0() throws Exception {
             runSimpleTests("0", "zero");
         }
 
+        @Test
         public void test1() throws Exception {
             runSimpleTests("1", "one");
             runSimpleTests("one", "one"); // Match by name
         }
 
+        @Test
         public void test2() throws Exception {
             runSimpleTests("2", "two");
             runSimpleTests("two", "two"); // Match by name
         }
 
+        @Test
         public void test3() throws Exception {
             runSimpleTests("3", "three");
             runSimpleTests("three", "three"); // Match by name
         }
 
+        @Test
         public void test4() throws Exception {
             runSimpleTests("4", "zero");
         }
 
+        @Test
         public void testX() throws Exception {
             runSimpleTests("X", null); // should not run any children
             runSimpleTest2("X", "one", "Default"); // should match the default entry
@@ -176,6 +183,7 @@ public class TestSwitchController extend
             }
         }
 
+        @Test
         public void testTest2() throws Exception {
             runTest2("", new String[] { "zero" });
             runTest2("0", new String[] { "zero" });
@@ -250,6 +258,7 @@ public class TestSwitchController extend
          * N.B. Requires ApacheJMeter_functions.jar to be on the classpath,
          * otherwise the function cannot be resolved.
         */
+        @Test
         public void testFunction() throws Exception {
             JMeterContext jmctx = JMeterContextService.getContext();
             Map<String, String> variables = new HashMap<>();

Modified: jmeter/trunk/test/src/org/apache/jmeter/control/TestThroughputController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/control/TestThroughputController.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/control/TestThroughputController.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/control/TestThroughputController.java Tue Feb  2 21:45:57 2016
@@ -18,9 +18,14 @@
 
 package org.apache.jmeter.control;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
 import org.apache.jmeter.junit.JMeterTestCase;
 import org.apache.jmeter.junit.stubs.TestSampler;
 import org.apache.jmeter.testelement.TestElement;
+import org.junit.Test;
 
 /**
  * This class represents a controller that can controll the number of times that
@@ -30,10 +35,8 @@ import org.apache.jmeter.testelement.Tes
  * 
  */
 public class TestThroughputController extends JMeterTestCase {
-        public TestThroughputController(String name) {
-            super(name);
-        }
 
+        @Test
         public void testByNumber() throws Exception {
             ThroughputController sub_1 = new ThroughputController();
             sub_1.setStyle(ThroughputController.BYNUMBER);
@@ -69,6 +72,7 @@ public class TestThroughputController ex
             sub_1.testEnded();
         }
 
+        @Test
         public void testByNumberZero() throws Exception {
             ThroughputController sub_1 = new ThroughputController();
             sub_1.setStyle(ThroughputController.BYNUMBER);
@@ -102,6 +106,7 @@ public class TestThroughputController ex
             sub_1.testEnded();
         }
 
+        @Test
         public void testByPercent33() throws Exception {
             ThroughputController sub_1 = new ThroughputController();
             sub_1.setStyle(ThroughputController.BYPERCENT);
@@ -150,6 +155,7 @@ public class TestThroughputController ex
             sub_1.testEnded();
         }
 
+        @Test
         public void testByPercentZero() throws Exception {
             ThroughputController sub_1 = new ThroughputController();
             sub_1.setStyle(ThroughputController.BYPERCENT);
@@ -182,6 +188,7 @@ public class TestThroughputController ex
             sub_1.testEnded();
         }
 
+        @Test
         public void testByPercent100() throws Exception {
             ThroughputController sub_1 = new ThroughputController();
             sub_1.setStyle(ThroughputController.BYPERCENT);

Modified: jmeter/trunk/test/src/org/apache/jmeter/control/TestWhileController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/control/TestWhileController.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/control/TestWhileController.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/control/TestWhileController.java Tue Feb  2 21:45:57 2016
@@ -18,6 +18,10 @@
 
 package org.apache.jmeter.control;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
 import org.apache.jmeter.engine.util.ValueReplacer;
 import org.apache.jmeter.junit.JMeterTestCase;
 import org.apache.jmeter.junit.stubs.TestSampler;
@@ -28,6 +32,8 @@ import org.apache.jmeter.threads.JMeterC
 import org.apache.jmeter.threads.JMeterContextService;
 import org.apache.jmeter.threads.JMeterThread;
 import org.apache.jmeter.threads.JMeterVariables;
+import org.junit.Before;
+import org.junit.Test;
 
 public class TestWhileController extends JMeterTestCase {
 //      static {
@@ -35,14 +41,11 @@ public class TestWhileController extends
 //           LoggingManager.setTarget(new java.io.PrintWriter(System.out));
 //      }
 
-        public TestWhileController(String name) {
-            super(name);
-        }
 
         private JMeterContext jmctx;
         private JMeterVariables jmvars;
         
-        @Override
+        @Before
         public void setUp() {
             jmctx = JMeterContextService.getContext();
             jmctx.setVariables(new JMeterVariables());
@@ -70,12 +73,14 @@ public class TestWhileController extends
         }
 
         // While (blank), previous sample OK - should loop until false
+        @Test
         public void testBlankPrevOK() throws Exception {
 //          log.info("testBlankPrevOK");
             runtestPrevOK("");
         }
 
         // While (LAST), previous sample OK - should loop until false
+        @Test
         public void testLastPrevOK() throws Exception {
 //          log.info("testLASTPrevOK");
             runtestPrevOK("LAST");
@@ -84,6 +89,7 @@ public class TestWhileController extends
         private static final String OTHER = "X"; // Dummy for testing functions
 
         // While (LAST), previous sample OK - should loop until false
+        @Test
         public void testOtherPrevOK() throws Exception {
 //          log.info("testOtherPrevOK");
             runtestPrevOK(OTHER);
@@ -134,6 +140,7 @@ public class TestWhileController extends
         }
 
         // While (blank), previous sample failed - should run once
+        @Test
         public void testBlankPrevFailed() throws Exception {
 //          log.info("testBlankPrevFailed");
             GenericController controller = new GenericController();
@@ -168,6 +175,7 @@ public class TestWhileController extends
          * - - - four
          * - after
          */
+        @Test
         public void testVariable1() throws Exception {
             GenericController controller = new GenericController();
             WhileController while_cont = new WhileController();
@@ -218,6 +226,7 @@ public class TestWhileController extends
         }
 
         // Test with SimpleController as first item
+        @Test
         public void testVariable2() throws Exception {
             GenericController controller = new GenericController();
             WhileController while_cont = new WhileController();
@@ -269,12 +278,14 @@ public class TestWhileController extends
         }
 
         // While LAST, previous sample failed - should not run
+        @Test
         public void testLASTPrevFailed() throws Exception {
 //          log.info("testLastPrevFailed");
             runTestPrevFailed("LAST");
         }
 
         // While False, previous sample failed - should not run
+        @Test
         public void testfalsePrevFailed() throws Exception {
 //          log.info("testFalsePrevFailed");
             runTestPrevFailed("False");
@@ -296,10 +307,12 @@ public class TestWhileController extends
             assertNull(nextName(controller));
         }
 
+        @Test
         public void testLastFailedBlank() throws Exception{
             runTestLastFailed("");
         }
 
+        @Test
         public void testLastFailedLast() throws Exception{
             runTestLastFailed("LAST");
         }
@@ -329,10 +342,12 @@ public class TestWhileController extends
         }
 
         // Tests for Stack Overflow (bug 33954)
+        @Test
         public void testAlwaysFailOK() throws Exception {
             runTestAlwaysFail(true); // Should be OK
         }
 
+        @Test
         public void testAlwaysFailBAD() throws Exception {
             runTestAlwaysFail(false);
         }

Modified: jmeter/trunk/test/src/org/apache/jmeter/engine/DistributedRunnerTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/engine/DistributedRunnerTest.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/engine/DistributedRunnerTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/engine/DistributedRunnerTest.java Tue Feb  2 21:45:57 2016
@@ -18,6 +18,8 @@
 
 package org.apache.jmeter.engine;
 
+import static org.junit.Assert.fail;
+
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
@@ -35,8 +37,9 @@ import org.apache.jmeter.util.JMeterUtil
 import org.apache.jorphan.collections.HashTree;
 import org.apache.jorphan.logging.LoggingManager;
 import org.apache.log.Logger;
+import org.junit.Test;
 
-public class DistributedRunnerTest extends junit.framework.TestCase {
+public class DistributedRunnerTest {
 
     public static void createJmeterEnv() throws IOException {
         File propsFile;
@@ -50,6 +53,7 @@ public class DistributedRunnerTest exten
         JMeterUtils.setLocale(new Locale("ignoreResources"));
     }
 
+    @Test
     public void testSuccess() throws Exception {
         createJmeterEnv();
         JMeterUtils.setProperty(DistributedRunner.RETRIES_NUMBER, "1");
@@ -65,6 +69,7 @@ public class DistributedRunnerTest exten
         obj.exit(hosts);
     }
 
+    @Test
     public void testFailure1() throws Exception {
         createJmeterEnv();
         JMeterUtils.setProperty(DistributedRunner.RETRIES_NUMBER, "2");
@@ -91,6 +96,7 @@ public class DistributedRunnerTest exten
         System.setOut(origSystemOut);
     }
 
+    @Test
     public void testFailure2() throws Exception {
         createJmeterEnv();
         JMeterUtils.setProperty(DistributedRunner.RETRIES_NUMBER, "1");
@@ -101,6 +107,7 @@ public class DistributedRunnerTest exten
         initRunner(obj, hosts);
     }
 
+    @Test
     public void testFailure3() throws Exception {
         createJmeterEnv();
         JMeterUtils.setProperty(DistributedRunner.RETRIES_NUMBER, "1");

Modified: jmeter/trunk/test/src/org/apache/jmeter/engine/TestTreeCloner.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/engine/TestTreeCloner.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/engine/TestTreeCloner.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/engine/TestTreeCloner.java Tue Feb  2 21:45:57 2016
@@ -18,6 +18,10 @@
 
 package org.apache.jmeter.engine;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.jmeter.config.Argument;
 import org.apache.jmeter.config.Arguments;
 import org.apache.jmeter.control.GenericController;
@@ -27,12 +31,11 @@ import org.apache.jmeter.testelement.pro
 import org.apache.jmeter.testelement.property.JMeterProperty;
 import org.apache.jmeter.testelement.property.PropertyIterator;
 import org.apache.jorphan.collections.ListedHashTree;
+import org.junit.Test;
 
-public class TestTreeCloner extends junit.framework.TestCase {
-        public TestTreeCloner(String name) {
-            super(name);
-        }
-
+public class TestTreeCloner {
+        
+        @Test
         public void testCloning() throws Exception {
             ListedHashTree original = new ListedHashTree();
             GenericController controller = new GenericController();

Modified: jmeter/trunk/test/src/org/apache/jmeter/engine/util/PackageTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/engine/util/PackageTest.java?rev=1728223&r1=1728222&r2=1728223&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/engine/util/PackageTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/engine/util/PackageTest.java Tue Feb  2 21:45:57 2016
@@ -21,6 +21,9 @@
  */
 package org.apache.jmeter.engine.util;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -31,6 +34,8 @@ import org.apache.jmeter.testelement.pro
 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;
 
 /*
  * To run this test stand-alone, ensure that ApacheJMeter_functions.jar is on the classpath,
@@ -39,13 +44,10 @@ import org.apache.jmeter.threads.JMeterV
 public class PackageTest extends JMeterTestCase {
     private ReplaceStringWithFunctions transformer;
 
-    public PackageTest(String arg0) {
-        super(arg0);
-    }
 
     private JMeterContext jmctx = null;
 
-    @Override
+    @Before
     public void setUp() {
         jmctx = JMeterContextService.getContext();
         Map<String, String> variables = new HashMap<>();
@@ -61,6 +63,7 @@ public class PackageTest extends JMeterT
         jmctx.getVariables().put("my_regex", ".*");
     }
 
+    @Test
     public void testFunctionParse1() throws Exception {
         StringProperty prop = new StringProperty("date", "${__javaScript((new Date().getDate() / 100).toString()."
                 + "substr(${__javaScript(1+1,d\\,ay)}\\,2),heute)}");
@@ -72,6 +75,7 @@ public class PackageTest extends JMeterT
         assertEquals("2", jmctx.getVariables().getObject("d,ay"));
     }
 
+    @Test
     public void testParseExample1() throws Exception {
         StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(.*)</html>,$1$)}");
         JMeterProperty newProp = transformer.transformValue(prop);
@@ -80,6 +84,7 @@ public class PackageTest extends JMeterT
         assertEquals("hello world", newProp.getStringValue());
     }
 
+    @Test
     public void testParseExample2() throws Exception {
         StringProperty prop = new StringProperty("html", "It should say:\\${${__regexFunction(<html>(.*)</html>,$1$)}}");
         JMeterProperty newProp = transformer.transformValue(prop);
@@ -88,6 +93,7 @@ public class PackageTest extends JMeterT
         assertEquals("It should say:${hello world}", newProp.getStringValue());
     }
 
+    @Test
     public void testParseExample3() throws Exception {
         StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(.*)</html>,$1$)}"
                 + "${__regexFunction(<html>(.*o)(.*o)(.*)</html>," + "$1$$3$)}");
@@ -97,6 +103,7 @@ public class PackageTest extends JMeterT
         assertEquals("hello worldhellorld", newProp.getStringValue());
     }
 
+    @Test
     public void testParseExample4() throws Exception {
         StringProperty prop = new StringProperty("html", "${non-existing function}");
         JMeterProperty newProp = transformer.transformValue(prop);
@@ -105,6 +112,7 @@ public class PackageTest extends JMeterT
         assertEquals("${non-existing function}", newProp.getStringValue());
     }
 
+    @Test
     public void testParseExample6() throws Exception {
         StringProperty prop = new StringProperty("html", "${server}");
         JMeterProperty newProp = transformer.transformValue(prop);
@@ -113,6 +121,7 @@ public class PackageTest extends JMeterT
         assertEquals("jakarta.apache.org", newProp.getStringValue());
     }
 
+    @Test
     public void testParseExample5() throws Exception {
         StringProperty prop = new StringProperty("html", "");
         JMeterProperty newProp = transformer.transformValue(prop);
@@ -121,6 +130,7 @@ public class PackageTest extends JMeterT
         assertEquals("", newProp.getStringValue());
     }
 
+    @Test
     public void testParseExample7() throws Exception {
         StringProperty prop = new StringProperty("html", "${__regexFunction(\\<([a-z]*)\\>,$1$)}");
         JMeterProperty newProp = transformer.transformValue(prop);
@@ -129,6 +139,7 @@ public class PackageTest extends JMeterT
         assertEquals("html", newProp.getStringValue());
     }
 
+    @Test
     public void testParseExample8() throws Exception {
         StringProperty prop = new StringProperty("html", "${__regexFunction((\\\\$\\d+\\.\\d+),$1$)}");
         JMeterProperty newProp = transformer.transformValue(prop);
@@ -137,6 +148,7 @@ public class PackageTest extends JMeterT
         assertEquals("$3.47", newProp.getStringValue());
     }
 
+    @Test
     public void testParseExample9() throws Exception {
         StringProperty prop = new StringProperty("html", "${__regexFunction(([$]\\d+\\.\\d+),$1$)}");
         JMeterProperty newProp = transformer.transformValue(prop);
@@ -145,6 +157,7 @@ public class PackageTest extends JMeterT
         assertEquals("$3.47", newProp.getStringValue());
     }
 
+    @Test
     public void testParseExample10() throws Exception {
         StringProperty prop = new StringProperty("html", "${__regexFunction(\\ "
                 + "(\\\\\\$\\d+\\.\\d+\\,\\\\$\\d+\\.\\d+),$1$)}");
@@ -155,6 +168,7 @@ public class PackageTest extends JMeterT
     }
 
     // Escaped dollar commma and backslash with no variable reference
+    @Test
     public void testParseExample11() throws Exception {
         StringProperty prop = new StringProperty("html", "\\$a \\, \\\\ \\x \\ jakarta.apache.org");
         JMeterProperty newProp = transformer.transformValue(prop);
@@ -168,6 +182,7 @@ public class PackageTest extends JMeterT
     // so document the current behaviour with some more tests.
     
     // Escaped dollar commma and backslash with variable reference
+    @Test
     public void testParseExample12() throws Exception {
         StringProperty prop = new StringProperty("html", "\\$a \\, \\\\ \\x \\ ${server} \\$b \\, \\\\ cd");
         JMeterProperty newProp = transformer.transformValue(prop);
@@ -177,6 +192,7 @@ public class PackageTest extends JMeterT
     }
 
     // Escaped dollar commma and backslash with missing variable reference
+    @Test
     public void testParseExample13() throws Exception {
         StringProperty prop = new StringProperty("html", "\\$a \\, \\\\ \\x \\ ${missing} \\$b \\, \\\\ cd");
         JMeterProperty newProp = transformer.transformValue(prop);
@@ -186,6 +202,7 @@ public class PackageTest extends JMeterT
     }
 
     // Escaped dollar commma and backslash with missing function reference
+    @Test
     public void testParseExample14() throws Exception {
         StringProperty prop = new StringProperty("html", "\\$a \\, \\\\ \\x \\ ${__missing(a)} \\$b \\, \\\\ cd");
         JMeterProperty newProp = transformer.transformValue(prop);
@@ -194,6 +211,7 @@ public class PackageTest extends JMeterT
         assertEquals("$a , \\ \\x \\ ${__missing(a)} $b , \\ cd", newProp.getStringValue());
     }
 
+    @Test
     public void testNestedExample1() throws Exception {
         StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(${my_regex})</html>,"
                 + "$1$)}${__regexFunction(<html>(.*o)(.*o)(.*)" + "</html>,$1$$3$)}");
@@ -203,6 +221,7 @@ public class PackageTest extends JMeterT
         assertEquals("hello worldhellorld", newProp.getStringValue());
     }
 
+    @Test
     public void testNestedExample2() throws Exception {
         StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(${my_regex})</html>,$1$)}");
         JMeterProperty newProp = transformer.transformValue(prop);

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=1728223&r1=1728222&r2=1728223&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 Tue Feb  2 21:45:57 2016
@@ -18,6 +18,9 @@
 
 package org.apache.jmeter.engine.util;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -30,16 +33,16 @@ import org.apache.jmeter.testelement.pro
 import org.apache.jmeter.testelement.property.StringProperty;
 import org.apache.jmeter.threads.JMeterContextService;
 import org.apache.jmeter.threads.JMeterVariables;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
 
 public class TestValueReplacer extends JMeterTestCase {
         private TestPlan variables;
 
-        public TestValueReplacer(String name) {
-            super(name);
-        }
 
         /** {@inheritDoc} */
-        @Override
+        @Before
         public void setUp() {
             variables = new TestPlan();
             variables.addParameter("server", "jakarta.apache.org");
@@ -55,6 +58,7 @@ public class TestValueReplacer extends J
             JMeterContextService.getContext().setSamplingStarted(true);
         }
 
+        @Test
         public void testReverseReplacement() throws Exception {
             ValueReplacer replacer = new ValueReplacer(variables);
             assertTrue(variables.getUserDefinedVariables().containsKey("server"));
@@ -73,6 +77,7 @@ public class TestValueReplacer extends J
             assertEquals("${password}", args.get(1).getStringValue());
         }
 
+        @Test
         public void testReverseReplacementXml() throws Exception {
             ValueReplacer replacer = new ValueReplacer(variables);
             assertTrue(variables.getUserDefinedVariables().containsKey("bounded_regex"));
@@ -92,6 +97,7 @@ public class TestValueReplacer extends J
             assertEquals("${bounded_regex}", args.get(0).getStringValue());
         }
 
+        @Test
         public void testOverlappingMatches() throws Exception {
             TestPlan plan = new TestPlan();
             plan.addParameter("longMatch", "servername");
@@ -104,6 +110,7 @@ public class TestValueReplacer extends J
             assertEquals("${${shortMatch}", replacedDomain);
         }
 
+        @Test
         public void testReplace() throws Exception {
             ValueReplacer replacer = new ValueReplacer();
             replacer.setUserDefinedVariables(variables.getUserDefinedVariables());
@@ -115,6 +122,7 @@ public class TestValueReplacer extends J
             assertEquals("jakarta.apache.org", element.getPropertyAsString("domain"));
         }
 
+        @Test
         public void testReplaceStringWithBackslash() throws Exception {
             ValueReplacer replacer = new ValueReplacer();
             replacer.setUserDefinedVariables(variables.getUserDefinedVariables());
@@ -134,6 +142,7 @@ public class TestValueReplacer extends J
          * 
          * See https://bz.apache.org/bugzilla/show_bug.cgi?id=53534
          */
+        @Test
         public void testReplaceFunctionWithBackslash() throws Exception {
             ValueReplacer replacer = new ValueReplacer();
             replacer.setUserDefinedVariables(variables.getUserDefinedVariables());
@@ -147,8 +156,8 @@ public class TestValueReplacer extends J
         }
 
         /** {@inheritDoc} */
-        @Override
-        protected void tearDown() throws Exception {
+        @After
+        public void tearDown() throws Exception {
             JMeterContextService.getContext().setSamplingStarted(false);
         }
 }



Mime
View raw message