diff options
author | Olivier Lamy <olamy@apache.org> | 2012-10-11 22:43:15 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-10-11 22:43:15 +0000 |
commit | e7bc35db81e879f19a7846098d1f6eed31e1b142 (patch) | |
tree | ae48aa808bf1ada4698ea33a22009a47a8ab9503 /archiva-modules/metadata | |
parent | 092a635e39f0329c59d23745cdd93fdd000516e4 (diff) | |
download | archiva-e7bc35db81e879f19a7846098d1f6eed31e1b142.tar.gz archiva-e7bc35db81e879f19a7846098d1f6eed31e1b142.zip |
add unit test for new method in MetadataRepository and fix compilation for some impls/mocks
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1397345 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.java | 20 |
1 files changed, 19 insertions, 1 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 ca400cc9e..55aed9ce7 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 @@ -1132,7 +1132,7 @@ public abstract class AbstractMetadataRepositoryTest } @Test - public void deleteVersion() + public void deleteArtifact() throws Exception { ArtifactMetadata artifact = createArtifact(); @@ -1152,6 +1152,24 @@ public abstract class AbstractMetadataRepositoryTest } @Test + public void deleteVersion() + throws Exception + { + ArtifactMetadata artifact = createArtifact(); + artifact.addFacet( new TestMetadataFacet( "value" ) ); + + repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + + repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + + assertEquals( 1, repository.getProjectVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ).size() ); + + repository.removeProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + + assertEquals( 0, repository.getProjectVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ).size() ); + } + + @Test public void deleteSnapshotVersion() throws Exception { |