[maven-shade-plugin] branch junit4 created (now 8d9514f)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[maven-shade-plugin] branch junit4 created (now 8d9514f)

slachiewicz
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a change to branch junit4
in repository https://gitbox.apache.org/repos/asf/maven-shade-plugin.git.


      at 8d9514f  Code cleanup - migrate to Junit4

This branch includes the following new commits:

     new 99c57c8  Upgrade to XMLUnit 2 (legacy)
     new 8d9514f  Code cleanup - migrate to Junit4

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Reply | Threaded
Open this post in threaded view
|

[maven-shade-plugin] 01/02: Upgrade to XMLUnit 2 (legacy)

slachiewicz
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch junit4
in repository https://gitbox.apache.org/repos/asf/maven-shade-plugin.git

commit 99c57c84e7aa25922b6c350829a32d41dd8ddabe
Author: Sylwester Lachiewicz <[hidden email]>
AuthorDate: Sat Jun 27 14:35:55 2020 +0200

    Upgrade to XMLUnit 2 (legacy)
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1533755..25ec427 100644
--- a/pom.xml
+++ b/pom.xml
@@ -176,9 +176,9 @@
     </dependency>
 
     <dependency>
-      <groupId>xmlunit</groupId>
-      <artifactId>xmlunit</artifactId>
-      <version>1.6</version>
+      <groupId>org.xmlunit</groupId>
+      <artifactId>xmlunit-legacy</artifactId>
+      <version>2.7.0</version>
       <scope>test</scope>
     </dependency>
 

Reply | Threaded
Open this post in threaded view
|

[maven-shade-plugin] 02/02: Code cleanup - migrate to Junit4

slachiewicz
In reply to this post by slachiewicz
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch junit4
in repository https://gitbox.apache.org/repos/asf/maven-shade-plugin.git

commit 8d9514f9e1be72227857dad08032c88f3697ac63
Author: Sylwester Lachiewicz <[hidden email]>
AuthorDate: Sat Jun 27 14:28:04 2020 +0200

    Code cleanup - migrate to Junit4
---
 .../maven/plugins/shade/DefaultShaderTest.java     | 35 +++++++++++++---------
 .../plugins/shade/filter/SimpleFilterTest.java     |  6 ++--
 .../maven/plugins/shade/mojo/ArtifactIdTest.java   |  9 ++++--
 .../plugins/shade/mojo/ArtifactSelectorTest.java   |  7 +++--
 .../maven/plugins/shade/mojo/ShadeMojoTest.java    |  2 --
 .../relocation/SimpleRelocatorParameterTest.java   | 14 ++++-----
 .../shade/relocation/SimpleRelocatorTest.java      | 19 ++++++++++--
 .../ApacheLicenseResourceTransformerTest.java      | 21 ++++++++-----
 ...cheNoticeResourceTransformerParameterTests.java | 18 +++++++----
 .../ApacheNoticeResourceTransformerTest.java       | 21 ++++++++-----
 .../shade/resource/AppendingTransformerTest.java   | 19 +++++++-----
 .../ComponentsXmlResourceTransformerTest.java      |  7 +++--
 .../resource/GroovyResourceTransformerTest.java    | 13 ++++++--
 .../resource/XmlAppendingTransformerTest.java      | 19 +++++++-----
 14 files changed, 135 insertions(+), 75 deletions(-)

diff --git a/src/test/java/org/apache/maven/plugins/shade/DefaultShaderTest.java b/src/test/java/org/apache/maven/plugins/shade/DefaultShaderTest.java
index 012a366..7eedcf5 100644
--- a/src/test/java/org/apache/maven/plugins/shade/DefaultShaderTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/DefaultShaderTest.java
@@ -35,35 +35,35 @@ import java.util.Set;
 import java.util.jar.JarEntry;
 import java.util.jar.JarOutputStream;
 
