git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1453118 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -273,13 +273,12 @@ public class BriefJUnitResultFormatter implements JUnitResultFormatter, IgnoredT | |||||
| } | } | ||||
| @Override | |||||
| public void testIgnored(Test test) { | public void testIgnored(Test test) { | ||||
| String message = null; | String message = null; | ||||
| if (test instanceof JUnit4TestCaseFacade) { | if (test instanceof JUnit4TestCaseFacade) { | ||||
| JUnit4TestCaseFacade facade = (JUnit4TestCaseFacade) test; | JUnit4TestCaseFacade facade = (JUnit4TestCaseFacade) test; | ||||
| Ignore annotation = facade.getDescription().getAnnotation(Ignore.class); | Ignore annotation = facade.getDescription().getAnnotation(Ignore.class); | ||||
| if (annotation != null && annotation.value() != null && !annotation.value().isEmpty()) { | |||||
| if (annotation != null && annotation.value().length() > 0) { | |||||
| message = annotation.value(); | message = annotation.value(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -305,7 +304,6 @@ public class BriefJUnitResultFormatter implements JUnitResultFormatter, IgnoredT | |||||
| } | } | ||||
| @Override | |||||
| public void testAssumptionFailure(Test test, Throwable cause) { | public void testAssumptionFailure(Test test, Throwable cause) { | ||||
| formatSkip(test, cause.getMessage()); | formatSkip(test, cause.getMessage()); | ||||
| } | } | ||||
| @@ -263,13 +263,12 @@ public class PlainJUnitResultFormatter implements JUnitResultFormatter, IgnoredT | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public void testIgnored(Test test) { | public void testIgnored(Test test) { | ||||
| String message = null; | String message = null; | ||||
| if (test instanceof JUnit4TestCaseFacade) { | if (test instanceof JUnit4TestCaseFacade) { | ||||
| JUnit4TestCaseFacade facade = (JUnit4TestCaseFacade) test; | JUnit4TestCaseFacade facade = (JUnit4TestCaseFacade) test; | ||||
| Ignore annotation = facade.getDescription().getAnnotation(Ignore.class); | Ignore annotation = facade.getDescription().getAnnotation(Ignore.class); | ||||
| if (annotation != null && annotation.value() != null && !annotation.value().isEmpty()) { | |||||
| if (annotation != null && annotation.value().length() > 0) { | |||||
| message = annotation.value(); | message = annotation.value(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -295,7 +294,6 @@ public class PlainJUnitResultFormatter implements JUnitResultFormatter, IgnoredT | |||||
| } | } | ||||
| @Override | |||||
| public void testAssumptionFailure(Test test, Throwable throwable) { | public void testAssumptionFailure(Test test, Throwable throwable) { | ||||
| formatSkip(test, throwable.getMessage()); | formatSkip(test, throwable.getMessage()); | ||||
| } | } | ||||
| @@ -36,39 +36,32 @@ public class TestListenerWrapper implements TestListener, IgnoredTestListener { | |||||
| wrapped = listener; | wrapped = listener; | ||||
| } | } | ||||
| @Override | |||||
| public void addError(Test test, Throwable throwable) { | public void addError(Test test, Throwable throwable) { | ||||
| wrapped.addError(test, throwable); | wrapped.addError(test, throwable); | ||||
| } | } | ||||
| @Override | |||||
| public void addFailure(Test test, AssertionFailedError assertionFailedError) { | public void addFailure(Test test, AssertionFailedError assertionFailedError) { | ||||
| wrapped.addFailure(test, assertionFailedError); | wrapped.addFailure(test, assertionFailedError); | ||||
| } | } | ||||
| @Override | |||||
| public void endTest(Test test) { | public void endTest(Test test) { | ||||
| wrapped.endTest(test); | wrapped.endTest(test); | ||||
| } | } | ||||
| @Override | |||||
| public void startTest(Test test) { | public void startTest(Test test) { | ||||
| wrapped.startTest(test); | wrapped.startTest(test); | ||||
| } | } | ||||
| @Override | |||||
| public void testIgnored(Test test) { | public void testIgnored(Test test) { | ||||
| if (wrapped instanceof IgnoredTestListener) { | if (wrapped instanceof IgnoredTestListener) { | ||||
| ((IgnoredTestListener)wrapped).testIgnored(test); | ((IgnoredTestListener)wrapped).testIgnored(test); | ||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public void testAssumptionFailure(Test test, Throwable throwable) { | public void testAssumptionFailure(Test test, Throwable throwable) { | ||||
| if (wrapped instanceof IgnoredTestListener) { | if (wrapped instanceof IgnoredTestListener) { | ||||
| ((IgnoredTestListener)wrapped).testAssumptionFailure(test, throwable); | ((IgnoredTestListener)wrapped).testAssumptionFailure(test, throwable); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -322,7 +322,6 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan | |||||
| nested.appendChild(doc.createCDATASection(output)); | nested.appendChild(doc.createCDATASection(output)); | ||||
| } | } | ||||
| @Override | |||||
| public void testIgnored(Test test) { | public void testIgnored(Test test) { | ||||
| String message = null; | String message = null; | ||||
| if (test != null && test instanceof JUnit4TestCaseFacade) { | if (test != null && test instanceof JUnit4TestCaseFacade) { | ||||
| @@ -336,7 +335,7 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan | |||||
| Method testMethod = testClass.getMethod(JUnitVersionHelper.getTestCaseName(test)); | Method testMethod = testClass.getMethod(JUnitVersionHelper.getTestCaseName(test)); | ||||
| Ignore annotation = testMethod.getAnnotation(Ignore.class); | Ignore annotation = testMethod.getAnnotation(Ignore.class); | ||||
| if (annotation != null && annotation.value() != null && !annotation.value().isEmpty()) { | |||||
| if (annotation != null && annotation.value().length() > 0) { | |||||
| message = annotation.value(); | message = annotation.value(); | ||||
| } | } | ||||
| } catch (NoSuchMethodException e) { | } catch (NoSuchMethodException e) { | ||||
| @@ -374,7 +373,6 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan | |||||
| } | } | ||||
| @Override | |||||
| public void testAssumptionFailure(Test test, Throwable failure) { | public void testAssumptionFailure(Test test, Throwable failure) { | ||||
| String message = failure.getMessage(); | String message = failure.getMessage(); | ||||
| formatSkip(test, message); | formatSkip(test, message); | ||||