diff options
author | Brett Porter <brett@apache.org> | 2010-03-18 14:33:12 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2010-03-18 14:33:12 +0000 |
commit | 203660343de0f78c9bc7bd7d4b0fa1f4e1f463a7 (patch) | |
tree | 7d268f33911fbff35f281a8eea9cafb5b88a313b /archiva-modules/metadata/metadata-repository-api/src | |
parent | 1ba8d3688ae7bd5733e4bcae3098c74b5fa9ea00 (diff) | |
download | archiva-203660343de0f78c9bc7bd7d4b0fa1f4e1f463a7.tar.gz archiva-203660343de0f78c9bc7bd7d4b0fa1f4e1f463a7.zip |
[MRM-1327] make sorting more consistent for other implementations
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@924830 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/metadata/metadata-repository-api/src')
-rw-r--r-- | archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java index d2e8a29ec..606d50bc9 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java +++ b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java @@ -34,7 +34,6 @@ import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; @@ -348,8 +347,11 @@ public abstract class AbstractMetadataRepositoryTest repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact1 ); repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact2 ); - assertEquals( new HashSet<String>( Arrays.asList( version2, version1 ) ), repository.getArtifactVersions( - TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ) ); + List<String> versions = new ArrayList<String>( repository.getArtifactVersions( TEST_REPO_ID, TEST_NAMESPACE, + TEST_PROJECT, + TEST_PROJECT_VERSION ) ); + Collections.sort( versions ); + assertEquals( Arrays.asList( version1, version2 ), versions ); } public void testGetArtifactVersionsMultipleArtifactsSingleVersion() @@ -499,8 +501,10 @@ public abstract class AbstractMetadataRepositoryTest artifact2.setProject( newProjectId ); repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, newProjectId, TEST_PROJECT_VERSION, artifact2 ); - assertEquals( Arrays.asList( artifact2, artifact1 ), repository.getArtifactsByChecksum( TEST_REPO_ID, - TEST_SHA1 ) ); + List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( repository.getArtifactsByChecksum( + TEST_REPO_ID, TEST_SHA1 ) ); + Collections.sort( artifacts, new ArtifactMetadataComparator() ); + assertEquals( Arrays.asList( artifact2, artifact1 ), artifacts ); } public void testGetArtifactsByChecksumNoResult() |