summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-repository-layer/src
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2011-06-16 07:44:28 +0000
committerBrett Porter <brett@apache.org>2011-06-16 07:44:28 +0000
commitca05dcc62cb2bfbbe5947b2b7ed8fe8f213c451e (patch)
tree181891885a84fc59612531ad85ca296f48236f3d /archiva-modules/archiva-base/archiva-repository-layer/src
parent9b41c218387028762de53ec98705e55b67525089 (diff)
downloadarchiva-ca05dcc62cb2bfbbe5947b2b7ed8fe8f213c451e.tar.gz
archiva-ca05dcc62cb2bfbbe5947b2b7ed8fe8f213c451e.zip
use JUnit 4 API
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1136309 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-repository-layer/src')
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java8
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractDefaultRepositoryContentTestCase.java2
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java2
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMappingTest.java2
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/DefaultPathParserTest.java2
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java4
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContentTest.java8
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java8
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContentTest.java2
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContentTest.java2
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java6
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java15
12 files changed, 34 insertions, 27 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java
index 7697905b7..faa427564 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java
@@ -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;
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractDefaultRepositoryContentTestCase.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractDefaultRepositoryContentTestCase.java
index a1434ae26..c63f77c07 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractDefaultRepositoryContentTestCase.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractDefaultRepositoryContentTestCase.java
@@ -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.*;
+
/**
* AbstractDefaultRepositoryContentTestCase
*
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java
index 83f3f9344..3526d9e6e 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java
@@ -24,6 +24,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.*;
+
/**
* AbstractLegacyRepositoryContentTestCase
*
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMappingTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMappingTest.java
index 13355032a..9cfb9032a 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMappingTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMappingTest.java
@@ -29,6 +29,8 @@ import org.junit.Test;
import java.util.Collections;
+import static org.junit.Assert.*;
+
/**
* ArtifactExtensionMappingTest
*
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/DefaultPathParserTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/DefaultPathParserTest.java
index b9534f36f..d430a61df 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/DefaultPathParserTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/DefaultPathParserTest.java
@@ -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
*
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java
index e09805f0e..a62ff756f 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java
@@ -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" );
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContentTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContentTest.java
index 671bc8aec..0198271e9 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContentTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContentTest.java
@@ -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 );
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java
index 388442937..833902f62 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java
@@ -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 );
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContentTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContentTest.java
index ddc1f22e7..938dd5c5c 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContentTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContentTest.java
@@ -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/" );
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContentTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContentTest.java
index d3aa0f13a..b0bb6e6a9 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContentTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContentTest.java
@@ -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/" );
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java
index 5ac2583ea..6305cf1b6 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java
@@ -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 );
}
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java
index f1a342546..ccc340ca8 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java
@@ -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 );