diff options
author | Martin Stockhammer <martin.stockhammer@ars.de> | 2018-10-30 14:30:55 +0100 |
---|---|---|
committer | Martin Stockhammer <martin.stockhammer@ars.de> | 2018-10-30 14:30:55 +0100 |
commit | f9073a2c7d97df6dbb03a6be87958f05a6245640 (patch) | |
tree | 2e41bfe7b45d5d632b2c2b98daa4ed43dcf669ac /archiva-modules/archiva-scheduler | |
parent | 25fd8f159736100845d1c9060618266ac23db7c1 (diff) | |
download | archiva-f9073a2c7d97df6dbb03a6be87958f05a6245640.tar.gz archiva-f9073a2c7d97df6dbb03a6be87958f05a6245640.zip |
Improving tests to make them idempotent.
Diffstat (limited to 'archiva-modules/archiva-scheduler')
-rw-r--r-- | archiva-modules/archiva-scheduler/archiva-scheduler-indexing-maven2/src/test/java/org/apache/archiva/scheduler/indexing/maven/ArchivaIndexingTaskExecutorTest.java | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing-maven2/src/test/java/org/apache/archiva/scheduler/indexing/maven/ArchivaIndexingTaskExecutorTest.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing-maven2/src/test/java/org/apache/archiva/scheduler/indexing/maven/ArchivaIndexingTaskExecutorTest.java index b67ee243e..758568ba9 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing-maven2/src/test/java/org/apache/archiva/scheduler/indexing/maven/ArchivaIndexingTaskExecutorTest.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing-maven2/src/test/java/org/apache/archiva/scheduler/indexing/maven/ArchivaIndexingTaskExecutorTest.java @@ -278,19 +278,20 @@ public class ArchivaIndexingTaskExecutorTest Path packedIndexDirectory = icf.getLocalPackedIndexPath(); Path indexerDirectory = icf.getLocalIndexPath(); - Files.list(packedIndexDirectory).filter( path -> path.getFileName().toString().startsWith("nexus-maven-repository-index") ) - .forEach( path -> - { - try - { - System.err.println("Deleting "+path); - Files.delete( path ); - } - catch ( IOException e ) - { - e.printStackTrace( ); - } - } ); + for (Path dir : new Path[] { packedIndexDirectory, indexerDirectory }) { + Files.list(dir).filter(path -> path.getFileName().toString().startsWith("nexus-maven-repository-index")) + .forEach(path -> + { + try { + System.err.println("Deleting " + path); + Files.delete(path); + } catch (IOException e) { + e.printStackTrace(); + } + }); + } + + Path artifactFile = basePath.resolve( |