diff --git a/WHATSNEW b/WHATSNEW index 86f2e4c265..7b5d45fe98 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -7,6 +7,11 @@ Fixed bugs: * FTP task no longer duplicates a check for a file being a symlink. Bugzilla Report 63259 + * junitlauncher task, when used in fork mode with "", + used to create the wrong number of listeners per test class. This + has now been fixed. + Bugzilla Report 63446 + Changes from Ant 1.10.5 TO Ant 1.10.6 ===================================== diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/confined/TestClasses.java b/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/confined/TestClasses.java index f119a348b4..96eddcdc84 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/confined/TestClasses.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/confined/TestClasses.java @@ -110,12 +110,13 @@ protected void toForkedRepresentation(final JUnitLauncherTask task, final XMLStr public static List fromForkedRepresentation(final XMLStreamReader reader) throws XMLStreamException { reader.require(XMLStreamConstants.START_ELEMENT, null, LD_XML_ELM_TEST_CLASSES); - final TestClasses testDefinition = new TestClasses(); + final List testDefinitions = new ArrayList<>(); // read out as multiple SingleTestClass representations while (reader.nextTag() != XMLStreamConstants.END_ELEMENT) { + final SingleTestClass testDefinition = new SingleTestClass(); reader.require(XMLStreamConstants.START_ELEMENT, null, Constants.LD_XML_ELM_TEST); final String testClassName = requireAttributeValue(reader, LD_XML_ATTR_CLASS_NAME); - testDefinition.add(new StringResource(testClassName + ".class")); + testDefinition.setName(testClassName); final String halt = reader.getAttributeValue(null, LD_XML_ATTR_HALT_ON_FAILURE); if (halt != null) { testDefinition.setHaltOnFailure(Boolean.parseBoolean(halt)); @@ -137,9 +138,10 @@ public static List fromForkedRepresentation(final XMLStreamReade testDefinition.addConfiguredListener(ListenerDefinition.fromForkedRepresentation(reader)); } reader.require(XMLStreamConstants.END_ELEMENT, null, Constants.LD_XML_ELM_TEST); + testDefinitions.add(testDefinition); } reader.require(XMLStreamConstants.END_ELEMENT, null, LD_XML_ELM_TEST_CLASSES); - return Collections.singletonList(testDefinition); + return Collections.unmodifiableList(testDefinitions); } private static String requireAttributeValue(final XMLStreamReader reader, final String attrName) throws XMLStreamException {