diff options
author | Olivier Lamy <olamy@apache.org> | 2012-07-02 07:36:23 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-07-02 07:36:23 +0000 |
commit | 1484a3316addf47d88f4f05191ae4e570871eda7 (patch) | |
tree | 596b70b3f0975c00274bc3d2b2580092cc1390f5 /archiva-modules/archiva-base/archiva-model | |
parent | e3885c59da2e4748e2ba494f3901902be0470067 (diff) | |
download | archiva-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-model')
-rwxr-xr-x | archiva-modules/archiva-base/archiva-model/pom.xml | 5 | ||||
-rw-r--r-- | archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/archiva/model/RepositoryURLTest.java | 12 |
2 files changed, 15 insertions, 2 deletions
diff --git a/archiva-modules/archiva-base/archiva-model/pom.xml b/archiva-modules/archiva-base/archiva-model/pom.xml index bc28daf6e..c008802f4 100755 --- a/archiva-modules/archiva-base/archiva-model/pom.xml +++ b/archiva-modules/archiva-base/archiva-model/pom.xml @@ -42,8 +42,9 @@ <artifactId>archiva-common</artifactId> </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> diff --git a/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/archiva/model/RepositoryURLTest.java b/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/archiva/model/RepositoryURLTest.java index e239a178b..6ed556c2e 100644 --- a/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/archiva/model/RepositoryURLTest.java +++ b/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/archiva/model/RepositoryURLTest.java @@ -20,12 +20,16 @@ package org.apache.archiva.model; */ 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 { @@ -49,43 +53,51 @@ public class RepositoryURLTest assertEquals( "Password", expectedPassword, rurl.getPassword() ); } + @Test public void testFileUrlNormal() { assertURL( "file:///home/joakim/code/test/this/", "file", NO_HOST, NO_PORT, "/home/joakim/code/test/this/", NO_USER, NO_PASS ); } + @Test public void testFileUrlShort() { assertURL( "file:/home/joakim/code/test/this/", "file", NO_HOST, NO_PORT, "/home/joakim/code/test/this/", NO_USER, NO_PASS ); } + @Test public void testHttpUrlPathless() { assertURL( "http://machine", "http", "machine", NO_PORT, "/", NO_USER, NO_PASS ); } + @Test public void testHttpUrlWithPort() { assertURL( "http://machine:8080/", "http", "machine", "8080", "/", NO_USER, NO_PASS ); } + @Test public void testHttpUrlWithUsernamePassword() { assertURL( "http://user:pass@machine/secured/", "http", "machine", NO_PORT, "/secured/", "user", "pass" ); } + @Test public void testHttpUrlWithUsernameNoPassword() { assertURL( "http://user@machine/secured/", "http", "machine", NO_PORT, "/secured/", "user", NO_PASS ); } + @Test public void testHttpUrlWithUsernamePasswordAndPort() { assertURL( "http://user:pass@machine:9090/secured/", "http", "machine", "9090", "/secured/", "user", "pass" ); } + @Test public void testBogusWithPath() { // This should not fail. The intent of RepositoryURL is to have it support oddball protocols that |