Skip to content

Commit

Permalink
Added: xmlpathinjar to the TestNG ant task
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeust committed Jul 6, 2011
1 parent 3119d7f commit 55b90e7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
Current

Added: xmlpathinjar to the TestNG ant task

===========================================================================

6.1.1
7/5/2011

Fixed: https://github.com/cbeust/testng/issues/56 testng-results.xml was reporting the instance name instead of the method name
Fixed: NPE when using preserve-order and factories.
Fixed: Depending on a skipped method would not cause a method to be skipped
Expand Down
6 changes: 6 additions & 0 deletions doc/ant.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ <h2 align="center">TestNG Ant Task</h2>
under.</td>
<td>&nbsp;</td>
</tr>

<tr>
<td><tt>useDefaultListeners</tt></td>
<td>Whether the default listeners and reporters should be used.</td>
Expand All @@ -250,6 +251,11 @@ <h2 align="center">TestNG Ant Task</h2>
<td>&nbsp; </td>
</tr>

<tr>
<td><tt>xmlPathInJar</tt></td>
<td>The path of the XML file inside the jar file, only applicable if <tt>testJar</tt> was specified</td>
<td>testng.xml</td>
</tr>
</table>
<br>
One of attributes <tt>classpath</tt>, <tt>classpathref</tt> or nested <tt>
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/org/testng/TestNGAntTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ public void setExcludedGroups(String groups) {

private Integer m_suiteThreadPoolSize;

private String m_xmlPathInJar;

public void setVerbose(Integer verbose) {
m_verbose= verbose;
}
Expand Down Expand Up @@ -629,6 +631,14 @@ public void execute() throws BuildException {
argv.add(m_suiteThreadPoolSize.toString());
}

if (m_xmlPathInJar != null) {
argv.add(CommandLineArgs.XML_PATH_IN_JAR);
argv.add(m_xmlPathInJar);
}

//
// Done with command line options, now add the XML files
//
for (String file : getSuiteFileNames()) {
argv.add(file);
}
Expand Down Expand Up @@ -1103,6 +1113,9 @@ public void setSkipFailedInvocationCounts(boolean skip) {
m_skipFailedInvocationCounts = Boolean.valueOf(skip);
}

public void setXmlPathInJar(String path) {
m_xmlPathInJar = path;
}
/**
* Add the referenced property set as system properties for the TestNG JVM.
*
Expand Down

0 comments on commit 55b90e7

Please sign in to comment.