]> source.dussan.org Git - archiva.git/commitdiff
Fix failing test testGetMergedMetadata(org.apache.maven.archiva.webdav.RepositoryServ... metadata-rejig-1.2 47/head metadata-rejig-1.2
authorJames William Dumay <jdumay@apache.org>
Wed, 13 Aug 2008 01:47:08 +0000 (01:47 +0000)
committerJames William Dumay <jdumay@apache.org>
Wed, 13 Aug 2008 01:47:08 +0000 (01:47 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/metadata-rejig-1.2@685414 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataMerge.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletRepositoryGroupTest.java

index 38f871703bc9b7f75d423b04e27e0df9ae6e5366..ce29b991d11e1b9b0888aa13c5aca318eb795f21 100644 (file)
@@ -424,9 +424,8 @@ public class MetadataTools
     
     public void updateMetadata( ManagedRepositoryContent managedRepository, String logicalResource) throws RepositoryMetadataException
     {
-        ArchivaRepositoryMetadata metadata = null;
         final File metadataFile = new File(managedRepository.getRepoRoot(), logicalResource);
-//        final long lastUpdated = getExistingLastUpdated( metadataFile );
+        ArchivaRepositoryMetadata metadata = null;
         
         //Gather and merge all metadata available
         List<ArchivaRepositoryMetadata> metadatas = getMetadatasForManagedRepository(managedRepository, logicalResource);
@@ -448,12 +447,10 @@ public class MetadataTools
             updateMetadataVersions(availableVersions, metadata);
         }
         
-//        if ( lastUpdated > 0 )
-//        {
-//            metadata.setLastUpdatedTimestamp( toLastUpdatedDate( lastUpdated ) );
-//        }
-        
         RepositoryMetadataWriter.write(metadata, metadataFile);
+        
+        ChecksummedFile checksum = new ChecksummedFile( metadataFile );
+        checksum.fixChecksums( algorithms );
     }
     
     /**
index 4b265b6e33bb4c6b450a393b3a4137acd62fce2a..bf717d38b02ec88e8d61201e90d1d1f0dab1660f 100644 (file)
@@ -19,11 +19,7 @@ package org.apache.maven.archiva.repository.metadata;
  * under the License.
  */
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
 import org.apache.maven.archiva.model.ArchivaModelCloner;
 import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.maven.archiva.model.SnapshotVersion;
@@ -31,7 +27,6 @@ import org.apache.maven.archiva.model.SnapshotVersion;
 import java.util.Iterator;
 import java.util.List;
 import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.time.DateUtils;
 import org.apache.maven.archiva.model.Plugin;
 
 /**
index c78e0b7426ab96c92415cdbcd35ed9e9d1a301b4..7acf05969bfcdf5189ca89b0a137692f957faf95 100644 (file)
@@ -77,6 +77,7 @@ public class RepositoryServletRepositoryGroupTest
     protected static final String REPO_GROUP_WITH_INVALID_REPOS = "group-with-invalid-repos";
     
     
+    @Override
     protected void setUp()
         throws Exception
     {
@@ -119,6 +120,7 @@ public class RepositoryServletRepositoryGroupTest
         saveConfiguration( archivaConfiguration );
     }
     
+    @Override
     protected void tearDown()
         throws Exception
     {
@@ -275,7 +277,7 @@ public class RepositoryServletRepositoryGroupTest
         response = sc.getResource( request );
         
         assertResponseOK( response );
-        assertEquals( "d2321a573e0488bca571b624f891104009408dd8  maven-metadata-group-with-valid-repos.xml", response.getText() );
+        assertEquals( "add113b0d7f8c6adb92a5015a7a3701081edf998  maven-metadata-group-with-valid-repos.xml", response.getText() );
         
         // request the md5 checksum of the metadata
         request =
@@ -284,7 +286,7 @@ public class RepositoryServletRepositoryGroupTest
         response = sc.getResource( request );
                 
         assertResponseOK( response );
-        assertEquals( "79d271fbe8bd1d17b23273937750d407  maven-metadata-group-with-valid-repos.xml", response.getText().trim() );
+        assertEquals( "5b85ea4aa5f52bb76760041a52f98de8  maven-metadata-group-with-valid-repos.xml", response.getText().trim() );
     }
         
     protected void assertResponseMethodNotAllowed( WebResponse response )