diff options
author | Olivier Lamy <olamy@apache.org> | 2012-09-13 08:39:20 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-09-13 08:39:20 +0000 |
commit | 67f7fee51c8580dccff2f8566e3dce79aa392f19 (patch) | |
tree | 96dfb995ad220adf2b5e492bb1ec48f29a9388fd /archiva-modules/archiva-scheduler | |
parent | 3cf32bb9ad6d23f4539b6af48de118b0d327dcad (diff) | |
download | archiva-67f7fee51c8580dccff2f8566e3dce79aa392f19.tar.gz archiva-67f7fee51c8580dccff2f8566e3dce79aa392f19.zip |
ensure file are cleaned before test for folks who do not use clean and break the build (folks like me I mean :-))
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1384232 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-scheduler')
-rw-r--r-- | archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java index e517b3059..6e92cc8bb 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java @@ -49,6 +49,7 @@ import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.FilenameFilter; import java.io.IOException; import java.util.Set; import java.util.zip.ZipEntry; @@ -274,6 +275,20 @@ public class ArchivaIndexingTaskExecutorTest throws Exception { + File indexerDirectory = new File( repositoryConfig.getLocation(), ".indexer" ); + + indexerDirectory.listFiles( new FilenameFilter() + { + public boolean accept( File file, String s ) + { + if ( s.startsWith( "nexus-maven-repository-index" ) ) + { + new File( file, s ).delete(); + } + return false; + } + } ); + File artifactFile = new File( repositoryConfig.getLocation(), "org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar" ); @@ -291,9 +306,7 @@ public class ArchivaIndexingTaskExecutorTest indexingExecutor.executeTask( task ); - assertTrue( new File( repositoryConfig.getLocation(), ".indexer" ).exists() ); - - File indexerDirectory = new File( repositoryConfig.getLocation(), ".indexer" ); + assertTrue( indexerDirectory.exists() ); // test packed index file creation assertTrue( new File( indexerDirectory, "nexus-maven-repository-index.zip" ).exists() ); |