}
- protected void createAndIndexRepo( String testRepoId, Path srcRepoPath, boolean stageNeeded )
+ protected void createAndIndexRepo( String testRepoId, Path srcRepoPath, Path stagedSrcRepoPath, boolean stageNeeded )
throws ArchivaRestServiceException, IOException, RedbackServiceException
{
if ( getManagedRepositoriesService( authorizationHeader ).getManagedRepository( testRepoId ) != null )
}
Path repoPath = getAppserverBase().resolve( "data" ).resolve( "repositories" ).resolve( testRepoId);
+ Path stagedRepoPath = getAppserverBase().resolve( "data" ).resolve( "repositories" ).resolve( testRepoId + "-stage");
FileUtils.deleteQuietly(repoPath.toFile());
FileUtils.copyDirectory(srcRepoPath.toFile(), repoPath.toFile());
+ if (stagedSrcRepoPath!=null) {
+ FileUtils.deleteQuietly(stagedRepoPath.toFile());
+ FileUtils.copyDirectory(stagedSrcRepoPath.toFile(), stagedRepoPath.toFile());
+
+ }
+
managedRepository.setLocation( repoPath.toAbsolutePath().toString() );
String suffix = Long.toString( new Date().getTime() );
Path baseDir = Files.createTempDirectory( "archiva-test-index" ).toAbsolutePath();
protected void createAndIndexRepo( String testRepoId, Path srcRepoPath )
throws Exception
{
- createAndIndexRepo( testRepoId, srcRepoPath, false );
+ createAndIndexRepo( testRepoId, srcRepoPath, null, false );
scanRepo( testRepoId );
}
- protected void createStagedNeededRepo( String testRepoId, Path srcRepoPath, boolean scan )
+ protected void createStagedNeededRepo( String testRepoId, Path srcRepoPath, Path stagedSrcRepoPath, boolean scan )
throws Exception
{
- createAndIndexRepo( testRepoId, srcRepoPath, true );
+ createAndIndexRepo( testRepoId, srcRepoPath, stagedSrcRepoPath, true );
if ( scan )
{
scanRepo( testRepoId );
// FileUtils.copyDirectory( Paths.get( System.getProperty( "basedir" ), "src/test/repo-with-osgi" ).toFile(), repo.toFile() );
Path srcRepo = getProjectDirectory().resolve( "src/test/repo-with-osgi" );
- createStagedNeededRepo( TEST_REPOSITORY, srcRepo , true );
- FileUtils.copyDirectory( getProjectDirectory().resolve("src/test/repo-with-osgi-stage" ).toFile(),
- repoStage.toFile() );
+ createStagedNeededRepo( TEST_REPOSITORY, srcRepo , getProjectDirectory().resolve("src/test/repo-with-osgi-stage" ), true );
+
}
}