mirror of
https://github.com/apache/archiva.git
synced 2025-03-07 00:49:49 +00:00
Remove duplicated cleanup in tests
This commit is contained in:
parent
480825d72b
commit
1f42a01fb0
@ -70,7 +70,7 @@ public void setUp()
|
||||
this.cmr = new CassandraMetadataRepository( factories, null, cassandraArchivaManager );
|
||||
this.repository = this.cmr;
|
||||
|
||||
clearReposAndNamespace();
|
||||
clearReposAndNamespace( cassandraArchivaManager );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,11 +109,11 @@ public void clean_dependant_tables()
|
||||
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(),
|
||||
|
@ -61,14 +61,14 @@ public void setup()
|
||||
{
|
||||
cassandraArchivaManager.start();
|
||||
}
|
||||
clearReposAndNamespace();
|
||||
CassandraMetadataRepositoryTest.clearReposAndNamespace( cassandraArchivaManager );
|
||||
}
|
||||
|
||||
@After
|
||||
public void shutdown()
|
||||
throws Exception
|
||||
{
|
||||
clearReposAndNamespace();
|
||||
CassandraMetadataRepositoryTest.clearReposAndNamespace( cassandraArchivaManager );
|
||||
cassandraArchivaManager.shutdown();
|
||||
}
|
||||
|
||||
@ -136,18 +136,7 @@ public void testMetadataRepo()
|
||||
}
|
||||
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" );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user