ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [01/11] ant git commit: Let’s use doclint
Date Sun, 10 Dec 2017 07:58:46 GMT
Repository: ant
Updated Branches:
  refs/heads/master 6656db28b -> 0e17a8158


http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
b/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
index 92c0b94..bac4895 100644
--- a/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
+++ b/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
@@ -71,13 +71,9 @@ public class ModifiedSelectorTest {
 
     //  =====================  attributes  =====================
 
-
     /** Path where the testclasses are. */
     private Path testclasses = null;
 
-
-
-
     //  =====================  JUnit stuff  =====================
 
 
@@ -88,11 +84,9 @@ public class ModifiedSelectorTest {
         testclasses = new Path(prj, prj.getProperty("build.tests.value"));
     }
 
-
     // =======  testcases for the attributes and nested elements of the selector  =====
 
-
-    /** Test right use of cache names. */
+    /** Test correct use of cache names. */
     @Test
     public void testValidateWrongCache() {
         String name = "this-is-not-a-valid-cache-name";
@@ -106,8 +100,7 @@ public class ModifiedSelectorTest {
         }
     }
 
-
-    /** Test right use of cache names. */
+    /** Test correct use of cache names. */
     @Test
     public void testValidateWrongAlgorithm() {
         String name = "this-is-not-a-valid-algorithm-name";
@@ -122,8 +115,7 @@ public class ModifiedSelectorTest {
         }
     }
 
-
-    /** Test right use of comparator names. */
+    /** Test correct use of comparator names. */
     @Test
     public void testValidateWrongComparator() {
         String name = "this-is-not-a-valid-comparator-name";
@@ -138,7 +130,7 @@ public class ModifiedSelectorTest {
         }
     }
 
-
+    /** Test correct use of algorithm names. */
     @Test
     public void testIllegalCustomAlgorithm() {
         try {
@@ -152,7 +144,7 @@ public class ModifiedSelectorTest {
         }
     }
 
-
+    /** Test correct use of algorithm names. */
     @Test
     public void testNonExistentCustomAlgorithm() {
          try {
@@ -178,12 +170,12 @@ public class ModifiedSelectorTest {
         assertTrue("Wrong algorithm used: " + algo, algo.startsWith("MockAlgorithm"));
     }
 
-
     @Test
     public void testCustomClasses() {
         Assume.assumeNotNull("Ant home not set", selectorRule.getProject().getProperty("ant.home"));
         BFT bft = new BFT();
         bft.setUp();
+        // don't catch the JUnit exceptions
         try {
             // do the actions
             bft.doTarget("modifiedselectortest-customClasses");
@@ -198,7 +190,6 @@ public class ModifiedSelectorTest {
             assertNotNull("'fs.mod.value' must be set.", fsModValue);
             // must be empty according to the Mock* implementations
             assertTrue("'fs.mod.value' must be empty.", "".equals(fsModValue));
-        // don't catch the JUnit exceptions
         } finally {
             bft.doTarget("modifiedselectortest-scenario-clean");
             bft.deletePropertiesfile();
@@ -206,25 +197,21 @@ public class ModifiedSelectorTest {
         }
     }
 
-
     @Test
     public void testDelayUpdateTaskFinished() {
         doDelayUpdateTest(1);
     }
 
-
     @Test
     public void testDelayUpdateTargetFinished() {
         doDelayUpdateTest(2);
     }
 
-
     @Test
     public void testDelayUpdateBuildFinished() {
         doDelayUpdateTest(3);
     }
 
-
     public void doDelayUpdateTest(int kind) {
         // no check for 1<=kind<=3 - only internal use therefore check it
         // while development
@@ -273,11 +260,9 @@ public class ModifiedSelectorTest {
                 break;
         }
         assertTrue("Cache must be saved after " + kinds[kind - 1] + "Finished-Event.", cache.saved);
-
         // MockCache doesn't create a file - therefore no cleanup needed
     }
 
-
     /**
      * Extracts the real used algorithm name from the ModifiedSelector using
      * its toString() method.
@@ -308,10 +293,8 @@ public class ModifiedSelectorTest {
         return algo;
     }
 
-
     // ================  testcases for the cache implementations  ================
 
-
     /**
      * Propertycache must have a set 'cachefile' attribute.
      * The default in ModifiedSelector "cache.properties" is set by the selector.
@@ -323,7 +306,6 @@ public class ModifiedSelectorTest {
             fail("PropertyfilesCache does not check its configuration.");
     }
 
-
     @Test
     public void testPropertyfileCache() {
         PropertiesfileCache cache = new PropertiesfileCache();
@@ -333,7 +315,6 @@ public class ModifiedSelectorTest {
         assertFalse("Cache file not deleted.", cachefile.exists());
     }
 
-
     /** Checks whether a cache file is created. */
     @Test
     public void testCreatePropertiesCacheDirect() {
@@ -351,7 +332,6 @@ public class ModifiedSelectorTest {
         assertFalse("Cachefile not deleted.", cachefile.exists());
     }
 
-
     /** Checks whether a cache file is created. */
     @Test
     public void testCreatePropertiesCacheViaModifiedSelector() {
@@ -373,10 +353,8 @@ public class ModifiedSelectorTest {
         // evaluate correctness
         assertTrue("Cache file is not created.", cachefile.exists());
         cachefile.delete();
-
     }
 
-
     /**
      * In earlier implementations there were problems with the <i>order</i>
      * of the <param>s. The scenario was <pre>
@@ -405,17 +383,14 @@ public class ModifiedSelectorTest {
         // evaluate correctness
         assertTrue("Cache file is not created.", cachefile.exists());
         cachefile.delete();
-
     }
 
-
     @Test
     @Ignore("same logic as on algorithm, no testcases created")
     public void testCustomCache() {
         // same logic as on algorithm, no testcases created
     }
 
-
     /**
      * Test the interface semantic of Caches.
      * This method does some common test for cache implementations.
@@ -459,17 +434,14 @@ public class ModifiedSelectorTest {
         assertFalse("Cache is not empty", it3.hasNext());
     }
 
-
     // ==============  testcases for the algorithm implementations  ==============
 
-
     @Test
     public void testHashvalueAlgorithm() {
         HashvalueAlgorithm algo = new HashvalueAlgorithm();
         doTest(algo);
     }
 
-
     @Test
     public void testDigestAlgorithmMD5() {
         DigestAlgorithm algo = new DigestAlgorithm();
@@ -477,7 +449,6 @@ public class ModifiedSelectorTest {
         doTest(algo);
     }
 
-
     @Test
     public void testDigestAlgorithmSHA() {
         DigestAlgorithm algo = new DigestAlgorithm();
@@ -485,14 +456,12 @@ public class ModifiedSelectorTest {
         doTest(algo);
     }
 
-
     @Test
     public void testChecksumAlgorithm() {
         ChecksumAlgorithm algo = new ChecksumAlgorithm();
         doTest(algo);
     }
 
-
     @Test
     public void testChecksumAlgorithmCRC() {
         ChecksumAlgorithm algo = new ChecksumAlgorithm();
@@ -500,7 +469,6 @@ public class ModifiedSelectorTest {
         doTest(algo);
     }
 
-
     @Test
     public void testChecksumAlgorithmAdler() {
         ChecksumAlgorithm algo = new ChecksumAlgorithm();
@@ -508,7 +476,6 @@ public class ModifiedSelectorTest {
         doTest(algo);
     }
 
-
     /**
      * Test the interface semantic of Algorithms.
      * This method does some common test for algorithm implementations.
@@ -769,7 +736,6 @@ public class ModifiedSelectorTest {
         }
     }
 
-
     /**
      * This scenario is based on scenario 1, but does not use any
      * default value and its based on &lt;custom&gt; selector. Used values are:
@@ -836,28 +802,24 @@ public class ModifiedSelectorTest {
         }
     }
 
-
     @Test
     public void testScenarioCoreSelectorDefaults() {
         Assume.assumeNotNull("Ant home not set", selectorRule.getProject().getProperty("ant.home"));
         doScenarioTest("modifiedselectortest-scenario-coreselector-defaults", "cache.properties");
     }
 
-
     @Test
     public void testScenarioCoreSelectorSettings() {
         Assume.assumeNotNull("Ant home not set", selectorRule.getProject().getProperty("ant.home"));
         doScenarioTest("modifiedselectortest-scenario-coreselector-settings", "core.cache.properties");
     }
 
-
     @Test
     public void testScenarioCustomSelectorSettings() {
         Assume.assumeNotNull("Ant home not set", selectorRule.getProject().getProperty("ant.home"));
         doScenarioTest("modifiedselectortest-scenario-customselector-settings", "core.cache.properties");
     }
 
-
     public void doScenarioTest(String target, String cachefilename) {
         BFT bft = new BFT();
         bft.setUp();
@@ -886,10 +848,8 @@ public class ModifiedSelectorTest {
         }
     }
 
-
     //  =====================  helper methods and classes  ====================
 
-
     /**
      * Creates a configured parameter object.
      * @param name   name of the parameter
@@ -903,7 +863,6 @@ public class ModifiedSelectorTest {
         return p;
     }
 
-
     /**
      * The BFT class wrapps the selector test-builfile inside an
      * ant project. It supports target execution
@@ -916,20 +875,17 @@ public class ModifiedSelectorTest {
 
         boolean isConfigured = false;
 
-
         public void setUp() {
             super.configureProject(buildfile);
             isConfigured = true;
         }
 
-
         /**
          * This stub teardown is here because the outer class needs to call the
          * tearDown method, and in the superclass it is protected.
          */
         public void tearDown() {
             super.after();
-
         }
 
         public void doTarget(String target) {
@@ -1067,5 +1023,4 @@ public class ModifiedSelectorTest {
         return sb.toString();
     }
 
-
 }

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/ant/types/selectors/SizeSelectorTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/types/selectors/SizeSelectorTest.java b/src/tests/junit/org/apache/tools/ant/types/selectors/SizeSelectorTest.java
index 23ba36f..467b42a 100644
--- a/src/tests/junit/org/apache/tools/ant/types/selectors/SizeSelectorTest.java
+++ b/src/tests/junit/org/apache/tools/ant/types/selectors/SizeSelectorTest.java
@@ -19,6 +19,7 @@
 package org.apache.tools.ant.types.selectors;
 
 import java.util.Locale;
+
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.types.Parameter;
 import org.junit.Rule;

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/ant/util/DeweyDecimalTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/DeweyDecimalTest.java b/src/tests/junit/org/apache/tools/ant/util/DeweyDecimalTest.java
index ad1f8e0..e8e8cbd 100644
--- a/src/tests/junit/org/apache/tools/ant/util/DeweyDecimalTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/DeweyDecimalTest.java
@@ -26,7 +26,8 @@ import org.junit.Test;
 
 public class DeweyDecimalTest {
 
-    @Test public void parse() {
+    @Test
+    public void parse() {
         assertEquals("1.2.3", new DeweyDecimal("1.2.3").toString());
     }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/ant/util/LayoutPreservingPropertiesTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/LayoutPreservingPropertiesTest.java
b/src/tests/junit/org/apache/tools/ant/util/LayoutPreservingPropertiesTest.java
index 48c52b3..4309098 100644
--- a/src/tests/junit/org/apache/tools/ant/util/LayoutPreservingPropertiesTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/LayoutPreservingPropertiesTest.java
@@ -20,8 +20,8 @@ package org.apache.tools.ant.util;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
-import java.io.InputStreamReader;
 import java.io.IOException;
+import java.io.InputStreamReader;
 import java.util.Properties;
 
 import org.junit.Test;

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/ant/util/LineOrientedOutputStreamTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/LineOrientedOutputStreamTest.java b/src/tests/junit/org/apache/tools/ant/util/LineOrientedOutputStreamTest.java
index d4b417d..68a8164 100644
--- a/src/tests/junit/org/apache/tools/ant/util/LineOrientedOutputStreamTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/LineOrientedOutputStreamTest.java
@@ -135,6 +135,7 @@ public class LineOrientedOutputStreamTest {
 
     private class DummyStream extends LineOrientedOutputStream {
         private boolean invoked;
+
         protected void processLine(String line) {
             assertFalse("Only one line", invoked);
             assertEquals(LINE, line);
@@ -144,6 +145,7 @@ public class LineOrientedOutputStreamTest {
         private void assertInvoked() {
             assertTrue("At least one line", invoked);
         }
+
         private void assertNotInvoked() {
             assertTrue("No output", !invoked);
         }

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaOroMatcherTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaOroMatcherTest.java b/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaOroMatcherTest.java
index d1405f4..c05ea22 100644
--- a/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaOroMatcherTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaOroMatcherTest.java
@@ -28,8 +28,4 @@ public class JakartaOroMatcherTest extends RegexpMatcherTest {
         return new JakartaOroMatcher();
     }
 
-    public JakartaOroMatcherTest(String name) {
-        super(name);
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaOroRegexpTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaOroRegexpTest.java b/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaOroRegexpTest.java
index e869c62..ae82f75 100644
--- a/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaOroRegexpTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaOroRegexpTest.java
@@ -28,8 +28,4 @@ public class JakartaOroRegexpTest extends RegexpTest {
         return new JakartaOroRegexp();
     }
 
-    public JakartaOroRegexpTest(String name) {
-        super(name);
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaRegexpMatcherTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaRegexpMatcherTest.java
b/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaRegexpMatcherTest.java
index b93beb3..ce42c8c 100644
--- a/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaRegexpMatcherTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaRegexpMatcherTest.java
@@ -20,7 +20,9 @@ package org.apache.tools.ant.util.regexp;
 
 import java.io.IOException;
 
-import junit.framework.AssertionFailedError;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
 
 /**
  * Tests for the jakarta-regexp implementation of the RegexpMatcher interface.
@@ -32,30 +34,27 @@ public class JakartaRegexpMatcherTest extends RegexpMatcherTest {
         return new JakartaRegexpMatcher();
     }
 
-    public JakartaRegexpMatcherTest(String name) {
-        super(name);
-    }
-
+    @Test
     public void testWindowsLineSeparator2() throws IOException {
         try {
             super.testWindowsLineSeparator2();
             fail("Should trigger when this bug is fixed. {@since 1.2}");
-        } catch (AssertionFailedError e) {
+        } catch (AssertionError e) {
         }
     }
 
     /**
      * Fails for the same reason as "default" mode in doEndTest2.
      */
+    @Test
     public void testUnixLineSeparator() throws IOException {
         try {
             super.testUnixLineSeparator();
             fail("Should trigger once this bug is fixed. {@since 1.2}");
-        } catch (AssertionFailedError e) {
+        } catch (AssertionError e) {
         }
     }
 
-
     /**
      * Fails for "default" mode.
      */

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaRegexpRegexpTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaRegexpRegexpTest.java
b/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaRegexpRegexpTest.java
index 8edc13c..4937ff4 100644
--- a/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaRegexpRegexpTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/regexp/JakartaRegexpRegexpTest.java
@@ -20,7 +20,9 @@ package org.apache.tools.ant.util.regexp;
 
 import java.io.IOException;
 
-import junit.framework.AssertionFailedError;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
 
 /**
  * Tests for the jakarta-regexp implementation of the Regexp interface.
@@ -32,26 +34,24 @@ public class JakartaRegexpRegexpTest extends RegexpTest {
         return new JakartaRegexpRegexp();
     }
 
-    public JakartaRegexpRegexpTest(String name) {
-        super(name);
-    }
-
+    @Test
     public void testWindowsLineSeparator2() throws IOException {
         try {
             super.testWindowsLineSeparator2();
             fail("Should trigger when this bug is fixed. {@since 1.2}");
-        } catch (AssertionFailedError e) {
+        } catch (AssertionError e) {
         }
     }
 
     /**
      * Fails for the same reason as "default" mode in doEndTest2.
      */
+    @Test
     public void testUnixLineSeparator() throws IOException {
         try {
             super.testUnixLineSeparator();
             fail("Should trigger once this bug is fixed. {@since 1.2}");
-        } catch (AssertionFailedError e) {
+        } catch (AssertionError e) {
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/ant/util/regexp/Jdk14RegexpMatcherTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/regexp/Jdk14RegexpMatcherTest.java
b/src/tests/junit/org/apache/tools/ant/util/regexp/Jdk14RegexpMatcherTest.java
index 40f6dca..5a5f1d2 100644
--- a/src/tests/junit/org/apache/tools/ant/util/regexp/Jdk14RegexpMatcherTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/regexp/Jdk14RegexpMatcherTest.java
@@ -20,7 +20,9 @@ package org.apache.tools.ant.util.regexp;
 
 import java.io.IOException;
 
-import junit.framework.AssertionFailedError;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
 
 /**
  * Tests for the JDK 1.4 implementation of the RegexpMatcher interface.
@@ -32,39 +34,39 @@ public class Jdk14RegexpMatcherTest extends RegexpMatcherTest {
         return new Jdk14RegexpMatcher();
     }
 
-    public Jdk14RegexpMatcherTest(String name) {
-        super(name);
-    }
-
+    @Test
     public void testParagraphCharacter() throws IOException {
         try {
             super.testParagraphCharacter();
             fail("Should trigger once fixed. {@since JDK 1.4RC1}");
-        } catch (AssertionFailedError e) {
+        } catch (AssertionError e) {
         }
     }
 
+    @Test
     public void testLineSeparatorCharacter() throws IOException {
         try {
             super.testLineSeparatorCharacter();
             fail("Should trigger once fixed. {@since JDK 1.4RC1}");
-        } catch (AssertionFailedError e) {
+        } catch (AssertionError e) {
         }
     }
 
+    @Test
     public void testStandaloneCR() throws IOException {
         try {
             super.testStandaloneCR();
             fail("Should trigger once fixed. {@since JDK 1.4RC1}");
-        } catch (AssertionFailedError e) {
+        } catch (AssertionError e) {
         }
     }
 
+    @Test
     public void testWindowsLineSeparator() throws IOException {
         try {
             super.testWindowsLineSeparator();
             fail("Should trigger once fixed. {@since JDK 1.4RC1}");
-        } catch (AssertionFailedError e) {
+        } catch (AssertionError e) {
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexpTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexpTest.java b/src/tests/junit/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexpTest.java
index 5f5342e..67b69aa 100644
--- a/src/tests/junit/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexpTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexpTest.java
@@ -20,7 +20,9 @@ package org.apache.tools.ant.util.regexp;
 
 import java.io.IOException;
 
-import junit.framework.AssertionFailedError;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
 
 /**
  * Tests for the JDK 1.4 implementation of the Regexp interface.
@@ -32,39 +34,39 @@ public class Jdk14RegexpRegexpTest extends RegexpTest {
         return new Jdk14RegexpRegexp();
     }
 
-    public Jdk14RegexpRegexpTest(String name) {
-        super(name);
-    }
-
+    @Test
     public void testParagraphCharacter() throws IOException {
         try {
             super.testParagraphCharacter();
             fail("Should trigger once fixed. {@since JDK 1.4RC1}");
-        } catch (AssertionFailedError e) {
+        } catch (AssertionError e) {
         }
     }
 
+    @Test
     public void testLineSeparatorCharacter() throws IOException {
         try {
             super.testLineSeparatorCharacter();
             fail("Should trigger once fixed. {@since JDK 1.4RC1}");
-        } catch (AssertionFailedError e) {
+        } catch (AssertionError e) {
         }
     }
 
+    @Test
     public void testStandaloneCR() throws IOException {
         try {
             super.testStandaloneCR();
             fail("Should trigger once fixed. {@since JDK 1.4RC1}");
-        } catch (AssertionFailedError e) {
+        } catch (AssertionError e) {
         }
     }
 
+    @Test
     public void testWindowsLineSeparator() throws IOException {
         try {
             super.testWindowsLineSeparator();
             fail("Should trigger once fixed. {@since JDK 1.4RC1}");
-        } catch (AssertionFailedError e) {
+        } catch (AssertionError e) {
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/ant/util/regexp/RegexpMatcherTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/regexp/RegexpMatcherTest.java b/src/tests/junit/org/apache/tools/ant/util/regexp/RegexpMatcherTest.java
index 3129e68..77dbdac 100644
--- a/src/tests/junit/org/apache/tools/ant/util/regexp/RegexpMatcherTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/regexp/RegexpMatcherTest.java
@@ -18,16 +18,21 @@
 
 package org.apache.tools.ant.util.regexp;
 
+import org.junit.Before;
+import org.junit.Test;
+
 import java.io.IOException;
 import java.util.Vector;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Tests for all implementations of the RegexpMatcher interface.
  *
  */
-public abstract class RegexpMatcherTest extends TestCase {
+public abstract class RegexpMatcherTest {
 
     public final static String UNIX_LINE = "\n";
 
@@ -39,14 +44,12 @@ public abstract class RegexpMatcherTest extends TestCase {
         return reg;
     }
 
-    public RegexpMatcherTest(String name) {
-        super(name);
-    }
-
+    @Before
     public void setUp() {
         reg = getImplementation();
     }
 
+    @Test
     public void testMatches() {
         reg.setPattern("aaaa");
         assertTrue("aaaa should match itself", reg.matches("aaaa"));
@@ -73,6 +76,7 @@ public abstract class RegexpMatcherTest extends TestCase {
         assertTrue("([0-9]+)=\\1 shouldn\'t match 1=2", !reg.matches("1=2"));
     }
 
+    @Test
     public void testGroups() {
         reg.setPattern("aaaa");
         Vector v = reg.getGroups("xaaaa");
@@ -96,6 +100,7 @@ public abstract class RegexpMatcherTest extends TestCase {
         assertEquals("b", (String) v.elementAt(2));
     }
 
+    @Test
     public void testBugzillaReport14619() {
         reg.setPattern("^(.*)/src/((.*/)*)([a-zA-Z0-9_\\.]+)\\.java$");
         Vector v = reg.getGroups("de/tom/src/Google.java");
@@ -106,6 +111,7 @@ public abstract class RegexpMatcherTest extends TestCase {
         assertEquals("Google", v.elementAt(4));
     }
 
+    @Test
     public void testCaseInsensitiveMatch() {
         reg.setPattern("aaaa");
         assertTrue("aaaa doesn't match AAaa", !reg.matches("AAaa"));
@@ -113,46 +119,52 @@ public abstract class RegexpMatcherTest extends TestCase {
                    reg.matches("AAaa", RegexpMatcher.MATCH_CASE_INSENSITIVE));
     }
 
+    // make sure there are no issues concerning line separator interpretation
+    // a line separator for regex (perl) is always a unix line (ie \n)
 
-// make sure there are no issues concerning line separator interpretation
-// a line separator for regex (perl) is always a unix line (ie \n)
-
+    @Test
     public void testParagraphCharacter() throws IOException {
         reg.setPattern("end of text$");
         assertTrue("paragraph character", !reg.matches("end of text\u2029"));
     }
 
+    @Test
     public void testLineSeparatorCharacter() throws IOException {
         reg.setPattern("end of text$");
         assertTrue("line-separator character", !reg.matches("end of text\u2028"));
     }
 
+    @Test
     public void testNextLineCharacter() throws IOException {
         reg.setPattern("end of text$");
         assertTrue("next-line character", !reg.matches("end of text\u0085"));
     }
 
+    @Test
     public void testStandaloneCR() throws IOException {
         reg.setPattern("end of text$");
         assertTrue("standalone CR", !reg.matches("end of text\r"));
     }
 
+    @Test
     public void testWindowsLineSeparator() throws IOException {
         reg.setPattern("end of text$");
         assertTrue("Windows line separator", !reg.matches("end of text\r\n"));
     }
 
+    @Test
     public void testWindowsLineSeparator2() throws IOException {
         reg.setPattern("end of text\r$");
         assertTrue("Windows line separator", reg.matches("end of text\r\n"));
     }
 
+    @Test
     public void testUnixLineSeparator() throws IOException {
         reg.setPattern("end of text$");
         assertTrue("Unix line separator", reg.matches("end of text\n"));
     }
 
-
+    @Test
     public void testMultiVersusSingleLine() throws IOException {
         StringBuilder buf = new StringBuilder();
         buf.append("Line1").append(UNIX_LINE);

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/ant/util/regexp/RegexpTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/regexp/RegexpTest.java b/src/tests/junit/org/apache/tools/ant/util/regexp/RegexpTest.java
index 5cfe8c9..08a8416 100644
--- a/src/tests/junit/org/apache/tools/ant/util/regexp/RegexpTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/regexp/RegexpTest.java
@@ -18,6 +18,11 @@
 
 package org.apache.tools.ant.util.regexp;
 
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Tests for all implementations of the Regexp interface.
  *
@@ -27,16 +32,13 @@ public abstract class RegexpTest extends RegexpMatcherTest {
     private static final String test = "abcdefg-abcdefg";
     private static final String pattern = "ab([^d]*)d([^f]*)f";
 
-    public RegexpTest(String name) {
-        super(name);
-    }
-
     public final RegexpMatcher getImplementation() {
         return getRegexpImplementation();
     }
 
     public abstract Regexp getRegexpImplementation();
 
+    @Test
     public void testSubstitution() {
         Regexp reg = (Regexp) getReg();
         reg.setPattern(pattern);
@@ -45,6 +47,7 @@ public abstract class RegexpTest extends RegexpMatcherTest {
                                                        Regexp.MATCH_DEFAULT));
     }
 
+    @Test
     public void testReplaceFirstSubstitution() {
         Regexp reg = (Regexp) getReg();
         reg.setPattern(pattern);
@@ -53,6 +56,7 @@ public abstract class RegexpTest extends RegexpMatcherTest {
                                                        Regexp.REPLACE_FIRST));
     }
 
+    @Test
     public void testReplaceAllSubstitution() {
         Regexp reg = (Regexp) getReg();
         reg.setPattern(pattern);

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/mail/MailMessageTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/mail/MailMessageTest.java b/src/tests/junit/org/apache/tools/mail/MailMessageTest.java
index 9a1aa8c..cabeef5 100644
--- a/src/tests/junit/org/apache/tools/mail/MailMessageTest.java
+++ b/src/tests/junit/org/apache/tools/mail/MailMessageTest.java
@@ -175,7 +175,6 @@ public class MailMessageTest {
         assertFalse(testMailClient.getFailMessage(), testMailClient.isFailed());
     }
 
-
     /**
      *  Test a MailMessage with no to or bcc lines
      * @throws InterruptedException if something goes wrong
@@ -227,7 +226,6 @@ public class MailMessageTest {
         assertFalse(testMailClient.getFailMessage(), testMailClient.isFailed());
     }
 
-
     /**
      *  Test a MailMessage with no to or cc lines
      * @throws InterruptedException if something goes wrong
@@ -278,7 +276,6 @@ public class MailMessageTest {
         assertFalse(testMailClient.getFailMessage(), testMailClient.isFailed());
     }
 
-
     /**
      *  Test a MailMessage with no subject line
      *  Subject is an optional field (RFC 822 s4.1)
@@ -329,7 +326,6 @@ public class MailMessageTest {
         assertFalse(testMailClient.getFailMessage(), testMailClient.isFailed());
     }
 
-
     /**
      *  Test a MailMessage with empty body message
      * @throws InterruptedException if something goes wrong
@@ -379,7 +375,6 @@ public class MailMessageTest {
         assertFalse(testMailClient.getFailMessage(), testMailClient.isFailed());
     }
 
-
     /**
      *  Test a MailMessage with US-ASCII character set
      *  The next four testcase can be kinda hard to debug as Ant will often
@@ -504,7 +499,6 @@ public class MailMessageTest {
                     } else {
                         // sb.append(response + "\r\n");
                     }
-
                 } // while
             } catch (IOException ioe) {
                 throw new BuildException(ioe);

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/zip/ExtraFieldUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/zip/ExtraFieldUtilsTest.java b/src/tests/junit/org/apache/tools/zip/ExtraFieldUtilsTest.java
index 15b1b6d..841a2fc 100644
--- a/src/tests/junit/org/apache/tools/zip/ExtraFieldUtilsTest.java
+++ b/src/tests/junit/org/apache/tools/zip/ExtraFieldUtilsTest.java
@@ -26,8 +26,7 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 /**
- * JUnit 3 testcases for org.apache.tools.zip.ExtraFieldUtils.
- *
+ * JUnit 4 testcases for org.apache.tools.zip.ExtraFieldUtils.
  */
 public class ExtraFieldUtilsTest implements UnixStat {
 

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/zip/ZipEntryTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/zip/ZipEntryTest.java b/src/tests/junit/org/apache/tools/zip/ZipEntryTest.java
index 96bbd45..1fd9fd1 100644
--- a/src/tests/junit/org/apache/tools/zip/ZipEntryTest.java
+++ b/src/tests/junit/org/apache/tools/zip/ZipEntryTest.java
@@ -26,8 +26,7 @@ import static org.junit.Assert.assertSame;
 import static org.junit.Assert.fail;
 
 /**
- * JUnit 3 testcases for org.apache.tools.zip.ZipEntry.
- *
+ * JUnit 4 testcases for org.apache.tools.zip.ZipEntry.
  */
 public class ZipEntryTest {
 

http://git-wip-us.apache.org/repos/asf/ant/blob/67f29ce0/src/tests/junit/org/apache/tools/zip/ZipShortTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/zip/ZipShortTest.java b/src/tests/junit/org/apache/tools/zip/ZipShortTest.java
index a6aa3e7..0e3cf28 100644
--- a/src/tests/junit/org/apache/tools/zip/ZipShortTest.java
+++ b/src/tests/junit/org/apache/tools/zip/ZipShortTest.java
@@ -25,8 +25,7 @@ import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertTrue;
 
 /**
- * JUnit 3 testcases for org.apache.tools.zip.ZipShort.
- *
+ * JUnit 4 testcases for org.apache.tools.zip.ZipShort.
  */
 public class ZipShortTest {
 


Mime
View raw message