diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/registrator/JythonTopLevelDataSetRegistratorTest.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/registrator/JythonTopLevelDataSetRegistratorTest.java index 588d4d347832e84cae6cc3da9151d69a394b7964..fc425f841f6f65dc433a6b2a117a4b719f307abc 100644 --- a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/registrator/JythonTopLevelDataSetRegistratorTest.java +++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/registrator/JythonTopLevelDataSetRegistratorTest.java @@ -239,6 +239,12 @@ public class JythonTopLevelDataSetRegistratorTest extends AbstractJythonDataSetH testCase.failurePoint = TestCaseParameters.FailurePoint.BEFORE_OPENBIS_REGISTRATION; testCases.add(testCase); + testCase = + new TestCaseParameters( + "Postregistration hook error should not prevent succesfull registration."); + testCase.dropboxScriptPath = "testcase-postregistration-hook-failed.py"; + testCases.add(testCase); + // TODO: Add more scenarios: // - Test move to error // - Test moving of the original file in case of validation error diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/registrator/testcase-postregistration-hook-failed.py b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/registrator/testcase-postregistration-hook-failed.py new file mode 100644 index 0000000000000000000000000000000000000000..329dbdd98124611beac0a8587dcc9e1592c2156b --- /dev/null +++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/registrator/testcase-postregistration-hook-failed.py @@ -0,0 +1,11 @@ +from java.lang import IllegalArgumentException + +execfile("sourceTest/java/ch/systemsx/cisd/etlserver/registrator/all-hooks.py") + +def post_metadata_registration(transaction, context): + global didPostRegistrationFunctionRunHappen + didPostRegistrationFunctionRunHappen = True + raise IllegalArgumentException("Fail at post_metadata_registration to cancel registration") + +execfile("sourceTest/java/ch/systemsx/cisd/etlserver/registrator/simple-transaction.py") +