diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletTestCase.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletTestCase.java index b3318286f..2c42b67e2 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletTestCase.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletTestCase.java @@ -100,25 +100,24 @@ public abstract class AbstractRepositoryServletTestCase } FileUtils.copyFile( testConf, testConfDest ); - archivaConfiguration = applicationContext.getBean( ArchivaConfiguration.class ); - //archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class ); repoRootInternal = new File( appserverBase, "data/repositories/internal" ); repoRootLegacy = new File( appserverBase, "data/repositories/legacy" ); Configuration config = archivaConfiguration.getConfiguration(); - if ( !config.getManagedRepositoriesAsMap().containsKey( REPOID_INTERNAL ) ) - { - config.addManagedRepository( - createManagedRepository( REPOID_INTERNAL, "Internal Test Repo", repoRootInternal, true ) ); - } - if ( !config.getManagedRepositoriesAsMap().containsKey( REPOID_LEGACY ) ) - { - config.addManagedRepository( - createManagedRepository( REPOID_LEGACY, "Legacy Format Test Repo", repoRootLegacy, "legacy", true ) ); - } + config.getManagedRepositories().clear(); + + config.addManagedRepository( + createManagedRepository( REPOID_INTERNAL, "Internal Test Repo", repoRootInternal, true ) ); + + config.addManagedRepository( + createManagedRepository( REPOID_LEGACY, "Legacy Format Test Repo", repoRootLegacy, "legacy", true ) ); + + config.getProxyConnectors().clear(); + + config.getRemoteRepositories().clear(); saveConfiguration( archivaConfiguration ); @@ -161,7 +160,6 @@ public abstract class AbstractRepositoryServletTestCase } - protected void assertFileContents( String expectedContents, File repoRoot, String path ) throws IOException { diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletBrowseTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletBrowseTest.java index 9d2344d34..f8fb52504 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletBrowseTest.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletBrowseTest.java @@ -86,19 +86,19 @@ public class RepositoryServletBrowseTest WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/org/apache/archiva/artifactId" ); WebResponse response = sc.getResponse( request ); - assertEquals( "Response", HttpServletResponse.SC_OK, response.getResponseCode() ); + assertEquals( "1st Response", HttpServletResponse.SC_OK, response.getResponseCode() ); request = new GetMethodWebRequest( "http://machine.com/repository/internal/org/apache/archiva/artifactId/" ); response = sc.getResponse( request ); - assertEquals( "Response", HttpServletResponse.SC_OK, response.getResponseCode() ); + assertEquals( "2nd Response", HttpServletResponse.SC_OK, response.getResponseCode() ); request = new GetMethodWebRequest( "http://machine.com/repository/internal/org/apache/archiva/artifactId/1.0/artifactId-1.0.jar" ); response = sc.getResponse( request ); - assertEquals( "Response", HttpServletResponse.SC_OK, response.getResponseCode() ); + assertEquals( "3rd Response", HttpServletResponse.SC_OK, response.getResponseCode() ); request = new GetMethodWebRequest( "http://machine.com/repository/internal/org/apache/archiva/artifactId/1.0/artifactId-1.0.jar/" ); response = sc.getResponse( request ); - assertEquals( "Response", HttpServletResponse.SC_NOT_FOUND, response.getResponseCode() ); + assertEquals( "4th Response", HttpServletResponse.SC_NOT_FOUND, response.getResponseCode() ); }