Stefan Bodewig 8 years ago
parent
commit
2ec41afdca
2 changed files with 21 additions and 0 deletions
  1. +4
    -0
      WHATSNEW
  2. +17
    -0
      src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java

+ 4
- 0
WHATSNEW View File

@@ -31,6 +31,10 @@ Other changes:
* reduced GC pressure by replacing all usage of FileInputStream and * reduced GC pressure by replacing all usage of FileInputStream and
FileOutputStream. FileOutputStream.


* Task can now also use attribute setters that expect a
java.nio.file.Path argument.
Bugzilla Report 61042

Changes from Ant 1.10.0 TO Ant 1.10.1 Changes from Ant 1.10.0 TO Ant 1.10.1
===================================== =====================================




+ 17
- 0
src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java View File

@@ -21,6 +21,8 @@ package org.apache.tools.ant;
import java.io.File; import java.io.File;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.HashMap; import java.util.HashMap;
import java.util.Hashtable; import java.util.Hashtable;
@@ -466,6 +468,7 @@ public class IntrospectionHelperTest {
attrMap.put("seventeen", Byte.TYPE); attrMap.put("seventeen", Byte.TYPE);
attrMap.put("eightteen", Short.TYPE); attrMap.put("eightteen", Short.TYPE);
attrMap.put("nineteen", Double.TYPE); attrMap.put("nineteen", Double.TYPE);
attrMap.put("twenty", Path.class);


/* /*
* JUnit 3.7 adds a getName method to TestCase - so we now * JUnit 3.7 adds a getName method to TestCase - so we now
@@ -546,6 +549,8 @@ public class IntrospectionHelperTest {
new Short((short)18), new Short((short)10)); new Short((short)18), new Short((short)10));
assertAttrMethod("nineteen", "setNineteen", Double.TYPE, assertAttrMethod("nineteen", "setNineteen", Double.TYPE,
new Double(19), new Double((short)10)); new Double(19), new Double((short)10));
assertAttrMethod("twenty", "setTwenty", Path.class,
new File(projectBasedir + 20).toPath(), Paths.get("toto"));


try { try {
assertAttrMethod("onehundred", null, null, null, null); assertAttrMethod("onehundred", null, null, null, null);
@@ -634,6 +639,18 @@ public class IntrospectionHelperTest {
assertTrue("Expected 19, received " + d, diff > -1e-6 && diff < 1e-6); assertTrue("Expected 19, received " + d, diff > -1e-6 && diff < 1e-6);
} }


public void setTwenty(Path p) {
String path = p.toAbsolutePath().toString();
if (Os.isFamily("unix") || Os.isFamily("openvms")) {
assertEquals(projectBasedir+"20", path);
} else if (Os.isFamily("netware")) {
assertEquals(projectBasedir+"20", path.toLowerCase(Locale.US));
} else {
assertEquals(":"+projectBasedir+"20",
path.toLowerCase(Locale.US).substring(1));
}
}

@Test @Test
public void testGetExtensionPoints() { public void testGetExtensionPoints() {
List extensions = ih.getExtensionPoints(); List extensions = ih.getExtensionPoints();


Loading…
Cancel
Save