archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r615120 - /maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/
Date Fri, 25 Jan 2008 06:07:39 GMT
Author: oching
Date: Thu Jan 24 22:07:36 2008
New Revision: 615120

URL: http://svn.apache.org/viewvc?rev=615120&view=rev
Log:
[MRM-622]
- added test for the order of deletion in RetentionCountRepositoryPurge

Modified:
    maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java
    maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java
    maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java

Modified: maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java?rev=615120&r1=615119&r2=615120&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java
Thu Jan 24 22:07:36 2008
@@ -33,6 +33,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.Properties;
@@ -228,5 +229,16 @@
         FileUtils.copyDirectory( getTestFile( "target/test-classes/test-repo" ), testDir
);
         
         return testDir.getAbsolutePath();
+    }
+    
+    protected void populateDbForTestOrderOfDeletion()
+        throws Exception
+    {
+        List<String> versions = new ArrayList<String>();
+        versions.add( "1.1.2-20070427.065136-1" );
+        versions.add( "1.1.2-20070506.163513-2" );
+        versions.add( "1.1.2-20070615.105019-3" );
+    
+        populateDb( "org.apache.maven.plugins", "maven-assembly-plugin", versions );
     }
 }

Modified: maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java?rev=615120&r1=615119&r2=615120&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java
Thu Jan 24 22:07:36 2008
@@ -270,16 +270,5 @@
         versions.add( "2.2-SNAPSHOT" );
 
         populateDb( "org.apache.maven.plugins", "maven-install-plugin", versions );
-    }
-
-    private void populateDbForTestOrderOfDeletion()
-        throws Exception
-    {
-        List<String> versions = new ArrayList<String>();
-        versions.add( "1.1.2-20070427.065136-1" );
-        versions.add( "1.1.2-20070506.163513-2" );
-        versions.add( "1.1.2-20070615.105019-3" );
-
-        populateDb( "org.apache.maven.plugins", "maven-assembly-plugin", versions );
-    }
+    }    
 }

Modified: maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java?rev=615120&r1=615119&r2=615120&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java
Thu Jan 24 22:07:36 2008
@@ -143,6 +143,41 @@
         assertExists( versionRoot + "/castor-anttasks-1.1.2-20070506.163513-2-sources.jar.sha1"
);
     }
 
+    public void testOrderOfDeletion()
+        throws Exception
+    {
+        populateDbForTestOrderOfDeletion();
+
+        String repoRoot = prepareTestRepo();
+
+        repoPurge.process( PATH_TO_TEST_ORDER_OF_DELETION );
+
+        String versionRoot = repoRoot + 
+            "/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT";
+        
+        assertDeleted( versionRoot + "/maven-assembly-plugin-1.1.2-20070427.065136-1.jar"
);
+        assertDeleted( versionRoot + "/maven-assembly-plugin-1.1.2-20070427.065136-1.jar.sha1"
);
+        assertDeleted( versionRoot + "/maven-assembly-plugin-1.1.2-20070427.065136-1.jar.md5"
);
+        assertDeleted( versionRoot + "/maven-assembly-plugin-1.1.2-20070427.065136-1.pom"
);
+        assertDeleted( versionRoot + "/maven-assembly-plugin-1.1.2-20070427.065136-1.pom.sha1"
);
+        assertDeleted( versionRoot + "/maven-assembly-plugin-1.1.2-20070427.065136-1.pom.md5"
);
+
+        // the following should not have been deleted
+        assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070506.163513-2.jar"
);
+        assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070506.163513-2.jar.sha1"
);
+        assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070506.163513-2.jar.md5"
);
+        assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070506.163513-2.pom"
);
+        assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070506.163513-2.pom.sha1"
);
+        assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070506.163513-2.pom.md5"
);
+
+        assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070615.105019-3.jar"
);
+        assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070615.105019-3.jar.sha1"
);
+        assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070615.105019-3.jar.md5"
);
+        assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070615.105019-3.pom"
);
+        assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070615.105019-3.pom.sha1"
);
+        assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070615.105019-3.pom.md5"
);
+    }
+    
     public void populateIfJarWasFoundDb()
         throws Exception
     {



Mime
View raw message