fix MetadataTransferTest units

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1128784 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-05-28 22:15:13 +00:00
parent 67af3bcb6a
commit cc963c71da
2 changed files with 11 additions and 3 deletions

View File

@ -40,6 +40,8 @@ import org.easymock.ArgumentsMatcher;
import org.easymock.MockControl; import org.easymock.MockControl;
import org.junit.Before; import org.junit.Before;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ -120,6 +122,8 @@ public abstract class AbstractProxyTestCase
protected MockConfiguration config; protected MockConfiguration config;
protected Logger log = LoggerFactory.getLogger( getClass() );
WagonDelegate delegate; WagonDelegate delegate;
@Inject @Inject
@ -187,7 +191,7 @@ public abstract class AbstractProxyTestCase
delegate.setDelegate( wagonMock ); delegate.setDelegate( wagonMock );
System.out.println( "\n.\\ " + getName() + "() \\._________________________________________\n" ); log.info( "\n.\\ " + getName() + "() \\._________________________________________\n" );
} }
@Override @Override

View File

@ -41,6 +41,7 @@ import org.custommonkey.xmlunit.Diff;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import javax.inject.Inject;
import java.io.File; import java.io.File;
import java.io.StringWriter; import java.io.StringWriter;
import java.util.ArrayList; import java.util.ArrayList;
@ -95,14 +96,15 @@ public class MetadataTransferTest
extends AbstractProxyTestCase extends AbstractProxyTestCase
{ {
@Inject
private MetadataTools metadataTools; private MetadataTools metadataTools;
@Before @Before
public void init() public void init()
throws Exception throws Exception
{ {
super.setUp(); //super.setUp();
metadataTools = applicationContext.getBean( MetadataTools.class ); //metadataTools = applicationContext.getBean( MetadataTools.class );
} }
@Test @Test
@ -187,6 +189,8 @@ public class MetadataTransferTest
String requestedResource = "org/apache/maven/test/get-default-metadata-nonexistant/maven-metadata.xml"; String requestedResource = "org/apache/maven/test/get-default-metadata-nonexistant/maven-metadata.xml";
setupTestableManagedRepository( requestedResource ); setupTestableManagedRepository( requestedResource );
config.getConfiguration().setProxyConnectors( new ArrayList<ProxyConnectorConfiguration>( ) );
assertResourceNotFound( requestedResource ); assertResourceNotFound( requestedResource );
// No proxy setup, nothing fetched, failure expected. // No proxy setup, nothing fetched, failure expected.