-import junit.framework.TestCase;
-
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.shade.filter.Filter;
 import org.apache.maven.plugins.shade.relocation.Relocator;
 import org.apache.maven.plugins.shade.relocation.SimpleRelocator;
 import org.apache.maven.plugins.shade.resource.AppendingTransformer;
 import org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer;
-import org.apache.maven.plugins.shade.resource.ManifestResourceTransformer;
 import org.apache.maven.plugins.shade.resource.ResourceTransformer;
 import org.codehaus.plexus.logging.AbstractLogger;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.logging.console.ConsoleLogger;
-import org.junit.Rule;
+import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 import org.objectweb.asm.ClassReader;
 import org.objectweb.asm.ClassVisitor;
 import org.objectweb.asm.Opcodes;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 /**
  * @author Jason van Zyl
  * @author Mauro Talevi
  */
 public class DefaultShaderTest
-    extends TestCase
 {
     private static final String[] EXCLUDES = new String[] { "org/codehaus/plexus/util/xml/Xpp3Dom",
         "org/codehaus/plexus/util/xml/pull.*" };
 
+    @Test
     public void testOverlappingResourcesAreLogged() throws IOException, MojoExecutionException {
         final DefaultShader shader = new DefaultShader();
         final MockLogger logs = new MockLogger();
@@ -84,15 +84,16 @@ public class DefaultShaderTest
         shader.shade( shadeRequest );
 
         final String failureWarnMessage = logs.warnMessages.toString();
-        assertTrue(failureWarnMessage, logs.warnMessages.contains(
-                "plexus-utils-1.4.1.jar, test-project-1.0-SNAPSHOT.jar define 1 overlapping resource:"));
-        assertTrue(failureWarnMessage, logs.warnMessages.contains("- META-INF/MANIFEST.MF"));
+        assertTrue( failureWarnMessage, logs.warnMessages.contains(
+                "plexus-utils-1.4.1.jar, test-project-1.0-SNAPSHOT.jar define 1 overlapping resource:") );
+        assertTrue( failureWarnMessage, logs.warnMessages.contains("- META-INF/MANIFEST.MF") );
 
         final String failureDebugMessage = logs.debugMessages.toString();
-        assertTrue(failureDebugMessage, logs.debugMessages.contains(
-                "We have a duplicate META-INF/MANIFEST.MF in src/test/jars/plexus-utils-1.4.1.jar" ));
+        assertTrue( failureDebugMessage, logs.debugMessages.contains(
+                "We have a duplicate META-INF/MANIFEST.MF in src/test/jars/plexus-utils-1.4.1.jar" ) );
     }
 
+    @Test
     public void testOverlappingResourcesAreLoggedExceptATransformerHandlesIt() throws Exception {
         TemporaryFolder temporaryFolder = new TemporaryFolder();
         Set<File> set = new LinkedHashSet<>();
@@ -139,17 +140,20 @@ public class DefaultShaderTest
 
         temporaryFolder.delete();
 
-        assertTrue(logWithTransformer.warnMessages.toString(), logWithTransformer.warnMessages.isEmpty());
-        assertTrue(logWithoutTransformer.warnMessages.toString(), logWithoutTransformer.warnMessages.containsAll(
-               Arrays.<String>asList( "j1.jar, j2.jar define 1 overlapping resource:", "- foo.txt" ) ) );
+        assertTrue( logWithTransformer.warnMessages.toString(), logWithTransformer.warnMessages.isEmpty() );
+        assertTrue( logWithoutTransformer.warnMessages.toString(),
+                logWithoutTransformer.warnMessages.containsAll(
+                        Arrays.asList( "j1.jar, j2.jar define 1 overlapping resource:", "- foo.txt" ) ) );
     }
 
+    @Test
     public void testShaderWithDefaultShadedPattern()
         throws Exception
     {
         shaderWithPattern( null, new File( "target/foo-default.jar" ), EXCLUDES );
     }
 
+    @Test
     public void testShaderWithStaticInitializedClass()
         throws Exception
     {
@@ -185,12 +189,14 @@ public class DefaultShaderTest
         }
     }
 
