Browse Source

Update for JUnit 3.7.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269037 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 24 years ago
parent
commit
c2c9a383f2
2 changed files with 13 additions and 2 deletions
  1. +2
    -2
      docs/manual/OptionalTasks/junit.html
  2. +11
    -0
      src/testcases/org/apache/tools/ant/IntrospectionHelperTest.java

+ 2
- 2
docs/manual/OptionalTasks/junit.html View File

@@ -9,8 +9,8 @@
<p>This task runs tests from the JUnit testing framework. The latest
version of the framework can be found at
<a href="http://www.junit.org">http://www.junit.org</a>.
This task has been tested with JUnit 3.0 up to JUnit 3.6, it won't
work with versions before JUnit 3.0.</p>
This task has been tested with JUnit 3.0 up to JUnit 3.7, it won't
work with versions prior to JUnit 3.0.</p>

<p>Tests are defined by nested <code>test</code> or
<code>batchtest</code> tags, see <a href="#nested">nested


+ 11
- 0
src/testcases/org/apache/tools/ant/IntrospectionHelperTest.java View File

@@ -368,6 +368,16 @@ public class IntrospectionHelperTest extends TestCase {
h.put("fourteen", java.lang.StringBuffer.class);
h.put("fifteen", java.lang.Character.TYPE);
h.put("sixteen", java.lang.Character.class);

/*
* JUnit 3.7 adds a getName method to TestCase - so we now
* have a name attribute in IntrospectionHelperTest if we run
* under JUnit 3.7 but not in earlier versions.
*
* Simply add it here and remove it after the tests.
*/
h.put("name", java.lang.String.class);

IntrospectionHelper ih = IntrospectionHelper.getHelper(getClass());
Enumeration enum = ih.getAttributes();
while (enum.hasMoreElements()) {
@@ -378,6 +388,7 @@ public class IntrospectionHelperTest extends TestCase {
assertEquals("Type of "+name, expect, ih.getAttributeType(name));
h.remove(name);
}
h.remove("name");
assert("Found all", h.isEmpty());
}



Loading…
Cancel
Save