diff options
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 { |