+    @Test
     public void testShaderWithCustomShadedPattern()
         throws Exception
     {
         shaderWithPattern( "org/shaded/plexus/util", new File( "target/foo-custom.jar" ), EXCLUDES );
     }
 
+    @Test
     public void testShaderWithoutExcludesShouldRemoveReferencesOfOriginalPattern()
         throws Exception
     {
@@ -200,6 +206,7 @@ public class DefaultShaderTest
                            new String[] {} );
     }
 
+    @Test
     public void testShaderWithRelocatedClassname()
         throws Exception
     {
@@ -214,7 +221,7 @@ public class DefaultShaderTest
         List<Relocator> relocators = new ArrayList<>();
 
         relocators.add( new SimpleRelocator( "org/codehaus/plexus/util/", "_plexus/util/__", null,
-                                             Arrays.<String> asList() ) );
+                Collections.<String>emptyList() ) );
 
         List<ResourceTransformer> resourceTransformers = new ArrayList<>();
 
diff --git a/src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java b/src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java
index a2dff0e..a508435 100644
--- a/src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/filter/SimpleFilterTest.java
@@ -19,21 +19,23 @@ package org.apache.maven.plugins.shade.filter;
  * under the License.
  */
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 import java.util.Collections;
 
-import junit.framework.TestCase;
 import org.apache.maven.plugins.shade.mojo.ArchiveFilter;
+import org.junit.Test;
 
 /**
  * @author Benjamin Bentmann
  */
 public class SimpleFilterTest
