From: Olivier Lamy Date: Fri, 29 Jun 2012 11:56:55 +0000 (+0000) Subject: get configuration directly from spring to see if that fix 1.7 issues X-Git-Tag: archiva-1.4-M3~580 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d7026bf9b4d9e7acfa090040c9db38fc99e3504b;p=archiva.git get configuration directly from spring to see if that fix 1.7 issues git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1355332 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ArchivaConfigurationTest.java b/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ArchivaConfigurationTest.java index 9692a143e..493c6528b 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ArchivaConfigurationTest.java +++ b/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/archiva/configuration/ArchivaConfigurationTest.java @@ -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 lookup( Class clazz, String hint ) { - return componentContainer.getComponent( clazz, hint ); + return (T) applicationContext.getBean( "archivaConfiguration#" + hint, ArchivaConfiguration.class ); } - protected T lookup( Class 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() );