diff options
author | Brett Porter <brett@apache.org> | 2011-06-16 05:13:19 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2011-06-16 05:13:19 +0000 |
commit | af8d62f38f29fe7d058a6a09ad088af1dc96db4e (patch) | |
tree | f9db0745bf6968102d0d0f94214c7e3de0377995 /archiva-modules/archiva-base | |
parent | 08c60ff557f51c67a57464deab242ca994b529ab (diff) | |
download | archiva-af8d62f38f29fe7d058a6a09ad088af1dc96db4e.tar.gz archiva-af8d62f38f29fe7d058a6a09ad088af1dc96db4e.zip |
fix tests that are order-dependant
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1136289 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base')
2 files changed, 8 insertions, 12 deletions
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java index 3df886208..2c236a0c1 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java @@ -20,7 +20,6 @@ package org.apache.maven.archiva.proxy; */ import junit.framework.TestCase; -import net.sf.ehcache.CacheManager; import org.apache.commons.io.FileUtils; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; @@ -47,12 +46,12 @@ import org.springframework.context.ApplicationContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import java.io.File; +import java.io.IOException; import javax.inject.Inject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.IOException; /** * Integration test for connecting over a HTTP proxy. @@ -91,8 +90,11 @@ public class HttpProxyTransferTest proxyHandler = applicationContext.getBean( "repositoryProxyConnectors#test", RepositoryProxyConnectors.class ); - config = - (MockConfiguration) applicationContext.getBean( "archivaConfiguration#mock", ArchivaConfiguration.class ); + config = applicationContext.getBean( "archivaConfiguration#mock", ArchivaConfiguration.class ); + + // clear from previous tests - TODO the spring context should be initialised per test instead, or the config + // made a complete mock + config.getConfiguration().getProxyConnectors().clear(); // Setup source repository (using default layout) String repoPath = "target/test-repository/managed/" + getName(); diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MockConfiguration.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MockConfiguration.java index f116e14c5..9caaaf70e 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MockConfiguration.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MockConfiguration.java @@ -24,23 +24,18 @@ import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.ConfigurationListener; import org.apache.maven.archiva.configuration.FileType; import org.apache.maven.archiva.configuration.FileTypes; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.configuration.RepositoryScanningConfiguration; -import org.apache.maven.archiva.repository.ManagedRepositoryContent; import org.codehaus.plexus.registry.Registry; import org.codehaus.plexus.registry.RegistryException; import org.codehaus.plexus.registry.RegistryListener; import org.easymock.MockControl; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; -import javax.annotation.PostConstruct; -import javax.inject.Inject; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; +import javax.annotation.PostConstruct; /** * MockConfiguration @@ -51,7 +46,6 @@ import java.util.Set; * role-hint="mock" */ @Service( "archivaConfiguration#mock" ) -//Scope( "prototype" ) public class MockConfiguration implements ArchivaConfiguration { |