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
This commit is contained in:
Olivier Lamy 2012-06-29 11:56:55 +00:00
parent 1999229d85
commit d7026bf9b4
1 changed files with 6 additions and 8 deletions

View 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() );