Browse Source

Restored Java 5 compilability.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1453118 13f79535-47bb-0310-9956-ffa450edef68
master
Jesse N. Glick 12 years ago
parent
commit
cefa594fa6
4 changed files with 3 additions and 16 deletions
  1. +1
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/junit/BriefJUnitResultFormatter.java
  2. +1
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/junit/PlainJUnitResultFormatter.java
  3. +0
    -7
      src/main/org/apache/tools/ant/taskdefs/optional/junit/TestListenerWrapper.java
  4. +1
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java

+ 1
- 3
src/main/org/apache/tools/ant/taskdefs/optional/junit/BriefJUnitResultFormatter.java View File

@@ -273,13 +273,12 @@ public class BriefJUnitResultFormatter implements JUnitResultFormatter, IgnoredT
}


@Override
public void testIgnored(Test test) {
String message = null;
if (test instanceof JUnit4TestCaseFacade) {
JUnit4TestCaseFacade facade = (JUnit4TestCaseFacade) test;
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();
}
}
@@ -305,7 +304,6 @@ public class BriefJUnitResultFormatter implements JUnitResultFormatter, IgnoredT

}

@Override
public void testAssumptionFailure(Test test, Throwable cause) {
formatSkip(test, cause.getMessage());
}


+ 1
- 3
src/main/org/apache/tools/ant/taskdefs/optional/junit/PlainJUnitResultFormatter.java View File

@@ -263,13 +263,12 @@ public class PlainJUnitResultFormatter implements JUnitResultFormatter, IgnoredT
}
}

@Override
public void testIgnored(Test test) {
String message = null;
if (test instanceof JUnit4TestCaseFacade) {
JUnit4TestCaseFacade facade = (JUnit4TestCaseFacade) test;
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();
}
}
@@ -295,7 +294,6 @@ public class PlainJUnitResultFormatter implements JUnitResultFormatter, IgnoredT

}

@Override
public void testAssumptionFailure(Test test, Throwable throwable) {
formatSkip(test, throwable.getMessage());
}


+ 0
- 7
src/main/org/apache/tools/ant/taskdefs/optional/junit/TestListenerWrapper.java View File

@@ -36,39 +36,32 @@ public class TestListenerWrapper implements TestListener, IgnoredTestListener {
wrapped = listener;
}

@Override
public void addError(Test test, Throwable throwable) {
wrapped.addError(test, throwable);
}

@Override
public void addFailure(Test test, AssertionFailedError assertionFailedError) {
wrapped.addFailure(test, assertionFailedError);
}

@Override
public void endTest(Test test) {
wrapped.endTest(test);
}

@Override
public void startTest(Test test) {
wrapped.startTest(test);
}

@Override
public void testIgnored(Test test) {
if (wrapped instanceof IgnoredTestListener) {
((IgnoredTestListener)wrapped).testIgnored(test);
}
}

@Override
public void testAssumptionFailure(Test test, Throwable throwable) {
if (wrapped instanceof IgnoredTestListener) {
((IgnoredTestListener)wrapped).testAssumptionFailure(test, throwable);
}
}


}

+ 1
- 3
src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java View File

@@ -322,7 +322,6 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
nested.appendChild(doc.createCDATASection(output));
}

@Override
public void testIgnored(Test test) {
String message = null;
if (test != null && test instanceof JUnit4TestCaseFacade) {
@@ -336,7 +335,7 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
Method testMethod = testClass.getMethod(JUnitVersionHelper.getTestCaseName(test));
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();
}
} catch (NoSuchMethodException e) {
@@ -374,7 +373,6 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan

}

@Override
public void testAssumptionFailure(Test test, Throwable failure) {
String message = failure.getMessage();
formatSkip(test, message);


Loading…
Cancel
Save