]> source.dussan.org Git - archiva.git/commitdiff
use JUnit 4 API
authorBrett Porter <brett@apache.org>
Thu, 16 Jun 2011 07:44:28 +0000 (07:44 +0000)
committerBrett Porter <brett@apache.org>
Thu, 16 Jun 2011 07:44:28 +0000 (07:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1136309 13f79535-47bb-0310-9956-ffa450edef68

12 files changed:
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractDefaultRepositoryContentTestCase.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMappingTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/DefaultPathParserTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContentTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContentTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContentTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java

index 7697905b7be32da76e35bcef88e8efb892cc246b..faa427564e2381999a200e130f5f71a00d3b9ab6 100644 (file)
@@ -19,16 +19,17 @@ package org.apache.maven.archiva.repository;
  * under the License.
  */
 
-import junit.framework.TestCase;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration;
+import org.junit.Rule;
+import org.junit.rules.TestName;
 import org.junit.runner.RunWith;
 import org.springframework.context.ApplicationContext;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
-import javax.inject.Inject;
 import java.io.File;
+import javax.inject.Inject;
 
 /**
  * AbstractRepositoryLayerTestCase
@@ -38,8 +39,9 @@ import java.io.File;
 @RunWith( SpringJUnit4ClassRunner.class )
 @ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
 public abstract class AbstractRepositoryLayerTestCase
-    extends TestCase
 {
+    @Rule
+    public TestName name = new TestName();
 
     @Inject
     protected ApplicationContext applicationContext;
index b9534f36f9010e651d3dbd31419aed6629b31bef..d430a61dfd60bb45728a313a1e66f85a9781314d 100644 (file)
@@ -25,6 +25,8 @@ import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase;
 import org.apache.maven.archiva.repository.layout.LayoutException;
 import org.junit.Test;
 
+import static org.junit.Assert.*;
+
 /**
  * DefaultPathParserTest
  *
index e09805f0e125d931935f7cf52431f44d993e1bcf..a62ff756fd5c2d3067a703f07cc8f517eb69b2e8 100644 (file)
@@ -31,6 +31,8 @@ import org.junit.Test;
 import javax.inject.Inject;
 import javax.inject.Named;
 
+import static org.junit.Assert.*;
+
 /**
  * LegacyPathParserTest
  *
@@ -53,8 +55,6 @@ public class LegacyPathParserTest
     public void setUp()
         throws Exception
     {
-        super.setUp();
-
         parser = new LegacyPathParser( config );
         LegacyArtifactPath jaxen = new LegacyArtifactPath();
         jaxen.setPath( "jaxen/jars/jaxen-1.0-FCS-full.jar" );
index 671bc8aecf404ec42d070deebfd2c79f600d28ff..0198271e9d79e0c3553a2abd779313d0025558e0 100644 (file)
@@ -32,14 +32,16 @@ import org.apache.maven.archiva.repository.layout.LayoutException;
 import org.junit.Before;
 import org.junit.Test;
 
-import javax.inject.Inject;
-import javax.inject.Named;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import static org.junit.Assert.*;
 
 /**
  * ManagedDefaultRepositoryContentTest
@@ -63,8 +65,6 @@ public class ManagedDefaultRepositoryContentTest
     public void setUp()
         throws Exception
     {
-        super.setUp();
-
         File repoDir = new File( "src/test/repositories/default-repository" );
 
         ManagedRepositoryConfiguration repository = createRepository( "testRepo", "Unit Test Repo", repoDir );
index 3884429370bb1234d61613ad48dd3233365d1953..833902f628427beda3b281abaf138d17398d7c13 100644 (file)
@@ -29,13 +29,15 @@ import org.apache.maven.archiva.repository.layout.LayoutException;
 import org.junit.Before;
 import org.junit.Test;
 
-import javax.inject.Inject;
-import javax.inject.Named;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import static org.junit.Assert.*;
 
 /**
  * ManagedLegacyRepositoryContentTest
@@ -53,8 +55,6 @@ public class ManagedLegacyRepositoryContentTest
     public void setUp()
         throws Exception
     {
-        super.setUp();
-
         File repoDir = new File( "src/test/repositories/legacy-repository" );
 
         ManagedRepositoryConfiguration repository = createRepository( "testRepo", "Unit Test Repo", repoDir );
index ddc1f22e7f9bb25520e3bd8c748a101edd6dda69..938dd5c5c28e6111cb89e4903b583bd1611f9ce1 100644 (file)
@@ -43,8 +43,6 @@ public class RemoteDefaultRepositoryContentTest
     public void setUp()
         throws Exception
     {
-        super.setUp();
-
         RemoteRepositoryConfiguration repository = createRemoteRepository( "testRemoteRepo", "Unit Test Remote Repo",
                                                                            "http://repo1.maven.org/maven2/" );
 
index d3aa0f13abca31497608326b9860b865df679084..b0bb6e6a9e10280f0b4dcfd28ad7ffe8803e75eb 100644 (file)
@@ -44,8 +44,6 @@ public class RemoteLegacyRepositoryContentTest
     public void setUp()
         throws Exception
     {
-        super.setUp();
-
         RemoteRepositoryConfiguration repository =
             createRemoteRepository( "testRemoteLegacyRepo", "Unit Test Remote Legacy Repo",
                                     "http://repo1.maven.org/maven/" );
index 5ac2583ea7cb79eff24d97b5e78fa2c090ca71ba..6305cf1b633a3147e5efd0b951b63b194a0aebb1 100644 (file)
@@ -30,9 +30,11 @@ import org.junit.Before;
 import org.junit.Test;
 import org.springframework.test.context.ContextConfiguration;
 
+import java.io.File;
 import javax.inject.Inject;
 import javax.inject.Named;
-import java.io.File;
+
+import static org.junit.Assert.*;
 
 /**
  * RepositoryRequestTest
@@ -55,8 +57,6 @@ public class RepositoryRequestTest
     public void setUp()
         throws Exception
     {
-        super.setUp();
-
         LegacyPathParser legacyPathParser = new LegacyPathParser( archivaConfiguration );
         repoRequest = new RepositoryRequest( legacyPathParser );
     }
index f1a34254640ca40599ced4a04b81c72c1bb98160..ccc340ca8bb88bd115eb08f7a30215322454a6ac 100644 (file)
@@ -41,15 +41,17 @@ import org.junit.Test;
 import org.springframework.test.context.ContextConfiguration;
 import org.xml.sax.SAXException;
 
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.xml.parsers.ParserConfigurationException;
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.xml.parsers.ParserConfigurationException;
+
+import static org.junit.Assert.*;
 
 /**
  * MetadataToolsTest
@@ -67,7 +69,6 @@ public class MetadataToolsTest
     @Named( value = "archivaConfiguration#mock" )
     protected MockConfiguration config;
 
-
     @Test
     public void testGatherSnapshotVersionsA()
         throws Exception
@@ -355,7 +356,7 @@ public class MetadataToolsTest
         reference.setVersion( version );
 
         ManagedRepositoryConfiguration repo =
-            createRepository( "test-repo", "Test Repository: " + getName(), repoRootDir );
+            createRepository( "test-repo", "Test Repository: " + name.getMethodName(), repoRootDir );
         ManagedRepositoryContent repoContent =
             applicationContext.getBean( "managedRepositoryContent#default", ManagedRepositoryContent.class );
         repoContent.setRepository( repo );
@@ -574,7 +575,7 @@ public class MetadataToolsTest
     private ManagedRepositoryContent createTestRepoContent()
         throws Exception
     {
-        File repoRoot = new File( "target/metadata-tests/" + getName() );
+        File repoRoot = new File( "target/metadata-tests/" + name.getMethodName() );
         if ( repoRoot.exists() )
         {
             FileUtils.deleteDirectory( repoRoot );
@@ -583,7 +584,7 @@ public class MetadataToolsTest
         repoRoot.mkdirs();
 
         ManagedRepositoryConfiguration repoConfig =
-            createRepository( "test-repo", "Test Repository: " + getName(), repoRoot );
+            createRepository( "test-repo", "Test Repository: " + name.getMethodName(), repoRoot );
 
         ManagedRepositoryContent repoContent =
             applicationContext.getBean( "managedRepositoryContent#default", ManagedRepositoryContent.class );