Browse Source

attempt to stabilie core consummer tests

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1370562 13f79535-47bb-0310-9956-ffa450edef68
tags/archiva-1.4-M3
skygo 11 years ago
parent
commit
8be9f7b746

+ 16
- 2
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java View File

@@ -43,6 +43,7 @@ import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.slf4j.LoggerFactory;

/**
*/
@@ -142,13 +143,26 @@ public abstract class AbstractRepositoryPurgeTest
}
}

private static String fixPath( String path )
{
if ( path.contains( " " ) )
{
LoggerFactory.getLogger(AbstractRepositoryPurgeTest.class.getName()).error(
"You are building and testing with a path: \n "
+ path + " containing space. Consider relocating.");
return path.replaceAll(" ", "%20");
}
return path;
}
public ManagedRepository getRepoConfiguration( String repoId, String repoName )
{
config = new ManagedRepository();
config.setId( repoId );
config.setName( repoName );
config.setDaysOlder( TEST_DAYS_OLDER );
config.setLocation( new File( "target/test-" + getName() + "/" + repoId ).getAbsolutePath() );
String path = AbstractRepositoryPurgeTest.fixPath( new File( "target/test-" + getName() + "/" + repoId ).getAbsolutePath() );
config.setLocation( path );
config.setReleases( true );
config.setSnapshots( true );
config.setDeleteReleasedSnapshots( true );
@@ -188,7 +202,7 @@ public abstract class AbstractRepositoryPurgeTest
throws Exception
{
removeMavenIndexes();
File testDir = getTestRepoRoot();
File testDir = getTestRepoRoot();// AbstractRepositoryPurgeTest.fixPath( getTestRepoRoot() );
FileUtils.deleteDirectory( testDir );
FileUtils.copyDirectory( new File( "target/test-classes/" + TEST_REPO_ID ), testDir );


Loading…
Cancel
Save