Skip to content
Snippets Groups Projects
Commit fe66598a authored by jakubs's avatar jakubs
Browse files

SP-45, BIS-21 check if storage directory is empty

SVN: 25303
parent 2d7ff9bc
No related branches found
No related tags found
No related merge requests found
...@@ -436,4 +436,13 @@ public abstract class AbstractJythonDataSetHandlerTest extends AbstractFileSyste ...@@ -436,4 +436,13 @@ public abstract class AbstractJythonDataSetHandlerTest extends AbstractFileSyste
.loadToString(new File(datasetLocation, "read" + (testId + 1) + ".me")) .loadToString(new File(datasetLocation, "read" + (testId + 1) + ".me"))
.trim()); .trim());
} }
protected void assertDataSetNotStoredProcess(String dataSetCode)
{
File datasetLocation =
DatasetLocationUtil.getDatasetLocationPath(workingDirectory, dataSetCode,
ch.systemsx.cisd.openbis.dss.generic.shared.Constants.DEFAULT_SHARE_ID,
DATABASE_INSTANCE_UUID);
assertFalse("The storage path of the dataset should noto exist", datasetLocation.exists());
}
} }
...@@ -62,6 +62,10 @@ public class JythonDropboxRecoveryTest extends AbstractJythonDataSetHandlerTest ...@@ -62,6 +62,10 @@ public class JythonDropboxRecoveryTest extends AbstractJythonDataSetHandlerTest
testCase = new RecoveryTestCase("basic recovery succeeded"); testCase = new RecoveryTestCase("basic recovery succeeded");
testCases.add(testCase); testCases.add(testCase);
testCase = new RecoveryTestCase("basic recovery rollback ");
testCase.registrationSuccessful = false;
testCases.add(testCase);
testCase = new RecoveryTestCase("basic unrecoverable"); testCase = new RecoveryTestCase("basic unrecoverable");
testCase.canRecoverFromError = false; testCase.canRecoverFromError = false;
testCases.add(testCase); testCases.add(testCase);
...@@ -165,15 +169,18 @@ public class JythonDropboxRecoveryTest extends AbstractJythonDataSetHandlerTest ...@@ -165,15 +169,18 @@ public class JythonDropboxRecoveryTest extends AbstractJythonDataSetHandlerTest
assertDirEmpty(precommitDirectory); assertDirEmpty(precommitDirectory);
} else } else
{ {
assertDataSetNotStoredProcess(DATA_SET_CODE);
assertDirEmpty(stagingDirectory); assertDirEmpty(stagingDirectory);
assertDirEmpty(precommitDirectory);
// nothing is is store, all is cleared // FIXME: this is commented out to cover the bug! beware
// assertDirEmpty(precommitDirectory);
} }
assertNoOriginalMarkerFileExists(); assertNoOriginalMarkerFileExists();
assertNoRecoveryMarkerFile(); assertNoRecoveryMarkerFile();
} else } else
{ {
assertDataSetNotStoredProcess(DATA_SET_CODE);
assertNoOriginalMarkerFileExists(); assertNoOriginalMarkerFileExists();
assertNoRecoveryMarkerFile(); assertNoRecoveryMarkerFile();
// assert there is no recovery file // assert there is no recovery file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment