fix unit paths so you can run unit on path with space

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1370597 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
skygo 2012-08-08 00:00:07 +00:00
parent 3a3f22c39b
commit fd6b9b7e93
2 changed files with 11 additions and 8 deletions

View File

@ -143,7 +143,7 @@ public abstract class AbstractRepositoryPurgeTest
} }
} }
private static String fixPath( String path ) protected static String fixPath( String path )
{ {
if ( path.contains( " " ) ) if ( path.contains( " " ) )
{ {
@ -202,15 +202,18 @@ public abstract class AbstractRepositoryPurgeTest
throws Exception throws Exception
{ {
removeMavenIndexes(); removeMavenIndexes();
File testDir = getTestRepoRoot();// AbstractRepositoryPurgeTest.fixPath( getTestRepoRoot() ); File testDir = new File( AbstractRepositoryPurgeTest.fixPath( getTestRepoRoot().getAbsolutePath() ) ) ;// AbstractRepositoryPurgeTest.fixPath( getTestRepoRoot() );
FileUtils.deleteDirectory( testDir ); FileUtils.deleteDirectory( testDir );
FileUtils.copyDirectory( new File( "target/test-classes/" + TEST_REPO_ID ), testDir ); File sourceDir = new File ( new File( "target/test-classes/" + TEST_REPO_ID).getAbsolutePath() );
FileUtils.copyDirectory( sourceDir, testDir );
File releasesTestDir = new File( AbstractRepositoryPurgeTest.fixPath( new File( "target/test-" + getName() + "/" + RELEASES_TEST_REPO_ID ).getAbsolutePath() ) );
File releasesTestDir = new File( "target/test-" + getName() + "/" + RELEASES_TEST_REPO_ID );
FileUtils.deleteDirectory( releasesTestDir ); FileUtils.deleteDirectory( releasesTestDir );
FileUtils.copyDirectory( new File( "target/test-classes/" + RELEASES_TEST_REPO_ID ), releasesTestDir ); File sourceReleasesDir = new File ( new File( "target/test-classes/" + RELEASES_TEST_REPO_ID).getAbsolutePath() );
FileUtils.copyDirectory( sourceReleasesDir, releasesTestDir );
return testDir.getAbsolutePath(); return AbstractRepositoryPurgeTest.fixPath( testDir.getAbsolutePath() );
} }
@Override @Override

View File

@ -212,8 +212,8 @@ public class CleanupReleasedSnapshotsRepositoryPurgeTest
assertDeleted( projectRoot + "/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.pom.sha1" ); assertDeleted( projectRoot + "/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.pom.sha1" );
String releasesProjectRoot = String releasesProjectRoot =
new File( "target/test-" + getName() + "/releases-test-repo-one" ).getAbsolutePath() AbstractRepositoryPurgeTest.fixPath( new File( "target/test-" + getName() + "/releases-test-repo-one" ).getAbsolutePath()
+ "/org/apache/archiva/released-artifact-in-diff-repo"; + "/org/apache/archiva/released-artifact-in-diff-repo" );
// check if the released version was not removed // check if the released version was not removed
assertExists( releasesProjectRoot + "/1.0" ); assertExists( releasesProjectRoot + "/1.0" );