-    extends TestCase
 {
 
+    @Test
     public void testIsFiltered()
     {
         SimpleFilter filter;
diff --git a/src/test/java/org/apache/maven/plugins/shade/mojo/ArtifactIdTest.java b/src/test/java/org/apache/maven/plugins/shade/mojo/ArtifactIdTest.java
index e9a77a6..70d1d9d 100644
--- a/src/test/java/org/apache/maven/plugins/shade/mojo/ArtifactIdTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/mojo/ArtifactIdTest.java
@@ -19,15 +19,19 @@ package org.apache.maven.plugins.shade.mojo;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 /**
  * @author Benjamin Bentmann
  */
 public class ArtifactIdTest
-    extends TestCase
 {
 
+    @Test
     public void testIdParsing()
     {
         ArtifactId id;
@@ -117,6 +121,7 @@ public class ArtifactIdTest
         assertEquals( "*", id.getClassifier() );
     }
 
+    @Test
     public void testMatches()
     {
         assertTrue( new ArtifactId( "gid", "aid", "type", "cls" ).matches( new ArtifactId( "gid:aid:type:cls" ) ) );
diff --git a/src/test/java/org/apache/maven/plugins/shade/mojo/ArtifactSelectorTest.java b/src/test/java/org/apache/maven/plugins/shade/mojo/ArtifactSelectorTest.java
index 954042a..752faca 100644
--- a/src/test/java/org/apache/maven/plugins/shade/mojo/ArtifactSelectorTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/mojo/ArtifactSelectorTest.java
@@ -22,13 +22,15 @@ package org.apache.maven.plugins.shade.mojo;
 import java.util.Collection;
 import java.util.Collections;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 /**
  * @author Benjamin Bentmann
  */
 public class ArtifactSelectorTest
-    extends TestCase
 {
 
     private ArtifactSelector newSelector( Collection<String> includes, Collection<String> excludes, String groupPrefix )
@@ -36,6 +38,7 @@ public class ArtifactSelectorTest
         return new ArtifactSelector( includes, excludes, groupPrefix );
     }
 
+    @Test
     public void testIsSelected()
     {
         ArtifactSelector selector;
diff --git a/src/test/java/org/apache/maven/plugins/shade/mojo/ShadeMojoTest.java b/src/test/java/org/apache/maven/plugins/shade/mojo/ShadeMojoTest.java
index d5020ac..6458fb0 100644
--- a/src/test/java/org/apache/maven/plugins/shade/mojo/ShadeMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/mojo/ShadeMojoTest.java
@@ -130,7 +130,6 @@ public class ShadeMojoTest
         {
             @Override
             public ArtifactResult resolveArtifact( ProjectBuildingRequest req, final Artifact art )
-                throws ArtifactResolverException
             {
                 return new ArtifactResult()
                 {
@@ -149,7 +148,6 @@ public class ShadeMojoTest
 
             @Override
             public ArtifactResult resolveArtifact( ProjectBuildingRequest req, final ArtifactCoordinate coordinate )
-                throws ArtifactResolverException
             {
                 return new ArtifactResult()
                 {
diff --git a/src/test/java/org/apache/maven/plugins/shade/relocation/SimpleRelocatorParameterTest.java b/src/test/java/org/apache/maven/plugins/shade/relocation/SimpleRelocatorParameterTest.java
index 2dbc55b..64f6da2 100644
--- a/src/test/java/org/apache/maven/plugins/shade/relocation/SimpleRelocatorParameterTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/relocation/SimpleRelocatorParameterTest.java
@@ -19,26 +19,22 @@ package org.apache.maven.plugins.shade.relocation;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
 import java.util.Collections;
 
+import static org.junit.Assert.fail;
+
 public class SimpleRelocatorParameterTest
-    extends TestCase
 {
 
-
-    protected void setUp()
-        throws Exception
-    {
-        super.setUp();
-    }
-
+    @Test
     public void testThatNullPatternInConstructorShouldNotThrowNullPointerException()
     {
         constructThenFailOnNullPointerException( null, "" );
     }
 
+    @Test
     public void testThatNullShadedPatternInConstructorShouldNotThrowNullPointerException()
     {
         constructThenFailOnNullPointerException( "", null );
diff --git a/src/test/java/org/apache/maven/plugins/shade/relocation/SimpleRelocatorTest.java b/src/test/java/org/apache/maven/plugins/shade/relocation/SimpleRelocatorTest.java
index eab5154..b0139d5 100644
--- a/src/test/java/org/apache/maven/plugins/shade/relocation/SimpleRelocatorTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/relocation/SimpleRelocatorTest.java
@@ -20,11 +20,15 @@ package org.apache.maven.plugins.shade.relocation;
  */
 
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
 import java.util.Arrays;
 import java.util.Collections;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Test for {@link SimpleRelocator}.
  *
@@ -32,9 +36,9 @@ import java.util.Collections;
  *
  */
 public class SimpleRelocatorTest
-    extends TestCase
 {
 
+    @Test
     public void testCanRelocatePath()
     {
         SimpleRelocator relocator;
@@ -68,6 +72,7 @@ public class SimpleRelocatorTest
         assertFalse( relocator.canRelocatePath( "org/foo/PublicUtilStuff.class" ) );
     }
 
+    @Test
     public void testCanRelocateClass()
     {
         SimpleRelocator relocator;
@@ -91,6 +96,7 @@ public class SimpleRelocatorTest
         assertFalse( relocator.canRelocateClass( "org.foo.PublicUtilStuff" ) );
     }
 
+    @Test
     public void testCanRelocateRawString()
     {
         SimpleRelocator relocator;
@@ -103,12 +109,14 @@ public class SimpleRelocatorTest
     }
 
     //MSHADE-119, make sure that the easy part of this works.
-    public void testCanRelocateAbsClassPath()
+    @Test
+    public void testCanRelocateAbsClassPath()
     {
         SimpleRelocator relocator = new SimpleRelocator( "org.apache.velocity", "org.apache.momentum", null, null );
         assertEquals("/org/apache/momentum/mass.properties", relocator.relocatePath( "/org/apache/velocity/mass.properties" ) );
     }
 
+    @Test
     public void testCanRelocateAbsClassPathWithExcludes()
     {
         SimpleRelocator relocator = new SimpleRelocator( "org/apache/velocity", "org/apache/momentum", null,
@@ -119,6 +127,7 @@ public class SimpleRelocatorTest
         assertFalse( relocator.canRelocatePath( "org/apache/velocity/excluded/mass.properties" ) );
     }
 
+    @Test
     public void testCanRelocateAbsClassPathWithIncludes()
     {
         SimpleRelocator relocator = new SimpleRelocator( "org/apache/velocity", "org/apache/momentum",
@@ -129,6 +138,7 @@ public class SimpleRelocatorTest
         assertTrue( relocator.canRelocatePath( "org/apache/velocity/included/mass.properties" ) );
     }
 
+    @Test
     public void testRelocatePath()
     {
         SimpleRelocator relocator;
@@ -140,6 +150,7 @@ public class SimpleRelocatorTest
         assertEquals( "private/stuff/bar/Class.class", relocator.relocatePath( "org/foo/bar/Class.class" ) );
     }
 
+    @Test
     public void testRelocateClass()
     {
         SimpleRelocator relocator;
@@ -151,6 +162,7 @@ public class SimpleRelocatorTest
         assertEquals( "private.stuff.bar.Class", relocator.relocateClass( "org.foo.bar.Class" ) );
     }
 
+    @Test
     public void testRelocateRawString()
     {
         SimpleRelocator relocator;
@@ -162,6 +174,7 @@ public class SimpleRelocatorTest
         assertEquals( "META-INF/hidden.org.foo.xml", relocator.relocatePath( "META-INF/org.foo.xml" ) );
     }
     
+    @Test
     public void testRelocateMavenFiles()
     {
         SimpleRelocator relocator =
diff --git a/src/test/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformerTest.java b/src/test/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformerTest.java
index 35666eb..f50d430 100644
--- a/src/test/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformerTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/resource/ApacheLicenseResourceTransformerTest.java
@@ -21,7 +21,11 @@ package org.apache.maven.plugins.shade.resource;
 
 import java.util.Locale;
 
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test for {@link ApacheLicenseResourceTransformer}.
@@ -29,7 +33,6 @@ import junit.framework.TestCase;
  * @author Benjamin Bentmann
  */
 public class ApacheLicenseResourceTransformerTest
-    extends TestCase
 {
 
     private ApacheLicenseResourceTransformer transformer;
@@ -43,18 +46,20 @@ public class ApacheLicenseResourceTransformerTest
         Locale.setDefault( new Locale( "tr" ) );
     }
 
+    @Before
     public void setUp()
     {
-        this.transformer = new ApacheLicenseResourceTransformer();
+        transformer = new ApacheLicenseResourceTransformer();
     }
 
+    @Test
     public void testCanTransformResource()
     {
-        assertTrue( this.transformer.canTransformResource( "META-INF/LICENSE" ) );
-        assertTrue( this.transformer.canTransformResource( "META-INF/LICENSE.TXT" ) );
-        assertTrue( this.transformer.canTransformResource( "META-INF/LICENSE.md" ) );
-        assertTrue( this.transformer.canTransformResource( "META-INF/License.txt" ) );
-        assertFalse( this.transformer.canTransformResource( "META-INF/MANIFEST.MF" ) );
+        assertTrue( transformer.canTransformResource( "META-INF/LICENSE" ) );
+        assertTrue( transformer.canTransformResource( "META-INF/LICENSE.TXT" ) );
+        assertTrue( transformer.canTransformResource( "META-INF/LICENSE.md" ) );
+        assertTrue( transformer.canTransformResource( "META-INF/License.txt" ) );
+        assertFalse( transformer.canTransformResource( "META-INF/MANIFEST.MF" ) );
     }
 
 }
diff --git a/src/test/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformerParameterTests.java b/src/test/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformerParameterTests.java
index 7e53f54..64e0191 100644
--- a/src/test/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformerParameterTests.java
+++ b/src/test/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformerParameterTests.java
@@ -7,7 +7,10 @@ import java.util.List;
 
 import org.apache.maven.plugins.shade.relocation.Relocator;
 
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
 
 
 /*
@@ -33,55 +36,60 @@ import junit.framework.TestCase;
  * Tests {@link ApacheLicenseResourceTransformer} parameters.
  */
 public class ApacheNoticeResourceTransformerParameterTests
-    extends TestCase
 {
 
  private static final String NOTICE_RESOURCE = "META-INF/NOTICE";
  private ApacheNoticeResourceTransformer subject;
 
-    protected void setUp()
-        throws Exception
+    @Before
+    public void setUp()
     {
-        super.setUp();
         subject = new ApacheNoticeResourceTransformer();
     }
 
+    @Test
     public void testNoParametersShouldNotThrowNullPointerWhenNoInput()
         throws IOException
     {
         processAndFailOnNullPointer( "" );
     }
 
+    @Test
     public void testNoParametersShouldNotThrowNullPointerWhenNoLinesOfInput()
         throws IOException
     {
         processAndFailOnNullPointer( "Some notice text" );
     }
 
+    @Test
     public void testNoParametersShouldNotThrowNullPointerWhenOneLineOfInput()
         throws IOException
     {
         processAndFailOnNullPointer( "Some notice text\n" );
     }
 
+    @Test
     public void testNoParametersShouldNotThrowNullPointerWhenTwoLinesOfInput()
         throws IOException
     {
         processAndFailOnNullPointer( "Some notice text\nSome notice text\n" );
     }
 
+    @Test
     public void testNoParametersShouldNotThrowNullPointerWhenLineStartsWithSlashSlash()
         throws IOException
     {
         processAndFailOnNullPointer( "Some notice text\n//Some notice text\n" );
     }
 
+    @Test
     public void testNoParametersShouldNotThrowNullPointerWhenLineIsSlashSlash()
         throws IOException
     {
         processAndFailOnNullPointer( "//\n" );
     }
 
+    @Test
     public void testNoParametersShouldNotThrowNullPointerWhenLineIsEmpty()
         throws IOException
     {
diff --git a/src/test/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformerTest.java b/src/test/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformerTest.java
index 89029e1..ffc6f26 100644
--- a/src/test/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformerTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformerTest.java
@@ -21,7 +21,11 @@ package org.apache.maven.plugins.shade.resource;
 
 import java.util.Locale;
 
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test for {@link ApacheNoticeResourceTransformer}.
@@ -29,7 +33,6 @@ import junit.framework.TestCase;
  * @author Benjamin Bentmann
  */
 public class ApacheNoticeResourceTransformerTest
-    extends TestCase
 {
 
     private ApacheNoticeResourceTransformer transformer;
@@ -43,18 +46,20 @@ public class ApacheNoticeResourceTransformerTest
         Locale.setDefault( new Locale( "tr" ) );
     }
 
+    @Before
     public void setUp()
     {
-        this.transformer = new ApacheNoticeResourceTransformer();
+        transformer = new ApacheNoticeResourceTransformer();
     }
 
+    @Test
     public void testCanTransformResource()
     {
-        assertTrue( this.transformer.canTransformResource( "META-INF/NOTICE" ) );
-        assertTrue( this.transformer.canTransformResource( "META-INF/NOTICE.TXT" ) );
-        assertTrue( this.transformer.canTransformResource( "META-INF/NOTICE.md" ) );
-        assertTrue( this.transformer.canTransformResource( "META-INF/Notice.txt" ) );
-        assertFalse( this.transformer.canTransformResource( "META-INF/MANIFEST.MF" ) );
+        assertTrue( transformer.canTransformResource( "META-INF/NOTICE" ) );
+        assertTrue( transformer.canTransformResource( "META-INF/NOTICE.TXT" ) );
+        assertTrue( transformer.canTransformResource( "META-INF/NOTICE.md" ) );
+        assertTrue( transformer.canTransformResource( "META-INF/Notice.txt" ) );
+        assertFalse( transformer.canTransformResource( "META-INF/MANIFEST.MF" ) );
     }
 
 }
diff --git a/src/test/java/org/apache/maven/plugins/shade/resource/AppendingTransformerTest.java b/src/test/java/org/apache/maven/plugins/shade/resource/AppendingTransformerTest.java
index b54817f..2ecf09e 100644
--- a/src/test/java/org/apache/maven/plugins/shade/resource/AppendingTransformerTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/resource/AppendingTransformerTest.java
@@ -21,7 +21,11 @@ package org.apache.maven.plugins.shade.resource;
 
 import java.util.Locale;
 
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test for {@link AppendingTransformer}.
@@ -29,7 +33,6 @@ import junit.framework.TestCase;
  * @author Benjamin Bentmann
  */
 public class AppendingTransformerTest
-    extends TestCase
 {
 
     private AppendingTransformer transformer;
@@ -43,18 +46,20 @@ public class AppendingTransformerTest
         Locale.setDefault( new Locale( "tr" ) );
     }
 
+    @Before
     public void setUp()
     {
-        this.transformer = new AppendingTransformer();
+        transformer = new AppendingTransformer();
     }
 
+    @Test
     public void testCanTransformResource()
     {
-        this.transformer.resource = "abcdefghijklmnopqrstuvwxyz";
+        transformer.resource = "abcdefghijklmnopqrstuvwxyz";
 
-        assertTrue( this.transformer.canTransformResource( "abcdefghijklmnopqrstuvwxyz" ) );
-        assertTrue( this.transformer.canTransformResource( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) );
-        assertFalse( this.transformer.canTransformResource( "META-INF/MANIFEST.MF" ) );
+        assertTrue( transformer.canTransformResource( "abcdefghijklmnopqrstuvwxyz" ) );
+        assertTrue( transformer.canTransformResource( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) );
+        assertFalse( transformer.canTransformResource( "META-INF/MANIFEST.MF" ) );
     }
 
 }
diff --git a/src/test/java/org/apache/maven/plugins/shade/resource/ComponentsXmlResourceTransformerTest.java b/src/test/java/org/apache/maven/plugins/shade/resource/ComponentsXmlResourceTransformerTest.java
index 7b7f838..8e65431 100644
--- a/src/test/java/org/apache/maven/plugins/shade/resource/ComponentsXmlResourceTransformerTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/resource/ComponentsXmlResourceTransformerTest.java
@@ -19,13 +19,13 @@ package org.apache.maven.plugins.shade.resource;
  * under the License.
  */
 
-import junit.framework.TestCase;
-
 import org.apache.maven.plugins.shade.relocation.Relocator;
 import org.codehaus.plexus.util.IOUtil;
 import org.custommonkey.xmlunit.Diff;
 import org.custommonkey.xmlunit.XMLAssert;
 import org.custommonkey.xmlunit.XMLUnit;
+import org.junit.Before;
+import org.junit.Test;
 
 import java.io.InputStream;
 import java.util.Collections;
@@ -37,15 +37,16 @@ import java.util.Collections;
  *
  */
 public class ComponentsXmlResourceTransformerTest
-    extends TestCase
 {
     private ComponentsXmlResourceTransformer transformer;
 
+    @Before
     public void setUp()
     {
         this.transformer = new ComponentsXmlResourceTransformer();
     }
 
+    @Test
     public void testConfigurationMerging()
         throws Exception
     {
diff --git a/src/test/java/org/apache/maven/plugins/shade/resource/GroovyResourceTransformerTest.java b/src/test/java/org/apache/maven/plugins/shade/resource/GroovyResourceTransformerTest.java
index fc7137c..ce9dd8d 100644
--- a/src/test/java/org/apache/maven/plugins/shade/resource/GroovyResourceTransformerTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/resource/GroovyResourceTransformerTest.java
@@ -19,8 +19,8 @@ package org.apache.maven.plugins.shade.resource;
  * under the License.
  */
 
-import junit.framework.TestCase;
 import org.apache.maven.plugins.shade.relocation.Relocator;
+import org.junit.Test;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -33,12 +33,16 @@ import java.util.jar.JarFile;
 import java.util.jar.JarOutputStream;
 import java.util.zip.ZipEntry;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 /**
  * Test for {@link GroovyResourceTransformer}.
  *
  */
 public class GroovyResourceTransformerTest
-    extends TestCase
 {
 
     private static InputStream stream( Properties props )
@@ -93,8 +97,8 @@ public class GroovyResourceTransformerTest
         return desc;
     }
 
+    @Test
     public void testFilter()
-        throws Exception
     {
         GroovyResourceTransformer transformer = new GroovyResourceTransformer();
         assertTrue( transformer.canTransformResource( GroovyResourceTransformer.EXT_MODULE_NAME ) );
@@ -103,6 +107,7 @@ public class GroovyResourceTransformerTest
         assertFalse( transformer.canTransformResource( JarFile.MANIFEST_NAME ) );
     }
 
+    @Test
     public void testEmpty()
         throws Exception
     {
@@ -111,6 +116,7 @@ public class GroovyResourceTransformerTest
         assertNull( transform( transformer ) );
     }
 
+    @Test
     public void testSpecifyModuleName()
         throws Exception
     {
@@ -127,6 +133,7 @@ public class GroovyResourceTransformerTest
         assertEquals( "some.staticExt", desc.getProperty( "staticExtensionClasses" ) );
     }
 
+    @Test
     public void testConcatenation()
         throws Exception
     {
diff --git a/src/test/java/org/apache/maven/plugins/shade/resource/XmlAppendingTransformerTest.java b/src/test/java/org/apache/maven/plugins/shade/resource/XmlAppendingTransformerTest.java
index e35be10..a7793c4 100644
--- a/src/test/java/org/apache/maven/plugins/shade/resource/XmlAppendingTransformerTest.java
+++ b/src/test/java/org/apache/maven/plugins/shade/resource/XmlAppendingTransformerTest.java
@@ -21,7 +21,11 @@ package org.apache.maven.plugins.shade.resource;
 
 import java.util.Locale;
 
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Test for {@link XmlAppendingTransformer}.
@@ -30,7 +34,6 @@ import junit.framework.TestCase;
  *
  */
 public class XmlAppendingTransformerTest
-    extends TestCase
 {
 
     private XmlAppendingTransformer transformer;
@@ -44,18 +47,20 @@ public class XmlAppendingTransformerTest
         Locale.setDefault( new Locale( "tr" ) );
     }
 
+    @Before
     public void setUp()
     {
-        this.transformer = new XmlAppendingTransformer();
+        transformer = new XmlAppendingTransformer();
     }
 
+    @Test
     public void testCanTransformResource()
     {
-        this.transformer.resource = "abcdefghijklmnopqrstuvwxyz";
+        transformer.resource = "abcdefghijklmnopqrstuvwxyz";
 
-        assertTrue( this.transformer.canTransformResource( "abcdefghijklmnopqrstuvwxyz" ) );
-        assertTrue( this.transformer.canTransformResource( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) );
-        assertFalse( this.transformer.canTransformResource( "META-INF/MANIFEST.MF" ) );
+        assertTrue( transformer.canTransformResource( "abcdefghijklmnopqrstuvwxyz" ) );
+        assertTrue( transformer.canTransformResource( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) );
+        assertFalse( transformer.canTransformResource( "META-INF/MANIFEST.MF" ) );
     }
 
 }