From: Maria Odea B. Ching Date: Fri, 2 Apr 2010 11:18:43 +0000 (+0000) Subject: [MRM-1321] Snapshot is linking to oldest version in Archiva GUI X-Git-Tag: archiva-1.3.1~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7d72f9f75ea90b97f28913121943ad1103f5299b;p=archiva.git [MRM-1321] Snapshot is linking to oldest version in Archiva GUI submitted by Daniel Triphaus o do not reverse the order of the list containing the snapshot versions additional change made: o updated unit test to correct behavior git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-1.3.x@930242 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/DefaultRepositoryBrowsing.java b/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/DefaultRepositoryBrowsing.java index 144f8c44f..888bf4726 100644 --- a/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/DefaultRepositoryBrowsing.java +++ b/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/DefaultRepositoryBrowsing.java @@ -343,7 +343,6 @@ public class DefaultRepositoryBrowsing { final List versions = (List) dao.query( new UniqueVersionConstraint( groupId, artifactId ) ); Collections.sort( versions ); - Collections.reverse( versions ); for ( String uniqueVersion : versions ) { diff --git a/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/browsing/RepositoryBrowsingTest.java b/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/browsing/RepositoryBrowsingTest.java index 1a6600a8c..f1e10bf5a 100644 --- a/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/browsing/RepositoryBrowsingTest.java +++ b/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/browsing/RepositoryBrowsingTest.java @@ -189,7 +189,7 @@ public class RepositoryBrowsingTest assertNotNull( "Artifact should not be null.", artifact ); assertEquals( "org.apache.archiva", artifact.getGroupId() ); assertEquals( "archiva-indexer", artifact.getArtifactId() ); - assertEquals( "1.0-20070522.143249-1", artifact.getVersion() ); + assertEquals( "1.0-20070522.153141-2", artifact.getVersion() ); assertEquals( "jar", artifact.getPackaging() ); String repoId = browser.getRepositoryId( USER_GUEST, GUEST_REPO_IDS, "org.apache.archiva", "archiva-indexer", "1.0-SNAPSHOT" );