]> source.dussan.org Git - archiva.git/commitdiff
test that files actually get deleted in repository purge
authorBrett Porter <brett@apache.org>
Wed, 15 Dec 2010 02:19:22 +0000 (02:19 +0000)
committerBrett Porter <brett@apache.org>
Wed, 15 Dec 2010 02:19:22 +0000 (02:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-1.3.x@1049389 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.jar [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.jar.md5 [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.jar.sha1 [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.pom.md5 [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.pom.sha1 [new file with mode: 0644]

index fb8877033ef4967c57e74048bbd4989d65d48fca..d498011f387656154d90607fcfac5eb66b434035 100644 (file)
@@ -19,6 +19,8 @@ package org.apache.maven.archiva.consumers.core.repository;
  * under the License.
  */
 
+import org.apache.commons.lang.time.DateUtils;
+
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -26,8 +28,6 @@ import java.util.Calendar;
 import java.util.Collections;
 import java.util.List;
 
-import org.apache.commons.lang.time.DateUtils;
-
 /**
  */
 public class DaysOldRepositoryPurgeTest
@@ -78,6 +78,10 @@ public class DaysOldRepositoryPurgeTest
                                                                   "2.2-SNAPSHOT", "maven-plugin" ) );
         listener.deleteArtifact( getRepository(), createArtifact( "org.apache.maven.plugins", "maven-install-plugin",
                                                                   "2.2-SNAPSHOT", "pom" ) );
+        listener.deleteArtifact( getRepository(), createArtifact( "org.apache.maven.plugins", "maven-install-plugin",
+                                                                  "2.2-20061118.060401-2", "maven-plugin" ) );
+        listener.deleteArtifact( getRepository(), createArtifact( "org.apache.maven.plugins", "maven-install-plugin",
+                                                                  "2.2-20061118.060401-2", "pom" ) );
         listenerControl.replay();
         
         repoPurge.process( PATH_TO_BY_DAYS_OLD_ARTIFACT );
@@ -99,12 +103,19 @@ public class DaysOldRepositoryPurgeTest
         assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom.md5" );
         assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom.sha1" );
 
-        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar" );
-        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.md5" );
-        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.sha1" );
-        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom" );
-        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.md5" );
-        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.sha1" );
+        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.jar" );
+        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.jar.md5" );
+        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.jar.sha1" );
+        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.pom" );
+        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.pom.md5" );
+        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.pom.sha1" );
+
+        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar" );
+        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.md5" );
+        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.sha1" );
+        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom" );
+        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.md5" );
+        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.sha1" );
     }
 
     public void testOrderOfDeletion()
index c472c74591a3a0d61e85d201573921afee23d78c..1dc87a1096022ad25972b33142809f66567f8d67 100644 (file)
@@ -19,8 +19,6 @@ package org.apache.maven.archiva.consumers.core.repository;
  * under the License.
  */
 
-import java.io.File;
-
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.archiva.common.utils.BaseFile;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
@@ -32,6 +30,8 @@ import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
 import org.apache.maven.archiva.repository.scanner.functors.ConsumerWantsFilePredicate;
 import org.custommonkey.xmlunit.XMLAssert;
 
+import java.io.File;
+
 /**
  */
 public class RepositoryPurgeConsumerTest
@@ -182,13 +182,20 @@ public class RepositoryPurgeConsumerTest
         assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom" );
         assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom.md5" );
         assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom.sha1" );
-
-        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar" );
-        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.md5" );
-        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.sha1" );
-        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom" );
-        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.md5" );
-        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.sha1" );
+        
+        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.jar" );
+        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.jar.md5" );
+        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.jar.sha1" );
+        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.pom" );
+        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.pom.md5" );
+        assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.pom.sha1" );
+
+        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar" );
+        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.md5" );
+        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.sha1" );
+        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom" );
+        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.md5" );
+        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.sha1" );
     }
 
     /**
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.jar b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.jar
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.jar.md5 b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.jar.md5
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.jar.sha1 b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.jar.sha1
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.pom b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.pom
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.pom.md5 b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.pom.md5
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.pom.sha1 b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070510.010101-4.pom.sha1
new file mode 100644 (file)
index 0000000..e69de29