]> source.dussan.org Git - archiva.git/commitdiff
get configuration directly from spring to see if that fix 1.7 issues
authorOlivier Lamy <olamy@apache.org>
Fri, 29 Jun 2012 11:56:55 +0000 (11:56 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 29 Jun 2012 11:56:55 +0000 (11:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1355332 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ArchivaConfigurationTest.java

index 9692a143e7a8a0e2a0706ce561ec0fb8b880d955..493c6528b890fc7f79dff645e866338aa8f75236 100644 (file)
@@ -22,7 +22,6 @@ package org.apache.archiva.configuration;
 import junit.framework.TestCase;
 import org.apache.archiva.common.utils.FileUtil;
 import org.apache.archiva.redback.components.registry.RegistryException;
-import org.apache.archiva.redback.components.springutils.ComponentContainer;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
 import org.custommonkey.xmlunit.XMLAssert;
@@ -31,6 +30,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.context.ApplicationContext;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
@@ -51,7 +51,10 @@ public class ArchivaConfigurationTest
     private Logger log = LoggerFactory.getLogger( getClass() );
 
     @Inject
-    private ComponentContainer componentContainer;
+    protected ApplicationContext applicationContext;
+
+    @Inject
+    FileTypes filetypes;
 
     public static File getTestFile( String path )
     {
@@ -60,13 +63,9 @@ public class ArchivaConfigurationTest
 
     protected <T> T lookup( Class<T> clazz, String hint )
     {
-        return componentContainer.getComponent( clazz, hint );
+        return (T) applicationContext.getBean( "archivaConfiguration#" + hint, ArchivaConfiguration.class );
     }
 
-    protected <T> T lookup( Class<T> clazz )
-    {
-        return componentContainer.getComponent( clazz );
-    }
 
     @Test
     public void testGetConfigurationFromRegistryWithASingleNamedConfigurationResource()
@@ -151,7 +150,6 @@ public class ArchivaConfigurationTest
                                       int proxyConnectorExpected )
         throws Exception
     {
-        FileTypes filetypes = lookup( FileTypes.class );
 
         assertEquals( "check managed repositories: " + configuration.getManagedRepositories(), managedExpected,
                       configuration.getManagedRepositories().size() );