This closes #168 pull request at github.com/apache/antmaster
| @@ -8,6 +8,7 @@ Adam Sotona | |||||
| Adrian Nistor | Adrian Nistor | ||||
| Adrien Grand | Adrien Grand | ||||
| Aleksandr Ishutin | Aleksandr Ishutin | ||||
| Aleksei Zotov | |||||
| Alex | Alex | ||||
| Alex Rosen | Alex Rosen | ||||
| Alexander Grund | Alexander Grund | ||||
| @@ -8,6 +8,11 @@ Other changes: | |||||
| repackaged Jakarta Mail package rather than javax Mail. | repackaged Jakarta Mail package rather than javax Mail. | ||||
| Github Pull Request #161 | Github Pull Request #161 | ||||
| * The "listener" element in the junitlauncher task now supports | |||||
| an "extension" attribute to control the filename extension | |||||
| of the generated output file from the listener. | |||||
| Github Pull Request #168 | |||||
| Changes from Ant 1.10.11 TO Ant 1.10.12 | Changes from Ant 1.10.11 TO Ant 1.10.12 | ||||
| ======================================= | ======================================= | ||||
| @@ -62,6 +62,10 @@ | |||||
| <first>Aleksandr</first> | <first>Aleksandr</first> | ||||
| <last>Ishutin</last> | <last>Ishutin</last> | ||||
| </name> | </name> | ||||
| <name> | |||||
| <first>Aleksei</first> | |||||
| <last>Zotov</last> | |||||
| </name> | |||||
| <name> | <name> | ||||
| <first>Alex</first> | <first>Alex</first> | ||||
| <last></last> | <last></last> | ||||
| @@ -354,7 +354,7 @@ | |||||
| If no value is specified for this attribute and the listener implements | If no value is specified for this attribute and the listener implements | ||||
| the <code>org.apache.tools.ant.taskdefs.optional.junitlauncher.TestResultFormatter</code> | the <code>org.apache.tools.ant.taskdefs.optional.junitlauncher.TestResultFormatter</code> | ||||
| then the file name will be defaulted to and will be of the | then the file name will be defaulted to and will be of the | ||||
| form <code>TEST-<i>testname</i>.<i>formatter-specific-extension</i></code> | |||||
| form <code>TEST-<i>testname</i>.<i>extension</i></code> | |||||
| (ex: <samp>TEST-org.myapp.SomeTest.xml</samp> for the <q>legacy-xml</q> type | (ex: <samp>TEST-org.myapp.SomeTest.xml</samp> for the <q>legacy-xml</q> type | ||||
| formatter) | formatter) | ||||
| </p> | </p> | ||||
| @@ -366,6 +366,13 @@ | |||||
| </td> | </td> | ||||
| <td>No</td> | <td>No</td> | ||||
| </tr> | </tr> | ||||
| <tr> | |||||
| <td>extension</td> | |||||
| <td>Extension to append to the output filename. | |||||
| <p><em>Since Ant 1.10.13</em></p> | |||||
| </td> | |||||
| <td>No; defaults to <q>xml</q> for the <q>legacy-xml</q> formatter and to <q>txt</q> for the rest</td> | |||||
| </tr> | |||||
| <tr> | <tr> | ||||
| <td>outputDir</td> | <td>outputDir</td> | ||||
| <td>Directory into which to create the output of the listener. | <td>Directory into which to create the output of the listener. | ||||
| @@ -406,10 +413,10 @@ | |||||
| <tr> | <tr> | ||||
| <td>useLegacyReportingName</td> | <td>useLegacyReportingName</td> | ||||
| <td>Set to true, if the test identifiers reported by this listener should use legacy (JUnit4 | <td>Set to true, if the test identifiers reported by this listener should use legacy (JUnit4 | ||||
| style) names. Else set to false. Defaults to true. | |||||
| style) names. Else set to false. | |||||
| <p><em>Since Ant 1.10.10</em></p> | <p><em>Since Ant 1.10.10</em></p> | ||||
| </td> | </td> | ||||
| <td>No</td> | |||||
| <td>No; defaults to <q>true</q></td> | |||||
| </tr> | </tr> | ||||
| </table> | </table> | ||||
| @@ -282,13 +282,7 @@ public class LauncherSupport { | |||||
| final StringBuilder sb = new StringBuilder("TEST-"); | final StringBuilder sb = new StringBuilder("TEST-"); | ||||
| sb.append(testRequest.getName() == null ? "unknown" : testRequest.getName()); | sb.append(testRequest.getName() == null ? "unknown" : testRequest.getName()); | ||||
| sb.append("."); | sb.append("."); | ||||
| final String suffix; | |||||
| if ("org.apache.tools.ant.taskdefs.optional.junitlauncher.LegacyXmlResultFormatter".equals(listener.getClassName())) { | |||||
| suffix = "xml"; | |||||
| } else { | |||||
| suffix = "txt"; | |||||
| } | |||||
| sb.append(suffix); | |||||
| sb.append(listener.getExtension()); | |||||
| filename = sb.toString(); | filename = sb.toString(); | ||||
| } | } | ||||
| if (listener.getOutputDir() != null) { | if (listener.getOutputDir() != null) { | ||||
| @@ -49,6 +49,7 @@ public class ListenerDefinition { | |||||
| private String unlessProperty; | private String unlessProperty; | ||||
| private String className; | private String className; | ||||
| private String resultFile; | private String resultFile; | ||||
| private String extension = "txt"; | |||||
| private boolean sendSysOut; | private boolean sendSysOut; | ||||
| private boolean sendSysErr; | private boolean sendSysErr; | ||||
| private String outputDir; | private String outputDir; | ||||
| @@ -94,6 +95,7 @@ public class ListenerDefinition { | |||||
| } | } | ||||
| case LEGACY_XML: { | case LEGACY_XML: { | ||||
| this.setClassName("org.apache.tools.ant.taskdefs.optional.junitlauncher.LegacyXmlResultFormatter"); | this.setClassName("org.apache.tools.ant.taskdefs.optional.junitlauncher.LegacyXmlResultFormatter"); | ||||
| this.setExtension("xml"); | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| @@ -107,6 +109,20 @@ public class ListenerDefinition { | |||||
| return this.resultFile; | return this.resultFile; | ||||
| } | } | ||||
| /** | |||||
| * Sets the output file extension for this listener. | |||||
| * | |||||
| * @param extension file extension to use | |||||
| * @since Ant 1.10.13 | |||||
| */ | |||||
| public void setExtension(String extension) { | |||||
| this.extension = extension; | |||||
| } | |||||
| public String getExtension() { | |||||
| return extension; | |||||
| } | |||||
| public void setSendSysOut(final boolean sendSysOut) { | public void setSendSysOut(final boolean sendSysOut) { | ||||
| this.sendSysOut = sendSysOut; | this.sendSysOut = sendSysOut; | ||||
| } | } | ||||