Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

followup on pull #178 #180

Merged
merged 6 commits into from Mar 20, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/ant.html
Expand Up @@ -137,8 +137,8 @@ <h2 align="center">TestNG Ant Task</h2>


<tr> <tr>
<td><tt>mode</tt></td> <td><tt>mode</tt></td>
<td>Either <tt>TESTNG</tt>, <tt>JUNIT</tt> or <tt>MIXED</tt>. Whether TestNG should run only TestNG tests, JUnit tests or both.</td> <td>Either <tt>"testng"</tt>, <tt>"junit"</tt> or <tt>"mixed"</tt>. Whether TestNG should run only TestNG tests, JUnit tests or both.</td>
<td>No. Defaults to TESTNG.</td> <td>No. Defaults to "testng".</td>
</tr> </tr>


<tr> <tr>
Expand Down
3 changes: 1 addition & 2 deletions doc/migrating.html
Expand Up @@ -90,8 +90,7 @@ <h4>Example - replacing JUnit Ant task with TestNG one</h4>
&lt;propertyref prefix="test-sys-prop."/&gt; &lt;propertyref prefix="test-sys-prop."/&gt;
&lt;mapper from="test-sys-prop.*" to="*" type="glob"/&gt; &lt;mapper from="test-sys-prop.*" to="*" type="glob"/&gt;
&lt;/propertyset&gt; &lt;/propertyset&gt;
&lt;jvmarg line="${run.jvmargs.prop}"/&gt; &lt;jvmarg line="${run.jvmargs}"/&gt;
&lt;jvmarg line="${endorsed.classpath.cmd.line.arg}"/&gt;
&lt;/testng&gt; &lt;/testng&gt;
</pre> </pre>


Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/testng/TestNG.java
Expand Up @@ -517,7 +517,10 @@ private List<XmlSuite> createCommandLineSuitesForMethods(List<String> commandLin
// //
Set<Class> classes = Sets.newHashSet(); Set<Class> classes = Sets.newHashSet();
for (String m : commandLineMethods) { for (String m : commandLineMethods) {
classes.add(ClassHelper.forName(splitMethod(m)[0])); Class c = ClassHelper.forName(splitMethod(m)[0]);
if (c != null) {
classes.add(c);
}
} }


List<XmlSuite> result = createCommandLineSuitesForClasses(classes.toArray(new Class[0])); List<XmlSuite> result = createCommandLineSuitesForClasses(classes.toArray(new Class[0]));
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/org/testng/TestNGAntTask.java
Expand Up @@ -150,10 +150,11 @@ public class TestNGAntTask extends Task {
private String m_testName="Ant test"; private String m_testName="Ant test";
private Boolean m_skipFailedInvocationCounts; private Boolean m_skipFailedInvocationCounts;
private String m_methods; private String m_methods;
private Mode mode = Mode.TESTNG; private Mode mode = Mode.testng;


public enum Mode { public enum Mode {
TESTNG, JUNIT, MIXED; //lower-case to better look in build scripts
testng, junit, mixed;
} }


/** /**
Expand Down Expand Up @@ -371,7 +372,7 @@ public void setTestName(String s) {


// TestNG settings // TestNG settings
public void setJUnit(boolean value) { public void setJUnit(boolean value) {
mode = value ? Mode.JUNIT : Mode.TESTNG; mode = value ? Mode.junit : Mode.testng;
} }


// TestNG settings // TestNG settings
Expand Down Expand Up @@ -537,8 +538,8 @@ public void execute() throws BuildException {


private List<String> createArguments() { private List<String> createArguments() {
List<String> argv= Lists.newArrayList(); List<String> argv= Lists.newArrayList();
addBooleanIfTrue(argv, CommandLineArgs.JUNIT, mode == Mode.JUNIT); addBooleanIfTrue(argv, CommandLineArgs.JUNIT, mode == Mode.junit);
addBooleanIfTrue(argv, CommandLineArgs.MIXED, mode == Mode.MIXED); addBooleanIfTrue(argv, CommandLineArgs.MIXED, mode == Mode.mixed);
addBooleanIfTrue(argv, CommandLineArgs.SKIP_FAILED_INVOCATION_COUNTS, m_skipFailedInvocationCounts); addBooleanIfTrue(argv, CommandLineArgs.SKIP_FAILED_INVOCATION_COUNTS, m_skipFailedInvocationCounts);
addIntegerIfNotNull(argv, CommandLineArgs.LOG, m_verbose); addIntegerIfNotNull(argv, CommandLineArgs.LOG, m_verbose);
addDefaultListeners(argv); addDefaultListeners(argv);
Expand Down