diff --git a/test/java/foundation/pEp/pitytest/TestUnit.java b/test/java/foundation/pEp/pitytest/TestUnit.java index 1e4429d..d195cbb 100644 --- a/test/java/foundation/pEp/pitytest/TestUnit.java +++ b/test/java/foundation/pEp/pitytest/TestUnit.java @@ -90,7 +90,11 @@ public class TestUnit implements Runnable { } public Throwable getLastException() { - return lastException; + Throwable ret = new Throwable("No Exception caught"); + if(lastException != null) { + ret = lastException; + } + return ret; } public TestUnit add(TestSuite suite) { @@ -115,7 +119,7 @@ public class TestUnit implements Runnable { public void run() { TestUtils.standardOutErrEnabled(verboseMode); if (ctx.isUninitializable()) { - setTestState(TestState.CTX_FAIL); + setTestState(TestState.SKIPPED); TestUtils.standardOutErrEnabled(true); } else { try { @@ -177,7 +181,6 @@ public class TestUnit implements Runnable { } case CTX_FAIL: { setTestResult(TestState.SKIPPED); -// logH1(makeLogString()); break; } } @@ -188,7 +191,7 @@ public class TestUnit implements Runnable { result = r; TestUtils.standardOutErrEnabled(true); logH1(makeLogString()); - if (result == TestState.FAILED || result == TestState.CTX_FAIL) { + if (result == TestState.FAILED || state == TestState.CTX_FAIL) { log("ERROR: " + getLastException().toString()); } if (verboseMode) logRaw("\n\n");