diff options
author | Olivier Lamy <olamy@apache.org> | 2014-03-24 03:17:49 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2014-03-24 03:17:49 +0000 |
commit | 8565793eed637237c99de7772a046b6ce368a0bc (patch) | |
tree | 50ad4c2ed7a2cebe48f9c53a90185eb2940ee3e9 | |
parent | 7d10f63b87eb918253ee018d998975b9c0bbb63f (diff) | |
download | archiva-8565793eed637237c99de7772a046b6ce368a0bc.tar.gz archiva-8565793eed637237c99de7772a046b6ce368a0bc.zip |
fix remove artifact
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1580720 13f79535-47bb-0310-9956-ffa450edef68
2 files changed, 7 insertions, 12 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 20f8f9664..ffec0fd5f 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 @@ -1238,8 +1238,8 @@ public abstract class AbstractMetadataRepositoryTest Assertions.assertThat( versions ).isNotNull().isNotEmpty().hasSize( 1 ).contains( "2.0" ); - assertTrue( - repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ).isEmpty() ); + Assertions.assertThat( repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, + TEST_PROJECT_VERSION )).isNotNull().isEmpty(); Assertions.assertThat( repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION_2_0 ) ).isNotEmpty().hasSize( 1 ); diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java index fd2eed936..31e99150e 100644 --- a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java @@ -1841,25 +1841,23 @@ public class CassandraMetadataRepository final String version, final String id ) throws MetadataRepositoryException { -/* logger.debug( "removeArtifact repositoryId: '{}', namespace: '{}', project: '{}', version: '{}', id: '{}'", + logger.debug( "removeArtifact repositoryId: '{}', namespace: '{}', project: '{}', version: '{}', id: '{}'", repositoryId, namespace, project, version, id ); String key = new ArtifactMetadataModel.KeyBuilder().withRepositoryId( repositoryId ).withNamespace( namespace ).withId( id ).withProjectVersion( version ).withProject( project ).build(); - ArtifactMetadataModel artifactMetadataModel = new ArtifactMetadataModel(); - artifactMetadataModel.setArtifactMetadataModelId( key ); - getArtifactMetadataModelEntityManager().remove( artifactMetadataModel ); + Keyspace keyspace = cassandraArchivaManager.getKeyspace(); + + this.artifactMetadataTemplate.deleteRow( key ); key = new ProjectVersionMetadataModel.KeyBuilder().withId( version ).withRepository( repositoryId ).withNamespace( namespace ).withProjectId( project ).build(); - ProjectVersionMetadataModel projectVersionMetadataModel = new ProjectVersionMetadataModel(); - projectVersionMetadataModel.setRowId( key ); + this.projectVersionMetadataModelTemplate.deleteRow( key ); - getProjectVersionMetadataModelEntityManager().remove( projectVersionMetadataModel );*/ } @Override @@ -1919,9 +1917,6 @@ public class CassandraMetadataRepository Keyspace keyspace = cassandraArchivaManager.getKeyspace(); StringSerializer ss = StringSerializer.get(); - // cql cannot run or in queries so running twice the query - - RangeSlicesQuery<String, String, String> query = HFactory // .createRangeSlicesQuery( keyspace, ss, ss, ss ) // .setColumnFamily( cassandraArchivaManager.getArtifactMetadataModelFamilyName() ) // |