* 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
@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;
import org.apache.maven.archiva.repository.layout.LayoutException;
import org.junit.Test;
+import static org.junit.Assert.*;
+
/**
* AbstractDefaultRepositoryContentTestCase
*
import org.apache.maven.archiva.repository.layout.LayoutException;
import org.junit.Test;
+import static org.junit.Assert.*;
+
/**
* AbstractLegacyRepositoryContentTestCase
*
import java.util.Collections;
+import static org.junit.Assert.*;
+
/**
* ArtifactExtensionMappingTest
*
import org.apache.maven.archiva.repository.layout.LayoutException;
import org.junit.Test;
+import static org.junit.Assert.*;
+
/**
* DefaultPathParserTest
*
import javax.inject.Inject;
import javax.inject.Named;
+import static org.junit.Assert.*;
+
/**
* 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" );
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
public void setUp()
throws Exception
{
- super.setUp();
-
File repoDir = new File( "src/test/repositories/default-repository" );
ManagedRepositoryConfiguration repository = createRepository( "testRepo", "Unit Test Repo", repoDir );
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
public void setUp()
throws Exception
{
- super.setUp();
-
File repoDir = new File( "src/test/repositories/legacy-repository" );
ManagedRepositoryConfiguration repository = createRepository( "testRepo", "Unit Test Repo", repoDir );
public void setUp()
throws Exception
{
- super.setUp();
-
RemoteRepositoryConfiguration repository = createRemoteRepository( "testRemoteRepo", "Unit Test Remote Repo",
"http://repo1.maven.org/maven2/" );
public void setUp()
throws Exception
{
- super.setUp();
-
RemoteRepositoryConfiguration repository =
createRemoteRepository( "testRemoteLegacyRepo", "Unit Test Remote Legacy Repo",
"http://repo1.maven.org/maven/" );
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
public void setUp()
throws Exception
{
- super.setUp();
-
LegacyPathParser legacyPathParser = new LegacyPathParser( archivaConfiguration );
repoRequest = new RepositoryRequest( legacyPathParser );
}
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
@Named( value = "archivaConfiguration#mock" )
protected MockConfiguration config;
-
@Test
public void testGatherSnapshotVersionsA()
throws Exception
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 );
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 );
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 );