summaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2015-02-12 23:21:00 +1100
committerOlivier Lamy <olamy@apache.org>2015-02-12 23:21:00 +1100
commit5b97adf5051fb7d25dda9c22b019c2905a00820e (patch)
tree54ccb1740865ba52fa21ade8cd2753de794f62a2 /archiva-modules
parent97a44a58206fba150b001b04001d88cad71ac8b1 (diff)
downloadarchiva-5b97adf5051fb7d25dda9c22b019c2905a00820e.tar.gz
archiva-5b97adf5051fb7d25dda9c22b019c2905a00820e.zip
[MRM-1359] remove maven1 code
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java23
1 files changed, 14 insertions, 9 deletions
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java
index 98a8dd54d..08226d2e8 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/AbstractProxyTestCase.java
@@ -70,8 +70,8 @@ import static org.junit.Assert.*;
/**
* AbstractProxyTestCase
*/
-@RunWith ( ArchivaSpringJUnit4ClassRunner.class )
-@ContextConfiguration ( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
+@RunWith( ArchivaSpringJUnit4ClassRunner.class )
+@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
public abstract class AbstractProxyTestCase
{
@Inject
@@ -136,7 +136,6 @@ public abstract class AbstractProxyTestCase
// Setup source repository (using default layout)
String name = getClass().getSimpleName();
String repoPath = "target/test-repository/managed/" + name;
- File repoLocation = new File( repoPath );
managedDefaultRepository =
createRepository( ID_DEFAULT_MANAGED, "Default Managed Repository", repoPath, "default" );
@@ -153,7 +152,14 @@ public abstract class AbstractProxyTestCase
// to prevent windauze file leaking
removeMavenIndexes();
- applicationContext.getBean( ManagedRepositoryAdmin.class ).addManagedRepository( repoConfig, false, null );
+ ManagedRepositoryAdmin managedRepositoryAdmin = applicationContext.getBean( ManagedRepositoryAdmin.class );
+
+ if ( managedRepositoryAdmin.getManagedRepository( repoConfig.getId() ) != null )
+ {
+ managedRepositoryAdmin.deleteManagedRepository( repoConfig.getId(), null, true );
+ }
+
+ managedRepositoryAdmin.addManagedRepository( repoConfig, false, null );
// Setup target (proxied to) repository.
saveRemoteRepositoryConfig( ID_PROXIED1, "Proxied Repository 1",
@@ -169,7 +175,7 @@ public abstract class AbstractProxyTestCase
proxyHandler = applicationContext.getBean( "repositoryProxyConnectors#test", RepositoryProxyConnectors.class );
// Setup the wagon mock.
- wagonMockControl = EasyMock.createNiceControl( );
+ wagonMockControl = EasyMock.createNiceControl();
wagonMock = wagonMockControl.createMock( Wagon.class );
delegate = (WagonDelegate) applicationContext.getBean( "wagon#test", Wagon.class );
@@ -306,7 +312,7 @@ public abstract class AbstractProxyTestCase
assertNull( "Found file: " + downloadedFile + "; but was expecting a failure", downloadedFile );
}
- @SuppressWarnings ( "unchecked" )
+ @SuppressWarnings( "unchecked" )
protected void assertNoTempFiles( File expectedFile )
{
File workingDir = expectedFile.getParentFile();
@@ -575,8 +581,8 @@ public abstract class AbstractProxyTestCase
if ( !sourceDir.exists() )
{
// This is just a warning.
- System.err.println(
- "[WARN] Skipping setup of testable managed repository, source dir does not exist: " + sourceDir );
+ log.error( "[WARN] Skipping setup of testable managed repository, source dir does not exist: {}", //
+ sourceDir );
}
else
{
@@ -630,7 +636,6 @@ public abstract class AbstractProxyTestCase
}
-
protected void assertNotExistsInManagedDefaultRepo( File file )
throws Exception
{