You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by GitBox <gi...@apache.org> on 2021/11/15 15:01:38 UTC

[GitHub] [ant] azotcsit opened a new pull request #168: junitlauncher - Support extension attribute for listeners

azotcsit opened a new pull request #168:
URL: https://github.com/apache/ant/pull/168


   ### Context
   I'm working on migration of Cassandra to JUnit5 (https://issues.apache.org/jira/browse/CASSANDRA-16630). Our test running code is heavily customized and one of the features we rely on is "extension" attribute (https://github.com/apache/ant/blob/master/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java#L77). Unfortunately, _junitlauncher_ task does not have any equivalent. The purpose of this change is to introduce an option to customize output file extension.
   
   ### Behavior
   Currently `txt` extension is used by default by _junitlauncher_ taks (unlikely to _junit_ task) . This PR preserves the existing behavior.
   
   ### Summary of the changes
   1. Introduced `extension` attribute for `listener`
   2. Updated `LauncherSupport` for the new logic
   3. Updated documentation


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


[GitHub] [ant] azotcsit commented on a change in pull request #168: junitlauncher - Support extension attribute for listeners

Posted by GitBox <gi...@apache.org>.
azotcsit commented on a change in pull request #168:
URL: https://github.com/apache/ant/pull/168#discussion_r749467646



##########
File path: src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/confined/ListenerDefinition.java
##########
@@ -86,6 +87,7 @@ public void setType(final ListenerType type) {
         switch (type.getValue()) {
             case LEGACY_PLAIN: {
                 this.setClassName("org.apache.tools.ant.taskdefs.optional.junitlauncher.LegacyPlainResultFormatter");
+                this.setExtension("xml");

Review comment:
       Oops, that was a last second change. Fixed. Thanks for spotting this!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


[GitHub] [ant] ddevienne commented on a change in pull request #168: junitlauncher - Support extension attribute for listeners

Posted by GitBox <gi...@apache.org>.
ddevienne commented on a change in pull request #168:
URL: https://github.com/apache/ant/pull/168#discussion_r749436750



##########
File path: src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/confined/ListenerDefinition.java
##########
@@ -86,6 +87,7 @@ public void setType(final ListenerType type) {
         switch (type.getValue()) {
             case LEGACY_PLAIN: {
                 this.setClassName("org.apache.tools.ant.taskdefs.optional.junitlauncher.LegacyPlainResultFormatter");
+                this.setExtension("xml");

Review comment:
       Given [line ](https://github.com/apache/ant/pull/168/commits/c1b2fa46c659425633668483f13a4064b965bb54#diff-7fa4f9478ca6c9afa377e09928e5f6718f712361d2f465629e031e479b61675fL289) I'd assume this should be "txt", not "xml"




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


[GitHub] [ant] ddevienne commented on pull request #168: junitlauncher - Support extension attribute for listeners

Posted by GitBox <gi...@apache.org>.
ddevienne commented on pull request #168:
URL: https://github.com/apache/ant/pull/168#issuecomment-969128538


   LGTM now, FWIW. Thanks, --DD


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


[GitHub] [ant] asfgit closed pull request #168: junitlauncher - Support extension attribute for listeners

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #168:
URL: https://github.com/apache/ant/pull/168


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


[GitHub] [ant] azotcsit commented on pull request #168: junitlauncher - Support extension attribute for listeners

Posted by GitBox <gi...@apache.org>.
azotcsit commented on pull request #168:
URL: https://github.com/apache/ant/pull/168#issuecomment-970253914


   @ddevienne @jaikiran thanks for the quick review and merge!
   
   PS:
   Previously I was written down as "Alex", since that time I've changed my GitHub name to "Aleksei Zotov".


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


[GitHub] [ant] jaikiran commented on pull request #168: junitlauncher - Support extension attribute for listeners

Posted by GitBox <gi...@apache.org>.
jaikiran commented on pull request #168:
URL: https://github.com/apache/ant/pull/168#issuecomment-970228370


   This now looks fine to me. Thank you for this contribution @azotcsit. I'll merge this shortly. I thought you had already contributed to Ant before, but I can't find your name in our contributors list. I will add `Aleksei Zotov` to that list while merging this PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


[GitHub] [ant] jaikiran commented on a change in pull request #168: junitlauncher - Support extension attribute for listeners

Posted by GitBox <gi...@apache.org>.
jaikiran commented on a change in pull request #168:
URL: https://github.com/apache/ant/pull/168#discussion_r750162872



##########
File path: manual/Tasks/junitlauncher.html
##########
@@ -366,6 +366,13 @@ <h5>Test result formatter</h5>
         </td>
         <td>No</td>
     </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>txt</q></td>

Review comment:
       Hello @azotcsit, I think the "defaults to txt" part will be misleading since for the legacy-xml formatter it will rightly default to `xml`. Perhaps, change this part to "defaults to `xml` for the `legacy-xml` formatter and to `txt` for the rest"?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


[GitHub] [ant] ddevienne commented on a change in pull request #168: junitlauncher - Support extension attribute for listeners

Posted by GitBox <gi...@apache.org>.
ddevienne commented on a change in pull request #168:
URL: https://github.com/apache/ant/pull/168#discussion_r749436750



##########
File path: src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/confined/ListenerDefinition.java
##########
@@ -86,6 +87,7 @@ public void setType(final ListenerType type) {
         switch (type.getValue()) {
             case LEGACY_PLAIN: {
                 this.setClassName("org.apache.tools.ant.taskdefs.optional.junitlauncher.LegacyPlainResultFormatter");
+                this.setExtension("xml");

Review comment:
       Given line 289 in LauncherSupport.java, I'd assume this should be "txt", not "xml"




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


[GitHub] [ant] ddevienne commented on a change in pull request #168: junitlauncher - Support extension attribute for listeners

Posted by GitBox <gi...@apache.org>.
ddevienne commented on a change in pull request #168:
URL: https://github.com/apache/ant/pull/168#discussion_r749439781



##########
File path: src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/confined/ListenerDefinition.java
##########
@@ -86,6 +87,7 @@ public void setType(final ListenerType type) {
         switch (type.getValue()) {
             case LEGACY_PLAIN: {
                 this.setClassName("org.apache.tools.ant.taskdefs.optional.junitlauncher.LegacyPlainResultFormatter");
+                this.setExtension("xml");

Review comment:
       OK, given line 57, which defaults the extension to "txt", this xml should go to line 97/99 instead, no?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


[GitHub] [ant] azotcsit commented on a change in pull request #168: junitlauncher - Support extension attribute for listeners

Posted by GitBox <gi...@apache.org>.
azotcsit commented on a change in pull request #168:
URL: https://github.com/apache/ant/pull/168#discussion_r750189315



##########
File path: manual/Tasks/junitlauncher.html
##########
@@ -366,6 +366,13 @@ <h5>Test result formatter</h5>
         </td>
         <td>No</td>
     </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>txt</q></td>

Review comment:
       Sounds reasonable, I've changed it. Thanks @jaikiran!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org