aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-repository-layer
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-07-02 07:36:23 +0000
committerOlivier Lamy <olamy@apache.org>2012-07-02 07:36:23 +0000
commit1484a3316addf47d88f4f05191ae4e570871eda7 (patch)
tree596b70b3f0975c00274bc3d2b2580092cc1390f5 /archiva-modules/archiva-base/archiva-repository-layer
parente3885c59da2e4748e2ba494f3901902be0470067 (diff)
downloadarchiva-1484a3316addf47d88f4f05191ae4e570871eda7.tar.gz
archiva-1484a3316addf47d88f4f05191ae4e570871eda7.zip
[MRM-1638] Improve unit test for archiva build
Based on patch provided by Eric Barboni. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1356091 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-repository-layer')
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/pom.xml7
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/AbstractRepositoryLayerTestCase.java4
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/RepositoryURLTest.java12
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/FilenameParserTest.java4
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/metadata/RepositoryMetadataReaderTest.java4
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/metadata/RepositoryMetadataWriterTest.java4
6 files changed, 23 insertions, 12 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/pom.xml b/archiva-modules/archiva-base/archiva-repository-layer/pom.xml
index b258f78b3..4005a4a9c 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/pom.xml
+++ b/archiva-modules/archiva-base/archiva-repository-layer/pom.xml
@@ -67,10 +67,11 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-testutil</artifactId>
+ <version>${project.version}</version>
<scope>test</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
<artifactId>metadata-model</artifactId>
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/AbstractRepositoryLayerTestCase.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/AbstractRepositoryLayerTestCase.java
index 5b192f3c4..9c436fdf3 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/AbstractRepositoryLayerTestCase.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/AbstractRepositoryLayerTestCase.java
@@ -28,17 +28,17 @@ 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 java.io.File;
import javax.inject.Inject;
+import org.apache.archiva.test.ArchivaSpringJUnit4ClassRunner;
/**
* AbstractRepositoryLayerTestCase
*
* @version $Id$
*/
-@RunWith( SpringJUnit4ClassRunner.class )
+@RunWith( ArchivaSpringJUnit4ClassRunner.class )
@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
public abstract class AbstractRepositoryLayerTestCase
{
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/RepositoryURLTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/RepositoryURLTest.java
index 83267d14c..f15cafce7 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/RepositoryURLTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/RepositoryURLTest.java
@@ -25,12 +25,16 @@ import org.apache.archiva.model.RepositoryURL;
import java.net.MalformedURLException;
import junit.framework.TestCase;
+import org.apache.archiva.test.ArchivaBlockJUnit4ClassRunner;
+import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* RepositoryURLTest
*
* @version $Id$
*/
+@RunWith( ArchivaBlockJUnit4ClassRunner.class )
public class RepositoryURLTest
extends TestCase
{
@@ -46,7 +50,8 @@ public class RepositoryURLTest
assertEquals( port, url.getPort() );
assertEquals( path, url.getPath() );
}
-
+
+ @Test
public void testProtocolHttp()
throws MalformedURLException
{
@@ -54,6 +59,7 @@ public class RepositoryURLTest
"/path/to/resource.txt" );
}
+ @Test
public void testProtocolWagonWebdav()
throws MalformedURLException
{
@@ -61,6 +67,7 @@ public class RepositoryURLTest
"/path/to/resource.txt" );
}
+ @Test
public void testProtocolHttpWithPort()
throws MalformedURLException
{
@@ -68,6 +75,7 @@ public class RepositoryURLTest
"/path/to/resource.txt" );
}
+ @Test
public void testProtocolHttpWithUsername()
throws MalformedURLException
{
@@ -75,6 +83,7 @@ public class RepositoryURLTest
"/path/to/resource.txt" );
}
+ @Test
public void testProtocolHttpWithUsernamePassword()
throws MalformedURLException
{
@@ -82,6 +91,7 @@ public class RepositoryURLTest
"/path/to/resource.txt" );
}
+ @Test
public void testProtocolHttpWithUsernamePasswordPort()
throws MalformedURLException
{
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/FilenameParserTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/FilenameParserTest.java
index 99e34acab..a2a36f8e9 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/FilenameParserTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/FilenameParserTest.java
@@ -20,16 +20,16 @@ package org.apache.archiva.repository.content;
*/
import junit.framework.TestCase;
+import org.apache.archiva.test.ArchivaBlockJUnit4ClassRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
/**
* FilenameParserTest
*
* @version $Id$
*/
-@RunWith( JUnit4.class )
+@RunWith( ArchivaBlockJUnit4ClassRunner.class )
public class FilenameParserTest
extends TestCase
{
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/metadata/RepositoryMetadataReaderTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/metadata/RepositoryMetadataReaderTest.java
index 8da14bd08..24cd88fc8 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/metadata/RepositoryMetadataReaderTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/metadata/RepositoryMetadataReaderTest.java
@@ -25,16 +25,16 @@ import org.apache.archiva.model.ArchivaRepositoryMetadata;
import org.apache.archiva.xml.XMLException;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
import java.io.File;
+import org.apache.archiva.test.ArchivaBlockJUnit4ClassRunner;
/**
* RepositoryMetadataReaderTest
*
* @version $Id$
*/
-@RunWith( JUnit4.class )
+@RunWith( ArchivaBlockJUnit4ClassRunner.class )
public class RepositoryMetadataReaderTest
extends TestCase
{
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/metadata/RepositoryMetadataWriterTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/metadata/RepositoryMetadataWriterTest.java
index 373c8de9b..43ed7988a 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/metadata/RepositoryMetadataWriterTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/metadata/RepositoryMetadataWriterTest.java
@@ -25,17 +25,17 @@ import org.apache.archiva.model.ArchivaRepositoryMetadata;
import org.custommonkey.xmlunit.XMLAssert;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
import java.io.File;
import java.io.StringWriter;
+import org.apache.archiva.test.ArchivaBlockJUnit4ClassRunner;
/**
* RepositoryMetadataWriterTest
*
* @version $Id$
*/
-@RunWith( JUnit4.class )
+@RunWith( ArchivaBlockJUnit4ClassRunner.class )
public class RepositoryMetadataWriterTest
extends TestCase
{