aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/metadata
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2010-12-30 01:29:50 +0000
committerBrett Porter <brett@apache.org>2010-12-30 01:29:50 +0000
commite28ae522d1ce049848d2a30fa4e2371b0b4be706 (patch)
treea94ab784a2529285dbc776213ed5c5b8f66a6ed2 /archiva-modules/metadata
parentbf3058dbeb8d735072d51a180d794d7346a21b4a (diff)
downloadarchiva-e28ae522d1ce049848d2a30fa4e2371b0b4be706.tar.gz
archiva-e28ae522d1ce049848d2a30fa4e2371b0b4be706.zip
[MRM-1327] make sure getArtifacts query is restricted to the right repository
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1053780 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/metadata')
-rw-r--r--archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java15
1 files changed, 15 insertions, 0 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 e1348a2e2..204c6cbe4 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
@@ -812,6 +812,21 @@ public abstract class AbstractMetadataRepositoryTest
assertEquals( Collections.singletonList( artifact ), repository.getArtifacts( TEST_REPO_ID ) );
}
+ public void testGetArtifactsByRepoIdMultipleCopies()
+ throws Exception
+ {
+ ArtifactMetadata artifact = createArtifact();
+ repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
+
+ ArtifactMetadata secondArtifact = createArtifact();
+ secondArtifact.setRepositoryId( OTHER_REPO_ID );
+ repository.updateArtifact( OTHER_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, secondArtifact );
+
+ // test it restricts to the appropriate repository
+ assertEquals( Collections.singletonList( artifact ), repository.getArtifacts( TEST_REPO_ID ) );
+ assertEquals( Collections.singletonList( secondArtifact ), repository.getArtifacts( OTHER_REPO_ID ) );
+ }
+
public void testGetNamespacesWithSparseDepth()
throws Exception
{