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;
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;
private Logger log = LoggerFactory.getLogger( getClass() );
@Inject
- private ComponentContainer componentContainer;
+ protected ApplicationContext applicationContext;
+
+ @Inject
+ FileTypes filetypes;
public static File getTestFile( String path )
{
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()
int proxyConnectorExpected )
throws Exception
{
- FileTypes filetypes = lookup( FileTypes.class );
assertEquals( "check managed repositories: " + configuration.getManagedRepositories(), managedExpected,
configuration.getManagedRepositories().size() );