From: Olivier Lamy Date: Mon, 2 Apr 2012 21:02:29 +0000 (+0000) Subject: fix junit as now non absolute path is replace with appserver.base as parent X-Git-Tag: archiva-1.4-M3~857 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=741723f05a62a987d51b97e58b63ef8c71902124;p=archiva.git fix junit as now non absolute path is replace with appserver.base as parent git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1308562 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml index 5ce485e84..346c3cb86 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml @@ -352,6 +352,7 @@ ${test.useTomcat} ${redbackTestJdbcUrl} ${redbackTestJdbcDriver} + ${basedir} diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java index d8b3df876..689316efc 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java @@ -407,4 +407,9 @@ public abstract class AbstractArchivaRestTest } } + + public String getBasedir() + { + return System.getProperty( "basedir" ); + } } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java index 241646118..cc1bedefe 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/BrowseServiceTest.java @@ -27,6 +27,7 @@ import org.apache.archiva.rest.api.services.BrowseService; import org.fest.assertions.MapAssert; import org.junit.Test; +import java.io.File; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -64,7 +65,7 @@ public class BrowseServiceTest assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); } - createAndIndexRepo( testRepoId, "src/test/repo-with-osgi" ); + createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath() ); BrowseService browseService = getBrowseService( authorizationHeader, false ); @@ -96,7 +97,7 @@ public class BrowseServiceTest assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); } - createAndIndexRepo( testRepoId, "src/test/repo-with-osgi" ); + createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath() ); BrowseService browseService = getBrowseService( authorizationHeader, false ); @@ -133,7 +134,7 @@ public class BrowseServiceTest assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); } - createAndIndexRepo( testRepoId, "src/test/repo-with-osgi", false ); + createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath(), false ); BrowseService browseService = getBrowseService( authorizationHeader, false ); @@ -159,7 +160,7 @@ public class BrowseServiceTest assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); } - createAndIndexRepo( testRepoId, "src/test/repo-with-osgi", false ); + createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath(), false ); BrowseService browseService = getBrowseService( authorizationHeader, false ); @@ -185,7 +186,7 @@ public class BrowseServiceTest assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); } - createAndIndexRepo( testRepoId, "src/test/repo-with-osgi", false ); + createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath(), false ); BrowseService browseService = getBrowseService( authorizationHeader, false ); @@ -209,7 +210,7 @@ public class BrowseServiceTest assertNotNull( getUserService( authorizationHeader ).createGuestUser() ); } - createAndIndexRepo( testRepoId, "src/test/repo-with-osgi", false ); + createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath(), false ); BrowseService browseService = getBrowseService( authorizationHeader, true );