Skip to content

Commit

Permalink
extract tests that could conflict with each other to a separate test …
Browse files Browse the repository at this point in the history
…class (= gets own jvm)

patch by jbellis; reviewed by Sandeep Tata for CASSANDRA-162

git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@773941 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
jbellis committed May 12, 2009
1 parent 97fc5cb commit 5964cd4
Show file tree
Hide file tree
Showing 15 changed files with 499 additions and 420 deletions.
2 changes: 1 addition & 1 deletion build.xml
Expand Up @@ -189,7 +189,7 @@
<target name="test" depends="build-test">
<echo message="running tests"/>
<mkdir dir="${build.test.dir}/cassandra"/>
<junit fork="yes">
<junit fork="on">
<formatter type="brief" usefile="false"/>
<jvmarg value="-Dstorage-config=${test.conf}"/>
<jvmarg value="-ea"/>
Expand Down
14 changes: 0 additions & 14 deletions src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Expand Up @@ -1468,20 +1468,6 @@ public int getMemtableSwitchCount()
return memtableSwitchCount;
}

/**
* clears out all data associated with this ColumnFamily.
* For use in testing.
*/
public void reset() throws IOException, ExecutionException, InterruptedException
{
forceBlockingFlush();
for (String fName : ssTables_)
{
new File(fName).delete();
}
ssTables_.clear();
}

public Object getMemtable()
{
return memtable_.get();
Expand Down
5 changes: 0 additions & 5 deletions src/java/org/apache/cassandra/db/CommitLog.java
Expand Up @@ -627,11 +627,6 @@ public void setForcedRollOver()
forcedRollOver_ = true;
}

public static void reset()
{
CommitLog.instances_.clear();
}

public static void main(String[] args) throws Throwable
{
LogUtil.init();
Expand Down
23 changes: 0 additions & 23 deletions test/unit/org/apache/cassandra/CleanupHelper.java
Expand Up @@ -16,29 +16,6 @@ public static void cleanup()
{
// we clean the fs twice, once to start with (so old data files don't get stored by anything static if this is the first run)
// and once after flushing stuff (to try to clean things out if it is not.) part #2 seems to be less than perfect.
cleanUpFilesystem();

Table table = Table.open("Table1");
for (String cfName : table.getColumnFamilies())
{
ColumnFamilyStore cfs = table.getColumnFamilyStore(cfName);
try
{
cfs.reset();
}
catch (Exception e)
{
throw new RuntimeException(e);
}
}

CommitLog.reset();

cleanUpFilesystem();
}

private static void cleanUpFilesystem()
{
String[] directoryNames = {
DatabaseDescriptor.getBootstrapFileLocation(),
DatabaseDescriptor.getLogFileLocation(),
Expand Down

0 comments on commit 5964cd4

Please sign in to comment.