]> source.dussan.org Git - archiva.git/commitdiff
fix tests that are order-dependant
authorBrett Porter <brett@apache.org>
Thu, 16 Jun 2011 05:13:19 +0000 (05:13 +0000)
committerBrett Porter <brett@apache.org>
Thu, 16 Jun 2011 05:13:19 +0000 (05:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1136289 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MockConfiguration.java

index 3df886208ec262824e85e46b43fa84fea1f0e854..2c236a0c19da285f094cc59c99635d6d7d0013e9 100644 (file)
@@ -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();
index f116e14c5a196fd9cddfee3c3b74a8e9b5fb0cad..9caaaf70e0e4fef3d54c33498c70865f6d2809f0 100644 (file)
@@ -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
 {