diff options
Diffstat (limited to 'archiva-modules/archiva-base')
5 files changed, 16 insertions, 17 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java index a8cf4b7f2..a00e444e6 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java @@ -259,7 +259,7 @@ public abstract class AbstractRepositoryPurge } else { - // metadataRepository.removeArtifact( artifactMetadata, baseVersion ); + // metadataRepository.removeTimestampedArtifact( artifactMetadata, baseVersion ); metaRemovalList.put( info, artifactMetadata ); } } @@ -366,7 +366,7 @@ public abstract class AbstractRepositoryPurge version = artifactInfo.getProjectVersion( ); MavenArtifactFacet mavenArtifactFacetToCompare = new MavenArtifactFacet( ); mavenArtifactFacetToCompare.setClassifier( artifactInfo.getClassifier( ) ); - metadataRepository.removeArtifact(repositorySession , repository.getId( ), groupId, + metadataRepository.removeFacetFromArtifact(repositorySession , repository.getId( ), groupId, artifactId, version, mavenArtifactFacetToCompare ); try { repositorySession.save( ); @@ -377,7 +377,7 @@ public abstract class AbstractRepositoryPurge } else { - metadataRepository.removeArtifact(repositorySession , artifactMetadata, artifactInfo.getProjectVersion( ) ); + metadataRepository.removeTimestampedArtifact(repositorySession , artifactMetadata, artifactInfo.getProjectVersion( ) ); } } diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java index 9d44b28b7..18c3d2877 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java @@ -345,8 +345,8 @@ public class CleanupReleasedSnapshotsRepositoryPurgeTest verify(metadataRepository, never()).removeProjectVersion(eq(repositorySession) , eq(TEST_REPO_ID), eq(projectNs), eq(projectName), eq(projectVersion) ); verify(metadataRepository, never()).removeProjectVersion(eq(repositorySession) , eq(TEST_REPO_ID), eq(projectNs), eq(projectName), eq("2.0.3-SNAPSHOT") ); verify(metadataRepository, never()).removeProjectVersion(eq(repositorySession) , eq(TEST_REPO_ID), eq(projectNs), eq(projectName), eq("2.0.4-SNAPSHOT") ); - verify(metadataRepository, never()).removeArtifact(eq(repositorySession) , any(ArtifactMetadata.class), any(String.class) ); - verify(metadataRepository, never()).removeArtifact(eq(repositorySession) , any(String.class), any(String.class), any(String.class), any(String.class), any( MetadataFacet.class) ); + verify(metadataRepository, never()).removeTimestampedArtifact(eq(repositorySession) , any(ArtifactMetadata.class), any(String.class) ); + verify(metadataRepository, never()).removeFacetFromArtifact(eq(repositorySession) , any(String.class), any(String.class), any(String.class), any(String.class), any( MetadataFacet.class) ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java index 848d4eda6..66651d37b 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java @@ -134,7 +134,7 @@ public class DaysOldRepositoryPurgeTest // Verify the metadataRepository invocations verify(metadataRepository, never()).removeProjectVersion(eq(repositorySession) , eq(TEST_REPO_ID), eq(projectNs), eq(projectName), eq(projectVersion) ); ArgumentCaptor<ArtifactMetadata> metadataArg = ArgumentCaptor.forClass(ArtifactMetadata.class); - verify(metadataRepository, times(2)).removeArtifact(eq(repositorySession) , metadataArg.capture(), eq(projectVersion) ); + verify(metadataRepository, times(2)).removeTimestampedArtifact(eq(repositorySession) , metadataArg.capture(), eq(projectVersion) ); List<ArtifactMetadata> metaL = metadataArg.getAllValues(); for (ArtifactMetadata meta : metaL) { assertTrue(meta.getId().startsWith(projectName)); @@ -229,7 +229,7 @@ public class DaysOldRepositoryPurgeTest // Verify the metadataRepository invocations verify(metadataRepository, never()).removeProjectVersion(eq(repositorySession) , eq(TEST_REPO_ID), eq(projectNs), eq(projectName), eq(projectVersion) ); ArgumentCaptor<ArtifactMetadata> metadataArg = ArgumentCaptor.forClass(ArtifactMetadata.class); - verify(metadataRepository, times(deletedVersions.size())).removeArtifact(eq(repositorySession) , metadataArg.capture(), eq(projectVersion) ); + verify(metadataRepository, times(deletedVersions.size())).removeTimestampedArtifact(eq(repositorySession) , metadataArg.capture(), eq(projectVersion) ); List<ArtifactMetadata> metaL = metadataArg.getAllValues(); for (ArtifactMetadata meta : metaL) { assertTrue(meta.getId().startsWith(projectName)); @@ -337,7 +337,7 @@ public class DaysOldRepositoryPurgeTest // Verify the metadataRepository invocations verify(metadataRepository, never()).removeProjectVersion(eq(repositorySession) , eq(TEST_REPO_ID), eq(projectNs), eq(projectName), eq(projectVersion) ); ArgumentCaptor<ArtifactMetadata> metadataArg = ArgumentCaptor.forClass(ArtifactMetadata.class); - verify(metadataRepository, times(deletedVersions.size())).removeArtifact( eq(repositorySession), metadataArg.capture(), eq(projectVersion) ); + verify(metadataRepository, times(deletedVersions.size())).removeTimestampedArtifact( eq(repositorySession), metadataArg.capture(), eq(projectVersion) ); List<ArtifactMetadata> metaL = metadataArg.getAllValues(); for (ArtifactMetadata meta : metaL) { assertTrue(meta.getId().startsWith(projectName)); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java index 318144563..3172a3d3f 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java @@ -27,7 +27,6 @@ import org.apache.archiva.consumers.KnownRepositoryContentConsumer; import org.apache.archiva.consumers.functors.ConsumerWantsFilePredicate; import org.apache.archiva.metadata.model.ArtifactMetadata; import org.apache.archiva.metadata.model.MetadataFacet; -import org.apache.archiva.mock.MockRepositorySessionFactory; import org.apache.archiva.repository.RepositoryRegistry; import org.apache.archiva.repository.features.ArtifactCleanupFeature; import org.custommonkey.xmlunit.XMLAssert; @@ -210,7 +209,7 @@ public class RepositoryPurgeConsumerTest // Verify the metadataRepository invocations verify(metadataRepository, never()).removeProjectVersion( eq(repositorySession), eq(TEST_REPO_ID), eq(projectNs), eq(projectName), eq(projectVersion) ); ArgumentCaptor<ArtifactMetadata> metadataArg = ArgumentCaptor.forClass(ArtifactMetadata.class); - verify(metadataRepository, times(2)).removeArtifact( eq(repositorySession), metadataArg.capture(), eq(projectVersion) ); + verify(metadataRepository, times(2)).removeTimestampedArtifact( eq(repositorySession), metadataArg.capture(), eq(projectVersion) ); List<ArtifactMetadata> metaL = metadataArg.getAllValues(); for (ArtifactMetadata meta : metaL) { assertTrue(meta.getId().startsWith(projectName)); @@ -323,7 +322,7 @@ public class RepositoryPurgeConsumerTest // Verify the metadataRepository invocations verify(metadataRepository, never()).removeProjectVersion( eq(repositorySession), eq(TEST_REPO_ID), eq(projectNs), eq(projectName), eq(projectVersion) ); ArgumentCaptor<ArtifactMetadata> metadataArg = ArgumentCaptor.forClass(ArtifactMetadata.class); - verify(metadataRepository, times(2)).removeArtifact( eq(repositorySession), metadataArg.capture(), eq(projectVersion) ); + verify(metadataRepository, times(2)).removeTimestampedArtifact( eq(repositorySession), metadataArg.capture(), eq(projectVersion) ); List<ArtifactMetadata> metaL = metadataArg.getAllValues(); assertTrue( metaL.size( ) > 0 ); for (ArtifactMetadata meta : metaL) { @@ -403,8 +402,8 @@ public class RepositoryPurgeConsumerTest verify(metadataRepository, never()).removeProjectVersion( eq(repositorySession), eq(TEST_REPO_ID), eq(projectNs), eq(projectName), eq(projectVersion) ); ArgumentCaptor<ArtifactMetadata> metadataArg = ArgumentCaptor.forClass(ArtifactMetadata.class); - verify(metadataRepository, never()).removeArtifact( eq(repositorySession), any(), any() ); - verify(metadataRepository, never()).removeArtifact( eq(repositorySession), any(), any(), any(), any(), any(MetadataFacet.class) ); + verify(metadataRepository, never()).removeTimestampedArtifact( eq(repositorySession), any(), any() ); + verify(metadataRepository, never()).removeFacetFromArtifact( eq(repositorySession), any(), any(), any(), any(), any(MetadataFacet.class) ); // check if the snapshot wasn't removed @@ -473,7 +472,7 @@ public class RepositoryPurgeConsumerTest verify(metadataRepository, times(1)).removeProjectVersion( eq(repositorySession), eq(TEST_REPO_ID), eq(projectNs), eq(projectName), eq(projectVersion) ); ArgumentCaptor<ArtifactMetadata> metadataArg = ArgumentCaptor.forClass(ArtifactMetadata.class); - verify(metadataRepository, never()).removeArtifact( eq(repositorySession), any(), any() ); + verify(metadataRepository, never()).removeTimestampedArtifact( eq(repositorySession), any(), any() ); // check if the snapshot was removed assertDeleted( projectRoot + "/2.3-SNAPSHOT" ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java index e8ffc78b3..3a06774f1 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java @@ -137,7 +137,7 @@ public class RetentionCountRepositoryPurgeTest // Verify the metadataRepository invocations verify(metadataRepository, never()).removeProjectVersion( eq(repositorySession), eq(TEST_REPO_ID), eq(projectNs), eq(projectName), eq(projectVersion) ); ArgumentCaptor<ArtifactMetadata> metadataArg = ArgumentCaptor.forClass(ArtifactMetadata.class); - verify(metadataRepository, times(deletedVersions.size())).removeArtifact( eq(repositorySession), metadataArg.capture(), eq(projectVersion) ); + verify(metadataRepository, times(deletedVersions.size())).removeTimestampedArtifact( eq(repositorySession), metadataArg.capture(), eq(projectVersion) ); List<ArtifactMetadata> metaL = metadataArg.getAllValues(); for (ArtifactMetadata meta : metaL) { assertTrue(meta.getId().startsWith(projectName)); @@ -223,7 +223,7 @@ public class RetentionCountRepositoryPurgeTest // Verify the metadataRepository invocations verify(metadataRepository, never()).removeProjectVersion( eq(repositorySession), eq(TEST_REPO_ID), eq(projectNs), eq(projectName), eq(projectVersion) ); ArgumentCaptor<ArtifactMetadata> metadataArg = ArgumentCaptor.forClass(ArtifactMetadata.class); - verify(metadataRepository, times(deletedVersions.size())).removeArtifact( eq(repositorySession), metadataArg.capture(), eq(projectVersion) ); + verify(metadataRepository, times(deletedVersions.size())).removeTimestampedArtifact( eq(repositorySession), metadataArg.capture(), eq(projectVersion) ); List<ArtifactMetadata> metaL = metadataArg.getAllValues(); for (ArtifactMetadata meta : metaL) { assertTrue(meta.getId().startsWith(projectName)); @@ -311,7 +311,7 @@ public class RetentionCountRepositoryPurgeTest // Verify the metadataRepository invocations verify(metadataRepository, never()).removeProjectVersion( eq(repositorySession), eq(TEST_REPO_ID), eq(projectNs), eq(projectName), eq(projectVersion) ); ArgumentCaptor<ArtifactMetadata> metadataArg = ArgumentCaptor.forClass(ArtifactMetadata.class); - verify(metadataRepository, times(deletedVersions.size())).removeArtifact( eq(repositorySession), metadataArg.capture(), eq(projectVersion) ); + verify(metadataRepository, times(deletedVersions.size())).removeTimestampedArtifact( eq(repositorySession), metadataArg.capture(), eq(projectVersion) ); List<ArtifactMetadata> metaL = metadataArg.getAllValues(); for (ArtifactMetadata meta : metaL) { assertTrue(meta.getId().startsWith(projectName)); |