From a6691df972e5dcf5e955f9a75bbba36b7a591c9e Mon Sep 17 00:00:00 2001 From: wisberg Date: Wed, 29 Oct 2003 08:50:34 +0000 Subject: [PATCH] better mapping from messages to JUnit failure/error --- .../testing/drivers/HarnessJUnitUtil.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/testing-drivers/testsrc/org/aspectj/testing/drivers/HarnessJUnitUtil.java b/testing-drivers/testsrc/org/aspectj/testing/drivers/HarnessJUnitUtil.java index 17eef7c34..77c38c35d 100644 --- a/testing-drivers/testsrc/org/aspectj/testing/drivers/HarnessJUnitUtil.java +++ b/testing-drivers/testsrc/org/aspectj/testing/drivers/HarnessJUnitUtil.java @@ -88,9 +88,9 @@ public class HarnessJUnitUtil { /** * Dump results for Test from status into TestResult. - * This defers to the status to determine if it failed, - * and treats ABORT as errors - * and everything else as failures. + * FAIL is a failure, + * ERROR and ABORT are errors, + * and INFO, WARNING, and DEBUG are ignored. * @param result the TestResult sink * @param status the IRunStatus source * @param test the Test to associate with the results @@ -103,13 +103,15 @@ public class HarnessJUnitUtil { Test test, int numIncomplete) { if (!status.runResult()) { - String m = render(status, null); - AssertionFailedError failure = new AssertionFailedError(m); - if (status.hasAnyMessage(IMessage.ABORT, true)) { - result.addError(test, failure); - } else { + if (status.hasAnyMessage(IMessage.FAIL, false)) { + String m = render(status, null); + AssertionFailedError failure = new AssertionFailedError(m); result.addFailure(test, failure); - } + } else if (status.hasAnyMessage(IMessage.ERROR, true)) { + String m = render(status, null); + AssertionFailedError failure = new AssertionFailedError(m); + result.addError(test, failure); + } // /XXX skip INFO, DEBUG } return 0; // XXX not doing incomplete } -- 2.39.5