diff options
author | Carlos Sanchez <carlos@apache.org> | 2014-11-23 20:40:55 +0100 |
---|---|---|
committer | Carlos Sanchez <carlos@apache.org> | 2014-11-23 21:15:31 +0100 |
commit | 1f42a01fb0238c1fd7fabcb485bb8adf475f6e2c (patch) | |
tree | 5cc74d565bcc65c879362a3c245e2f41fe860a91 | |
parent | 480825d72b98d707b958ec53eb56cf6b1c6b2299 (diff) | |
download | archiva-1f42a01fb0238c1fd7fabcb485bb8adf475f6e2c.tar.gz archiva-1f42a01fb0238c1fd7fabcb485bb8adf475f6e2c.zip |
Remove duplicated cleanup in tests
2 files changed, 6 insertions, 17 deletions
diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java b/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java index 57bd33d5f..c26a660e8 100644 --- a/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java +++ b/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java @@ -70,7 +70,7 @@ public class CassandraMetadataRepositoryTest this.cmr = new CassandraMetadataRepository( factories, null, cassandraArchivaManager ); this.repository = this.cmr; - clearReposAndNamespace(); + clearReposAndNamespace( cassandraArchivaManager ); } /** @@ -109,11 +109,11 @@ public class CassandraMetadataRepositoryTest public void shutdown() throws Exception { - clearReposAndNamespace(); + clearReposAndNamespace( cassandraArchivaManager ); super.tearDown(); } - protected void clearReposAndNamespace() + static void clearReposAndNamespace( CassandraArchivaManager cassandraArchivaManager ) throws Exception { cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(), diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/RepositoriesNamespaceTest.java b/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/RepositoriesNamespaceTest.java index 547d3e863..3a999c0fb 100644 --- a/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/RepositoriesNamespaceTest.java +++ b/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/RepositoriesNamespaceTest.java @@ -61,14 +61,14 @@ public class RepositoriesNamespaceTest { cassandraArchivaManager.start(); } - clearReposAndNamespace(); + CassandraMetadataRepositoryTest.clearReposAndNamespace( cassandraArchivaManager ); } @After public void shutdown() throws Exception { - clearReposAndNamespace(); + CassandraMetadataRepositoryTest.clearReposAndNamespace( cassandraArchivaManager ); cassandraArchivaManager.shutdown(); } @@ -136,18 +136,7 @@ public class RepositoriesNamespaceTest } finally { - clearReposAndNamespace(); + CassandraMetadataRepositoryTest.clearReposAndNamespace( cassandraArchivaManager ); } } - - protected void clearReposAndNamespace() - throws Exception - { - cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(), - "project" ); - cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(), - "namespace" ); - cassandraArchivaManager.getCluster().truncate( cassandraArchivaManager.getKeyspace().getKeyspaceName(), - "repository" ); - } } |