]> source.dussan.org Git - archiva.git/commitdiff
Remove duplicated cleanup in tests 12/head
authorCarlos Sanchez <carlos@apache.org>
Sun, 23 Nov 2014 19:40:55 +0000 (20:40 +0100)
committerCarlos Sanchez <carlos@apache.org>
Sun, 23 Nov 2014 20:15:31 +0000 (21:15 +0100)
archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java
archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/RepositoriesNamespaceTest.java

index 57bd33d5fb04cded319423014a522551cbcc1307..c26a660e8882ba6a8631e3f090317852c7403f98 100644 (file)
@@ -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(),
index 547d3e86300b14146b8e4473d71e6da8186ca904..3a999c0fb4e51c37500cc1edd1621d52b5162d62 100644 (file)
@@ -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" );
-    }
 }