diff options
author | Martin Stockhammer <martin_s@apache.org> | 2018-03-30 19:35:16 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2018-03-30 19:35:16 +0200 |
commit | c424149d1cd77dc39b4a87388afabab44fce69f4 (patch) | |
tree | 3ff157dacfb1f94a4d4cc56ebd488894af30b0e5 /archiva-modules/archiva-web/archiva-web-common/src | |
parent | 8cb4ef0aeae7b5abb94e1d0f932531424d66a90b (diff) | |
download | archiva-c424149d1cd77dc39b4a87388afabab44fce69f4.tar.gz archiva-c424149d1cd77dc39b4a87388afabab44fce69f4.zip |
Updating index merge to new maven api
Diffstat (limited to 'archiva-modules/archiva-web/archiva-web-common/src')
-rw-r--r-- | archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexNonDefaultPathTest.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexNonDefaultPathTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexNonDefaultPathTest.java index 95f56ab1d..d2c569c95 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexNonDefaultPathTest.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadMergedIndexNonDefaultPathTest.java @@ -22,6 +22,7 @@ import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.admin.model.beans.ProxyConnector; import org.apache.archiva.admin.model.beans.RemoteRepository; import org.apache.archiva.admin.model.beans.RepositoryGroup; +import org.apache.archiva.common.utils.FileUtils; import org.apache.archiva.maven2.model.Artifact; import org.apache.archiva.redback.integration.security.role.RedbackRoleConstants; import org.apache.archiva.redback.rest.services.FakeCreateAdminService; @@ -87,17 +88,20 @@ public class DownloadMergedIndexNonDefaultPathTest public void downloadMergedIndexWithNonDefaultPath() throws Exception { - Path tmpIndexDir = Paths.get( System.getProperty( "java.io.tmpdir" ), "tmpIndex" ); - if ( Files.exists(tmpIndexDir) ) - { - org.apache.archiva.common.utils.FileUtils.deleteDirectory( tmpIndexDir ); + + Path indexBaseDir = Paths.get(System.getProperty( "java.io.tmpdir" )).resolve("archiva").resolve("remotedownloadtest"); + String indexBase = indexBaseDir.toString(); + FileUtils.deleteQuietly( indexBaseDir); + if (!Files.exists(indexBaseDir)) { + Files.createDirectories( indexBaseDir ); } String id = Long.toString( System.currentTimeMillis() ); ManagedRepository managedRepository = new ManagedRepository( Locale.getDefault()); managedRepository.setId( id ); managedRepository.setName( "name of " + id ); managedRepository.setLocation( System.getProperty( "basedir" ) + "/src/test/repositories/test-repo" ); - managedRepository.setIndexDirectory( System.getProperty( "java.io.tmpdir" ) + "/tmpIndex/" + id ); + managedRepository.setIndexDirectory( indexBase + "/index-" + id ); + managedRepository.setPackedIndexDirectory( indexBase + "/indexPacked-" + id ); ManagedRepositoriesService managedRepositoriesService = getManagedRepositoriesService(); @@ -143,7 +147,8 @@ public class DownloadMergedIndexNonDefaultPathTest managedRepository.setId( id ); managedRepository.setName( "name of " + id ); managedRepository.setLocation( System.getProperty( "basedir" ) + "/src/test/repositories/test-repo" ); - managedRepository.setIndexDirectory( System.getProperty( "java.io.tmpdir" ) + "/tmpIndex/" + id ); + managedRepository.setIndexDirectory( indexBaseDir + "/index-"+ id ); + managedRepository.setPackedIndexDirectory( indexBase + "/tmpIndexPacked-" + id ); if ( managedRepositoriesService.getManagedRepository( id ) != null ) { |