methods() {
+ return methods_;
+ }
+
/**
* Mixed mode autodetects the type of current test and run it with appropriate runner.
*
* Default is {@code false}
+ *
+ * @param isMixed {@code true} or {@code false}
+ * @return this operation instance
*/
public TestNgOperation mixed(Boolean isMixed) {
- options.put("-mixed", String.valueOf(isMixed));
+ options_.put("-mixed", String.valueOf(isMixed));
return this;
}
/**
* The list of {@code .class} files or class names implementing {@code ITestRunnerFactory}.
+ *
+ * A fully qualified class name that implements {@code org.testng.ITestObjectFactory} which can be used to create
+ * test class and listener instances.
+ *
+ * @param factory one or more factory
+ * @return this operation instance
+ * @see #objectFactory(Collection) #objectFactory(Collection)
*/
public TestNgOperation objectFactory(String... factory) {
- options.put("-objectfactory", String.join(",", factory));
+ return objectFactory(List.of(factory));
+ }
+
+ /**
+ * The list of {@code .class} files or class names implementing {@code ITestRunnerFactory}.
+ *
+ * A fully qualified class name that implements {@code org.testng.ITestObjectFactory} which can be used to create
+ * test class and listener instances.
+ *
+ * @param factory the list of factories
+ * @return this operation instance
+ * @see #objectFactory(String...) #objectFactory(String...)
+ */
+ public TestNgOperation objectFactory(Collection factory) {
+ options_.put("-objectfactory", String.join(",", factory.stream().filter(this::isNotBlank).toList()));
return this;
}
+ /**
+ * Returns the run options.
+ *
+ * @return the map of run options
+ */
+ public Map options() {
+ return options_;
+ }
+
/**
* The list of fully qualified class names of listeners that should be skipped from being wired in via
* Service Loaders.
+ *
+ * @param method one or more methods
+ * @return this operation instance
+ * @see #overrideIncludedMethods(Collection) #overrideIncludedMethods(Collection)
*/
public TestNgOperation overrideIncludedMethods(String... method) {
- options.put("-overrideincludedmethods", String.join(",", method));
+ return overrideIncludedMethods(List.of(method));
+ }
+
+ /**
+ * The list of fully qualified class names of listeners that should be skipped from being wired in via
+ * Service Loaders.
+ *
+ * @param method the list of methods
+ * @return this operation instance
+ * @see #overrideIncludedMethods(String...) #overrideIncludedMethods(String...)
+ */
+ public TestNgOperation overrideIncludedMethods(Collection method) {
+ options_.put("-overrideincludedmethods", String.join(",", method.stream().filter(this::isNotBlank).toList()));
return this;
}
@@ -305,29 +602,64 @@ public class TestNgOperation extends AbstractProcessOperation {
* Required if no {@link #suites(String... suites)} specified.
*
* For example: {@code "com.example", "test.sample.*"}
+ *
+ * @param name one or more names
+ * @return this operation instance
+ * @see #packages(Collection) #packages(Collection)
*/
public TestNgOperation packages(String... name) {
- packages.addAll(Arrays.stream(name).toList());
+ return packages(List.of(name));
+ }
+
+ /**
+ * The list of packages to include in this test.
+ * If the package name ends with .* then subpackages are included too.
+ * Required if no {@link #suites(String... suites)} specified.
+ *
+ * For example: {@code "com.example", "test.sample.*"}
+ *
+ * @param name the list of names
+ * @return this operation instance
+ * @see #packages(String...) #packages(String...)
+ */
+ public TestNgOperation packages(Collection name) {
+ packages_.addAll(name.stream().filter(this::isNotBlank).toList());
return this;
}
+ /**
+ * Returns the suite packages to run.
+ *
+ * @return the set of packages
+ */
+ public Set packages() {
+ return packages_;
+ }
+
/**
* If specified, sets the default mechanism used to determine how to use parallel threads when running tests.
* If not set, default mechanism is not to use parallel threads at all.
* This can be overridden in the suite definition.
*
+ * @param mechanism the mechanism
+ * @return this operation instance
* @see Parallel
*/
public TestNgOperation parallel(Parallel mechanism) {
- options.put("-parallel", mechanism.name().toLowerCase(Locale.getDefault()));
+ options_.put("-parallel", mechanism.name().toLowerCase(Locale.getDefault()));
return this;
}
/**
* Specifies the port number.
+ *
+ * @param port the port
+ * @return this operation instance
*/
public TestNgOperation port(int port) {
- options.put("-port", String.valueOf(port));
+ if (port >= 1) {
+ options_.put("-port", String.valueOf(port));
+ }
return this;
}
@@ -335,17 +667,38 @@ public class TestNgOperation extends AbstractProcessOperation {
* Should TestNG consider failures in Data Providers as test failures.
*
* Default is {@code false}
+ *
+ * @param isPropagateDataProviderFailure {@code true} or {@code false}
+ * @return this operation instance
*/
public TestNgOperation propagateDataProviderFailureAsTestFailure(Boolean isPropagateDataProviderFailure) {
- options.put("-propagateDataProviderFailureAsTestFailure", String.valueOf(isPropagateDataProviderFailure));
+ options_.put("-propagateDataProviderFailureAsTestFailure", String.valueOf(isPropagateDataProviderFailure));
return this;
}
/**
* Specifies the extended configuration for custom report listener.
+ *
+ * @param reporter the reporter
+ * @return this operation instance
*/
public TestNgOperation reporter(String reporter) {
- options.put("-reporter", reporter);
+ if (isNotBlank(reporter)) {
+ options_.put("-reporter", reporter);
+ }
+ return this;
+ }
+
+ /**
+ * Should TestNG use a global Shared ThreadPool (At suite level) for running data providers.
+ *
+ * @param shareThreadPoolForDataProviders {@code true} or {@code false}
+ * @return this operation instance
+ */
+ public TestNgOperation shareThreadPoolForDataProviders(boolean shareThreadPoolForDataProviders) {
+ if (shareThreadPoolForDataProviders) {
+ options_.put("-shareThreadPoolForDataProviders", "true");
+ }
return this;
}
@@ -353,36 +706,132 @@ public class TestNgOperation extends AbstractProcessOperation {
* The directories where your javadoc annotated test sources are. This option is only necessary
* if you are using javadoc type annotations. (e.g. {@code "src/test"} or
* {@code "src/test/org/testng/eclipse-plugin", "src/test/org/testng/testng"}).
+ *
+ * @param directory one or more directories
+ * @return this operation instance
+ * @see #sourceDir(Collection)
*/
public TestNgOperation sourceDir(String... directory) {
- options.put("-sourcedir", String.join(";", directory));
+ return sourceDir(List.of(directory));
+ }
+
+ /**
+ * The directories where your javadoc annotated test sources are. This option is only necessary
+ * if you are using javadoc type annotations. (e.g. {@code "src/test"} or
+ * {@code "src/test/org/testng/eclipse-plugin", "src/test/org/testng/testng"}).
+ *
+ * @param directory one or more directories
+ * @return this operation instance
+ * @see #sourceDirFiles(Collection)
+ */
+ public TestNgOperation sourceDir(File... directory) {
+ return sourceDirFiles(List.of(directory));
+ }
+
+ /**
+ * The directories where your javadoc annotated test sources are. This option is only necessary
+ * if you are using javadoc type annotations. (e.g. {@code "src/test"} or
+ * {@code "src/test/org/testng/eclipse-plugin", "src/test/org/testng/testng"}).
+ *
+ * @param directory one or more directories
+ * @return this operation instance
+ * @see #sourceDirPaths(Collection)
+ */
+ public TestNgOperation sourceDir(Path... directory) {
+ return sourceDirPaths(List.of(directory));
+ }
+
+ /**
+ * The directories where your javadoc annotated test sources are. This option is only necessary
+ * if you are using javadoc type annotations. (e.g. {@code "src/test"} or
+ * {@code "src/test/org/testng/eclipse-plugin", "src/test/org/testng/testng"}).
+ *
+ * @param directory the list of directories
+ * @return this operation instance
+ * @see #sourceDir(String...)
+ */
+ public TestNgOperation sourceDir(Collection directory) {
+ options_.put("-sourcedir", String.join(";", directory.stream().filter(this::isNotBlank).toList()));
return this;
}
+ /**
+ * The directories where your javadoc annotated test sources are. This option is only necessary
+ * if you are using javadoc type annotations. (e.g. {@code "src/test"} or
+ * {@code "src/test/org/testng/eclipse-plugin", "src/test/org/testng/testng"}).
+ *
+ * @param directory the list of directories
+ * @return this operation instance
+ * @see #sourceDir(File...)
+ */
+ public TestNgOperation sourceDirFiles(Collection directory) {
+ return sourceDir(directory.stream().map(File::getAbsolutePath).toList());
+ }
+
+ /**
+ * The directories where your javadoc annotated test sources are. This option is only necessary
+ * if you are using javadoc type annotations. (e.g. {@code "src/test"} or
+ * {@code "src/test/org/testng/eclipse-plugin", "src/test/org/testng/testng"}).
+ *
+ * @param directory the list of directories
+ * @return this operation instance
+ * @see #sourceDir(Path...)
+ */
+ public TestNgOperation sourceDirPaths(Collection directory) {
+ return sourceDirFiles(directory.stream().map(Path::toFile).toList());
+ }
+
/**
* Specifies the List of fully qualified class names of listeners that should be skipped from being wired in via
* Service Loaders.
+ *
+ * @param listenerToSkip the listeners to skip
+ * @return this operation instance
+ * @see #spiListenersToSkip(Collection) #spiListenersToSkip(Collection)
*/
public TestNgOperation spiListenersToSkip(String... listenerToSkip) {
- options.put("-spilistenerstoskip", String.join(",", listenerToSkip));
+ return spiListenersToSkip(List.of(listenerToSkip));
+ }
+
+ /**
+ * Specifies the List of fully qualified class names of listeners that should be skipped from being wired in via
+ * Service Loaders.
+ *
+ * @param listenerToSkip the listeners to skip
+ * @return this operation instance
+ * @see #spiListenersToSkip(String...) #spiListenersToSkip(String...)
+ */
+ public TestNgOperation spiListenersToSkip(Collection listenerToSkip) {
+ options_.put("-spilistenerstoskip",
+ String.join(",", listenerToSkip.stream().filter(this::isNotBlank).toList()));
return this;
}
/**
* This specifies the default name of the test suite, if not specified in the suite definition file or source code.
* This option is ignored if the {@code suite.xml} file or the source code specifies a different suite name.
+ *
+ * @param name the name
+ * @return this operation instance
*/
public TestNgOperation suiteName(String name) {
- options.put("-suitename", '"' + name + '"');
+ if (isNotBlank(name)) {
+ options_.put("-suitename", '"' + name + '"');
+ }
return this;
}
/**
* Specifies the size of the thread pool to use to run suites.
* Required if no {@link #packages(String...)} specified.
+ *
+ * @param poolSize the pool size
+ * @return this operation instance
*/
public TestNgOperation suiteThreadPoolSize(int poolSize) {
- options.put("-suitethreadpoolsize", String.valueOf(poolSize));
+ if (poolSize >= 0) {
+ options_.put("-suitethreadpoolsize", String.valueOf(poolSize));
+ }
return this;
}
@@ -390,14 +839,42 @@ public class TestNgOperation extends AbstractProcessOperation {
* Specifies the suites to run.
*
* For example: {@code "testng.xml", "testng2.xml"}
+ *
+ * @param suite one or more suites
+ * @return this operation instance
+ * @see #suites(Collection) #suites(Collection)
*/
public TestNgOperation suites(String... suite) {
- suites.addAll(Arrays.stream(suite).toList());
+ return suites(List.of(suite));
+ }
+
+ /**
+ * Specifies the suites to run.
+ *
+ * For example: {@code "testng.xml", "testng2.xml"}
+ *
+ * @param suite the list of suites
+ * @return this operation instance
+ * @see #suites(String...) #suites(String...)
+ */
+ public TestNgOperation suites(Collection suite) {
+ suites_.addAll(suite.stream().filter(this::isNotBlank).toList());
return this;
}
+ /**
+ * Returns the suites to run.
+ *
+ * @return the set of suites
+ */
+ public Set suites() {
+ return suites_;
+ }
+
/**
* Create a test file and delete it on exit.
+ *
+ * @return this operation instance
*/
private File tempFile() throws IOException {
var temp = File.createTempFile("testng", ".xml");
@@ -409,52 +886,124 @@ public class TestNgOperation extends AbstractProcessOperation {
* Specifies the list of class files.
*
* For example: {@code "org.foo.Test1","org.foo.test2"}
+ *
+ * @param aClass one or more classes
+ * @return this operation instance
+ * @see #testClass(Collection) #testClass(Collection)
*/
public TestNgOperation testClass(String... aClass) {
- options.put("-testclass", String.join(",", aClass));
+ return testClass(List.of(aClass));
+ }
+
+ /**
+ * Specifies the list of class files.
+ *
+ * For example: {@code "org.foo.Test1","org.foo.test2"}
+ *
+ * @param aClass the list of classes
+ * @return this operation instance
+ * @see #testClass(String...) #testClass(String...)
+ */
+ public TestNgOperation testClass(Collection aClass) {
+ options_.put("-testclass", String.join(",", aClass.stream().filter(this::isNotBlank).toList()));
return this;
}
/**
* Specifies the classpath entries used to run tests.
+ *
+ * @param entry one or more entries
+ * @return this operation instance
+ * @see #testClasspath(String...) #testClasspath(String...)
*/
public TestNgOperation testClasspath(String... entry) {
- testClasspath.addAll(Arrays.stream(entry).toList());
+ return testClasspath(List.of(entry));
+ }
+
+ /**
+ * Specifies the classpath entries used to run tests.
+ *
+ * @param entry the list of entries
+ * @return this operation instance
+ * @see #testClasspath(String...) #testClasspath(String...)
+ */
+ public TestNgOperation testClasspath(Collection entry) {
+ testClasspath_.addAll(entry.stream().filter(this::isNotBlank).toList());
return this;
}
+ /**
+ * Returns the classpath entries used for running tests.
+ *
+ * @return the set of test classpath
+ */
+ public Set testClasspath() {
+ return testClasspath_;
+ }
+
/**
* Specifies a jar file that contains test classes. If a {@code testng.xml} file is found at the root of that
* jar file, it will be used, otherwise, all the test classes found in this jar file will be considered test
* classes.
+ *
+ * @param jar the jar
+ * @return this operation instance
*/
public TestNgOperation testJar(String jar) {
- options.put("-testjar", jar);
+ if (isNotBlank(jar)) {
+ options_.put("-testjar", jar);
+ }
return this;
}
/**
* This specifies the default name of test, if not specified in the suite definition file or source code.
* This option is ignored if the {@code suite.xml} file or the source code specifies a different test name.
+ *
+ * @param name the name
+ * @return this operation instance
*/
public TestNgOperation testName(String name) {
- options.put("-testname", '"' + name + '"');
+ if (isNotBlank(name)) {
+ options_.put("-testname", '"' + name + '"');
+ }
return this;
}
/**
* Only tests defined in a {@code } tag matching one of these names will be run.
+ *
+ * @param name one or more names
+ * @return this operation instance
+ * @see #testNames(Collection) #testNames(Collection)
*/
public TestNgOperation testNames(String... name) {
- options.put("-testnames", Arrays.stream(name).map(s -> '"' + s + '"').collect(Collectors.joining(",")));
+ return testNames(List.of(name));
+ }
+
+ /**
+ * Only tests defined in a {@code } tag matching one of these names will be run.
+ *
+ * @param name the list of names
+ * @return this operation instance
+ * @see #testName(String) #testName(String)
+ */
+ public TestNgOperation testNames(Collection name) {
+ options_.put("-testnames",
+ name.stream().filter(this::isNotBlank).map(s -> '"' + s + '"').collect(Collectors.joining(",")));
return this;
}
/**
* Specifies the factory used to create tests.
+ *
+ * @param factory the factory
+ * @return this operation instance
*/
public TestNgOperation testRunFactory(String factory) {
- options.put("-testrunfactory", factory);
+ if (isNotBlank(factory)) {
+ options_.put("-testrunfactory", factory);
+ }
return this;
}
@@ -462,17 +1011,27 @@ public class TestNgOperation extends AbstractProcessOperation {
* This sets the default maximum number of threads to use for running tests in parallel. It will only take effect
* if the parallel mode has been selected (for example, with the {@link #parallel(Parallel) parallel} option).
* This can be overridden in the suite definition.
+ *
+ * @param count the count
+ * @return this operation instance
*/
public TestNgOperation threadCount(int count) {
- options.put("-threadcount", String.valueOf(count));
+ if (count >= 0) {
+ options_.put("-threadcount", String.valueOf(count));
+ }
return this;
}
/**
* Specifies the thread pool executor factory implementation that TestNG should use.
+ *
+ * @param factoryClass the factory class
+ * @return this operation instance
*/
public TestNgOperation threadPoolFactoryClass(String factoryClass) {
- options.put("-threadpoolfactoryclass", factoryClass);
+ if (isNotBlank(factoryClass)) {
+ options_.put("-threadpoolfactoryclass", factoryClass);
+ }
return this;
}
@@ -480,19 +1039,39 @@ public class TestNgOperation extends AbstractProcessOperation {
* Whether to use the default listeners
*
* Default is {@code true}
+ *
+ * @param isDefaultListener {@code true} or {@code false}
+ * @return this operation instance
*/
public TestNgOperation useDefaultListeners(Boolean isDefaultListener) {
- options.put("-usedefaultlisteners", String.valueOf(isDefaultListener));
+ options_.put("-usedefaultlisteners", String.valueOf(isDefaultListener));
+ return this;
+ }
+
+ /**
+ * Should TestNG use a global Shared ThreadPool (At suite level) for running regular and data driven tests.
+ *
+ * @param useGlobalThreadPool {@code true} or {@code false}
+ * @return this operation instance
+ */
+ public TestNgOperation useGlobalThreadPool(boolean useGlobalThreadPool) {
+ if (useGlobalThreadPool) {
+ options_.put("-useGlobalThreadPool", "true");
+ }
return this;
}
/**
* Set the Level of verbosity.
*
- * @see #log(int)
+ * @param level the level
+ * @return this operation instance
+ * @see #log(int) #log(int)
*/
public TestNgOperation verbose(int level) {
- options.put("-verbose", String.valueOf(level));
+ if (level >= 0) {
+ options_.put("-verbose", String.valueOf(level));
+ }
return this;
}
@@ -500,11 +1079,11 @@ public class TestNgOperation extends AbstractProcessOperation {
var temp = tempFile();
try (var bufWriter = Files.newBufferedWriter(Paths.get(temp.getPath()))) {
bufWriter.write("" +
- "" +
- "" +
- "" +
- "");
- for (var p : packages) {
+ "" +
+ "" +
+ "" +
+ "");
+ for (var p : packages_) {
bufWriter.write(String.format("", p));
}
bufWriter.write("");
@@ -516,23 +1095,70 @@ public class TestNgOperation extends AbstractProcessOperation {
* This attribute should contain the path to a valid XML file inside the test jar
* (e.g. {@code "resources/testng.xml"}). The default is {@code testng.xml}, which means a file called
* {@code testng.xml} at the root of the jar file. This option will be ignored unless a test jar is specified.
+ *
+ * @param path the path
+ * @return this operation instance
*/
public TestNgOperation xmlPathInJar(String path) {
- options.put("-xmlpathinjar", path);
+ if (isNotBlank(path)) {
+ options_.put("-xmlpathinjar", path);
+ }
return this;
}
+ /**
+ * This attribute should contain the path to a valid XML file inside the test jar
+ * (e.g. {@code "resources/testng.xml"}). The default is {@code testng.xml}, which means a file called
+ * {@code testng.xml} at the root of the jar file. This option will be ignored unless a test jar is specified.
+ *
+ * @param path the path
+ * @return this operation instance
+ */
+ public TestNgOperation xmlPathInJar(File path) {
+ return xmlPathInJar(path.getAbsolutePath());
+ }
+
+ /**
+ * This attribute should contain the path to a valid XML file inside the test jar
+ * (e.g. {@code "resources/testng.xml"}). The default is {@code testng.xml}, which means a file called
+ * {@code testng.xml} at the root of the jar file. This option will be ignored unless a test jar is specified.
+ *
+ * @param path the path
+ * @return this operation instance
+ */
+ public TestNgOperation xmlPathInJar(Path path) {
+ return xmlPathInJar(path.toFile());
+ }
+
/**
* Parallel Mechanisms
*/
public enum Parallel {
- METHODS, TESTS, CLASSES
+ /**
+ * Methods mechanism.
+ */
+ METHODS,
+ /**
+ * Tests mechanism.
+ */
+ TESTS,
+ /**
+ * Classes mechanism.
+ */
+ CLASSES
}
/**
* Failure Policies
*/
public enum FailurePolicy {
- SKIP, CONTINUE
+ /**
+ * Skip failure policy.
+ */
+ SKIP,
+ /**
+ * Continue failure policy.
+ */
+ CONTINUE
}
-}
\ No newline at end of file
+}
diff --git a/src/test/java/rife/bld/extension/TestNgExample.java b/src/test/java/rife/bld/extension/TestNgExample.java
new file mode 100644
index 0000000..faa223a
--- /dev/null
+++ b/src/test/java/rife/bld/extension/TestNgExample.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2023-2025 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package rife.bld.extension;
+
+/**
+ * Implements the TestNgExample class.
+ *
+ * @author Erik C. Thauvin
+ * @since 1.0
+ */
+@SuppressWarnings({"PMD.TestClassWithoutTestCases", "unused"})
+class TestNgExample {
+ @SuppressWarnings("SameReturnValue")
+ public String getMessage() {
+ return "Hello World!";
+ }
+}
diff --git a/src/test/java/rife/bld/extension/TestNgExampleTest.java b/src/test/java/rife/bld/extension/TestNgExampleTest.java
new file mode 100644
index 0000000..6d3c9b0
--- /dev/null
+++ b/src/test/java/rife/bld/extension/TestNgExampleTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2023-2025 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package rife.bld.extension;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * Implements the TestNgExampleTest class.
+ *
+ * @author Erik C. Thauvin
+ * @since 1.0
+ */
+@SuppressWarnings("unused")
+class TestNgExampleTest {
+ private final TestNgExample example = new TestNgExample();
+
+ @Test
+ void foo() {
+ Assert.assertEquals(example.getMessage(), "foo");
+ }
+
+ @Test
+ void verifyHello() {
+ Assert.assertEquals(example.getMessage(), "Hello World!");
+ }
+}
diff --git a/src/test/java/rife/bld/extension/TestNgOperationTest.java b/src/test/java/rife/bld/extension/TestNgOperationTest.java
index bf61aaa..d4f3193 100644
--- a/src/test/java/rife/bld/extension/TestNgOperationTest.java
+++ b/src/test/java/rife/bld/extension/TestNgOperationTest.java
@@ -1,25 +1,35 @@
/*
- * Copyright 2023 the original author or authors.
+ * Copyright 2023-2025 the original author or authors.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * https://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package rife.bld.extension;
+import org.assertj.core.api.AutoCloseableSoftAssertions;
import org.junit.jupiter.api.Test;
-import rife.bld.Project; // NOPMD
+import org.junit.jupiter.api.condition.EnabledOnOs;
+import org.junit.jupiter.api.condition.OS;
+import rife.bld.Project;
+import rife.bld.blueprints.BaseProjectBlueprint;
import rife.bld.operations.exceptions.ExitStatusException;
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.List;
+
import static org.assertj.core.api.Assertions.*;
/**
@@ -36,47 +46,132 @@ class TestNgOperationTest {
@Test
void testAlwaysRunListeners() {
var op = new TestNgOperation().alwaysRunListeners(false);
- assertThat(op.options.get("-alwaysrunlisteners")).isEqualTo("false");
+ assertThat(op.options().get("-alwaysrunlisteners")).isEqualTo("false");
op = new TestNgOperation().alwaysRunListeners(true);
- assertThat(op.options.get("-alwaysrunlisteners")).isEqualTo("true");
+ assertThat(op.options().get("-alwaysrunlisteners")).isEqualTo("true");
+ }
+
+ @Test
+ @EnabledOnOs(OS.LINUX)
+ void testCheckAllParameters() throws IOException {
+ var args = Files.readAllLines(Paths.get("src", "test", "resources", "testng-args.txt"));
+
+ assertThat(args).isNotEmpty();
+
+ var params = new TestNgOperation()
+ .fromProject(new BaseProjectBlueprint(new File("examples"), "com.example", "examples", "Examples"))
+ .alwaysRunListeners(true)
+ .dataProviderThreadCount(1)
+ .dependencyInjectorFactory("injectorfactory")
+ .directory("dir")
+ .excludeGroups("group")
+ .failWhenEverythingSkipped(true)
+ .failurePolicy(TestNgOperation.FailurePolicy.SKIP)
+ .generateResultsPerSuite(true)
+ .groups("group1", "group2")
+ .ignoreMissedTestName(true)
+ .includeAllDataDrivenTestsWhenSkipping(true)
+ .listener("listener")
+ .listenerComparator("comparator")
+ .listenerFactory("factory")
+ .log(1)
+ .methodSelectors("selector")
+ .methods("methods")
+ .mixed(true)
+ .objectFactory("objectFactory")
+ .overrideIncludedMethods("method")
+ .parallel(TestNgOperation.Parallel.TESTS)
+ .propagateDataProviderFailureAsTestFailure(true)
+ .reporter("reporter")
+ .shareThreadPoolForDataProviders(true)
+ .spiListenersToSkip("listenter")
+ .suiteName("name")
+ .suiteThreadPoolSize(1)
+ .testClass("class")
+ .testJar("jar")
+ .testName("name")
+ .testNames("names")
+ .testRunFactory("runFactory")
+ .threadCount(1)
+ .threadPoolFactoryClass("poolClass")
+ .useDefaultListeners(true)
+ .useGlobalThreadPool(true)
+ .verbose(1)
+ .xmlPathInJar("jarPath")
+ .executeConstructProcessCommandList();
+
+ try (var softly = new AutoCloseableSoftAssertions()) {
+ for (var p : args) {
+ var found = false;
+ for (var a : params) {
+ if (a.startsWith(p)) {
+ found = true;
+ break;
+ }
+ }
+ softly.assertThat(found).as(p + " not found.").isTrue();
+ }
+ }
+
}
@Test
void testClass() {
var op = new TestNgOperation().testClass(FOO, BAR);
- assertThat(op.options.get(TestNgOperation.TEST_CLASS_ARG)).isEqualTo(String.format("%s,%s", FOO, BAR));
+ assertThat(op.options().get("-testclass")).isEqualTo(String.format("%s,%s", FOO, BAR));
+
+ new TestNgOperation().testClass(List.of(FOO, BAR));
+ assertThat(op.options().get("-testclass")).as("as list")
+ .isEqualTo(String.format("%s,%s", FOO, BAR));
+ }
+
+ @Test
+ void testClasspath() {
+ var op = new TestNgOperation().testClasspath(FOO, BAR);
+ assertThat(op.testClasspath()).containsExactly(BAR, FOO);
}
@Test
void testDataProviderThreadCount() {
var op = new TestNgOperation().dataProviderThreadCount(1);
- assertThat(op.options.get("-dataproviderthreadcount")).isEqualTo("1");
+ assertThat(op.options().get("-dataproviderthreadcount")).isEqualTo("1");
}
@Test
void testDependencyInjectorFactory() {
var op = new TestNgOperation().dependencyInjectorFactory(FOO);
- assertThat(op.options.get("-dependencyinjectorfactory")).isEqualTo(FOO);
+ assertThat(op.options().get("-dependencyinjectorfactory")).isEqualTo(FOO);
}
@Test
void testDirectory() {
+ var foo = new File("FOO");
+
var op = new TestNgOperation().directory(FOO);
- assertThat(op.options.get("-d")).isEqualTo(FOO);
+ assertThat(op.options().get("-d")).as("as string").isEqualTo(FOO);
+
+ op = new TestNgOperation().directory(foo);
+ assertThat(op.options().get("-d")).as("as file").isEqualTo(foo.getAbsolutePath());
+
+ op = new TestNgOperation().directory(foo.toPath());
+ assertThat(op.options().get("-d")).as("as path").isEqualTo(foo.getAbsolutePath());
}
@Test
void testExcludeGroups() {
var op = new TestNgOperation().excludeGroups(FOO, BAR);
- assertThat(op.options.get("-excludegroups")).isEqualTo(String.format("%s,%s", FOO, BAR));
+ assertThat(op.options().get("-excludegroups")).isEqualTo(String.format("%s,%s", FOO, BAR));
+
+ op = new TestNgOperation().excludeGroups(List.of(FOO, BAR));
+ assertThat(op.options().get("-excludegroups")).as("as list").isEqualTo(String.format("%s,%s", FOO, BAR));
}
@Test
void testExecute() {
assertThatThrownBy(() ->
new TestNgOperation().fromProject(new Project())
- .testClass("rife.bld.extension.TestNgSimpleTest")
+ .testClass("rife.bld.extension.TestNgExampleTest")
.execute())
.as("with testClass").isInstanceOf(ExitStatusException.class);
@@ -88,10 +183,9 @@ class TestNgOperationTest {
assertThatCode(() ->
new TestNgOperation().fromProject(new Project())
- .testClass("rife.bld.extension.TestNgSimpleTest")
- .methods("rife.bld.extension.TestNgSimpleTest.verifyHello")
+ .methods("rife.bld.extension.TestNgExampleTest.foo")
.execute())
- .as("with methods").doesNotThrowAnyException();
+ .as("with methods").isInstanceOf(ExitStatusException.class);
assertThatCode(() ->
new TestNgOperation().fromProject(new Project())
@@ -101,245 +195,329 @@ class TestNgOperationTest {
assertThatCode(() ->
new TestNgOperation().fromProject(new Project())
- .suites("src/test/resources/testng3.xml")
+ .suites("src/test/resources/testng2.xml")
.log(2)
.execute())
- .as("suite 3").doesNotThrowAnyException();
+ .as("suite 2 - log ").doesNotThrowAnyException();
assertThatCode(() ->
new TestNgOperation().fromProject(new Project())
- .suites("src/test/resources/testng3.xml")
+ .suites("src/test/resources/testng2.xml")
.testClasspath("lib/test/*", "build/main", "build/test")
.log(2)
.execute())
.as("with run classpath").doesNotThrowAnyException();
+
+ assertThatCode(() ->
+ new TestNgOperation().fromProject(new Project())
+ .suites("src/test/resources/testng2.xml")
+ .testClasspath(List.of("lib/test/*", "build/main", "build/test"))
+ .log(2)
+ .execute())
+ .as("with run classpath as list").doesNotThrowAnyException();
}
@Test
void testFailWheneverEverythingSkipped() {
var op = new TestNgOperation().failWhenEverythingSkipped(false);
- assertThat(op.options.get("-failwheneverythingskipped")).isEqualTo("false");
+ assertThat(op.options().get("-failwheneverythingskipped")).isEqualTo("false");
op = new TestNgOperation().failWhenEverythingSkipped(true);
- assertThat(op.options.get("-failwheneverythingskipped")).isEqualTo("true");
+ assertThat(op.options().get("-failwheneverythingskipped")).isEqualTo("true");
}
@Test
void testFailurePolicy() {
var op = new TestNgOperation().failurePolicy(TestNgOperation.FailurePolicy.CONTINUE);
- assertThat(op.options.get("-configfailurepolicy")).isEqualTo("continue");
+ assertThat(op.options().get("-configfailurepolicy")).isEqualTo("continue");
op = new TestNgOperation().failurePolicy(TestNgOperation.FailurePolicy.SKIP);
- assertThat(op.options.get("-configfailurepolicy")).isEqualTo("skip");
+ assertThat(op.options().get("-configfailurepolicy")).isEqualTo("skip");
}
@Test
void testGenerateResultsPerSuite() {
var op = new TestNgOperation().generateResultsPerSuite(false);
- assertThat(op.options.get("-generateResultsPerSuite")).isEqualTo("false");
+ assertThat(op.options().get("-generateResultsPerSuite")).isEqualTo("false");
op = new TestNgOperation().generateResultsPerSuite(true);
- assertThat(op.options.get("-generateResultsPerSuite")).isEqualTo("true");
+ assertThat(op.options().get("-generateResultsPerSuite")).isEqualTo("true");
}
@Test
void testGroups() {
var op = new TestNgOperation().groups(FOO, BAR);
- assertThat(op.options.get("-groups")).isEqualTo(String.format("%s,%s", FOO, BAR));
+ assertThat(op.options().get("-groups")).isEqualTo(String.format("%s,%s", FOO, BAR));
+
+ op.groups(List.of("group3", "group4"));
+ assertThat(op.options().get("-groups")).isEqualTo("group3,group4");
+
}
@Test
void testIgnoreMissedTestName() {
var op = new TestNgOperation().ignoreMissedTestName(false);
- assertThat(op.options.get("-ignoreMissedTestNames")).isEqualTo("false");
+ assertThat(op.options().get("-ignoreMissedTestNames")).isEqualTo("false");
op = new TestNgOperation().ignoreMissedTestName(true);
- assertThat(op.options.get("-ignoreMissedTestNames")).isEqualTo("true");
+ assertThat(op.options().get("-ignoreMissedTestNames")).isEqualTo("true");
}
@Test
void testIncludeAllDataDrivenTestsWhenSkipping() {
var op = new TestNgOperation().includeAllDataDrivenTestsWhenSkipping(false);
- assertThat(op.options.get("-includeAllDataDrivenTestsWhenSkipping")).isEqualTo("false");
+ assertThat(op.options().get("-includeAllDataDrivenTestsWhenSkipping")).isEqualTo("false");
op = new TestNgOperation().includeAllDataDrivenTestsWhenSkipping(true);
- assertThat(op.options.get("-includeAllDataDrivenTestsWhenSkipping")).isEqualTo("true");
+ assertThat(op.options().get("-includeAllDataDrivenTestsWhenSkipping")).isEqualTo("true");
}
@Test
void testJar() {
var op = new TestNgOperation().testJar(FOO);
- assertThat(op.options.get("-testjar")).isEqualTo(FOO);
+ assertThat(op.options().get("-testjar")).isEqualTo(FOO);
}
@Test
void testJunit() {
var op = new TestNgOperation().jUnit(false);
- assertThat(op.options.get("-junit")).isEqualTo("false");
+ assertThat(op.options().get("-junit")).isEqualTo("false");
op = new TestNgOperation().jUnit(true);
- assertThat(op.options.get("-junit")).isEqualTo("true");
+ assertThat(op.options().get("-junit")).isEqualTo("true");
}
@Test
void testListener() {
var ops = new TestNgOperation().listener(FOO, BAR);
- assertThat(ops.options.get("-listener")).isEqualTo(String.format("%s,%s", FOO, BAR));
+ assertThat(ops.options().get("-listener")).isEqualTo(String.format("%s,%s", FOO, BAR));
+
+ ops = new TestNgOperation().listener(List.of(FOO, BAR));
+ assertThat(ops.options().get("-listener")).as("as list").isEqualTo(String.format("%s,%s", FOO, BAR));
}
@Test
void testMethodDetectors() {
var op = new TestNgOperation().methodSelectors(FOO, BAR);
- assertThat(op.options.get("-methodselectors")).isEqualTo(String.format("%s,%s", FOO, BAR));
+ assertThat(op.options().get("-methodselectors")).isEqualTo(String.format("%s,%s", FOO, BAR));
+
+ op = new TestNgOperation().methodSelectors(List.of(FOO, BAR));
+ assertThat(op.options().get("-methodselectors")).as("as list").isEqualTo(String.format("%s,%s", FOO, BAR));
}
@Test
void testMethods() {
var op = new TestNgOperation().methods(FOO, BAR);
- assertThat(op.options.get("-methods")).isEqualTo(String.format("%s,%s", FOO, BAR));
+ assertThat(op.methods()).containsExactly(BAR, FOO);
+
+ new TestNgOperation().methods(List.of(FOO, BAR));
+ assertThat(op.methods()).containsExactly(BAR, FOO);
}
@Test
void testMixed() {
var op = new TestNgOperation().mixed(false);
- assertThat(op.options.get("-mixed")).isEqualTo("false");
+ assertThat(op.options().get("-mixed")).isEqualTo("false");
op = new TestNgOperation().mixed(true);
- assertThat(op.options.get("-mixed")).isEqualTo("true");
+ assertThat(op.options().get("-mixed")).isEqualTo("true");
}
@Test
void testName() {
var op = new TestNgOperation().testName(FOO);
- assertThat(op.options.get("-testname")).isEqualTo("\"" + FOO + '\"');
+ assertThat(op.options().get("-testname")).isEqualTo("\"" + FOO + '\"');
}
@Test
void testNames() {
var ops = new TestNgOperation().testNames(FOO, BAR);
- assertThat(ops.options.get("-testnames")).isEqualTo(String.format("\"%s\",\"%s\"", FOO, BAR));
+ assertThat(ops.options().get("-testnames")).isEqualTo(String.format("\"%s\",\"%s\"", FOO, BAR));
+
+ new TestNgOperation().testNames(List.of(FOO, BAR));
+ assertThat(ops.options().get("-testnames")).as("as list").isEqualTo(String.format("\"%s\",\"%s\"", FOO, BAR));
}
@Test
void testObjectFactory() {
var ops = new TestNgOperation().objectFactory(FOO, BAR);
- assertThat(ops.options.get("-objectfactory")).isEqualTo(String.format("%s,%s", FOO, BAR));
+ assertThat(ops.options().get("-objectfactory")).isEqualTo(String.format("%s,%s", FOO, BAR));
+
+ ops = new TestNgOperation().objectFactory(List.of(FOO, BAR));
+ assertThat(ops.options().get("-objectfactory")).as("as list").isEqualTo(String.format("%s,%s", FOO, BAR));
}
@Test
void testOverrideIncludedMethods() {
var ops = new TestNgOperation().overrideIncludedMethods(FOO, BAR);
- assertThat(ops.options.get("-overrideincludedmethods")).isEqualTo(String.format("%s,%s", FOO, BAR));
+ assertThat(ops.options().get("-overrideincludedmethods")).isEqualTo(String.format("%s,%s", FOO, BAR));
+
+ ops = new TestNgOperation().overrideIncludedMethods(List.of(FOO, BAR));
+ assertThat(ops.options().get("-overrideincludedmethods")).as("as list").isEqualTo(String.format("%s,%s", FOO, BAR));
}
@Test
void testPackages() {
var op = new TestNgOperation().packages(FOO, BAR);
- assertThat(op.packages).contains(FOO).contains(BAR);
+ assertThat(op.packages()).contains(FOO).contains(BAR);
+
+ op = new TestNgOperation().packages(List.of(FOO, BAR));
+ assertThat(op.packages()).as("as list").contains(FOO).contains(BAR);
}
@Test
void testParallel() {
var op = new TestNgOperation().parallel(TestNgOperation.Parallel.TESTS);
- assertThat(op.options.get("-parallel")).isEqualTo("tests");
+ assertThat(op.options().get("-parallel")).isEqualTo("tests");
op = new TestNgOperation().parallel(TestNgOperation.Parallel.METHODS);
- assertThat(op.options.get("-parallel")).isEqualTo("methods");
+ assertThat(op.options().get("-parallel")).isEqualTo("methods");
op = new TestNgOperation().parallel(TestNgOperation.Parallel.CLASSES);
- assertThat(op.options.get("-parallel")).isEqualTo("classes");
+ assertThat(op.options().get("-parallel")).isEqualTo("classes");
}
@Test
void testPort() {
var op = new TestNgOperation().port(1);
- assertThat(op.options.get("-port")).isEqualTo("1");
+ assertThat(op.options().get("-port")).isEqualTo("1");
}
@Test
void testPropagateDataProviderFailureAsTestFailure() {
var op = new TestNgOperation().propagateDataProviderFailureAsTestFailure(false);
- assertThat(op.options.get("-propagateDataProviderFailureAsTestFailure")).isEqualTo("false");
+ assertThat(op.options().get("-propagateDataProviderFailureAsTestFailure")).isEqualTo("false");
op = new TestNgOperation().propagateDataProviderFailureAsTestFailure(true);
- assertThat(op.options.get("-propagateDataProviderFailureAsTestFailure")).isEqualTo("true");
+ assertThat(op.options().get("-propagateDataProviderFailureAsTestFailure")).isEqualTo("true");
}
@Test
void testReported() {
var op = new TestNgOperation().reporter(FOO);
- assertThat(op.options.get("-reporter")).isEqualTo(FOO);
+ assertThat(op.options().get("-reporter")).isEqualTo(FOO);
}
@Test
void testRunFactory() {
var op = new TestNgOperation().testRunFactory(FOO);
- assertThat(op.options.get("-testrunfactory")).isEqualTo(FOO);
+ assertThat(op.options().get("-testrunfactory")).isEqualTo(FOO);
+ }
+
+ @Test
+ void testShareThreadPoolForDataProviders() {
+ var op = new TestNgOperation().shareThreadPoolForDataProviders(true);
+ assertThat(op.options().get("-shareThreadPoolForDataProviders")).isEqualTo("true");
+
+ op = new TestNgOperation().shareThreadPoolForDataProviders(false);
+ assertThat(op.options().get("-shareThreadPoolForDataProviders")).isNull();
}
@Test
void testSourceDir() {
+ var foo = new File(FOO);
+ var bar = new File(BAR);
+
+ var foobar = String.format("%s;%s", FOO, BAR);
var op = new TestNgOperation().sourceDir(FOO, BAR);
- assertThat(op.options.get("-sourcedir")).isEqualTo(String.format("%s;%s", FOO, BAR));
+ assertThat(op.options().get("-sourcedir")).as("String...").isEqualTo(foobar);
+
+ op = new TestNgOperation().sourceDir(List.of(FOO, BAR));
+ assertThat(op.options().get("-sourcedir")).as("List(String...)").isEqualTo(foobar);
+
+ foobar = String.format("%s;%s", foo.getAbsolutePath(), bar.getAbsolutePath());
+ op = new TestNgOperation().sourceDir(foo, bar);
+ assertThat(op.options().get("-sourcedir")).as("File...").isEqualTo(foobar);
+
+ op = new TestNgOperation().sourceDirFiles(List.of(foo, bar));
+ assertThat(op.options().get("-sourcedir")).as("List(String...)").isEqualTo(foobar);
+
+ op = new TestNgOperation().sourceDir(foo.toPath(), bar.toPath());
+ assertThat(op.options().get("-sourcedir")).as("Path...").isEqualTo(foobar);
+
+ op = new TestNgOperation().sourceDirPaths(List.of(foo.toPath(), bar.toPath()));
+ assertThat(op.options().get("-sourcedir")).as("List(Path...)").isEqualTo(foobar);
}
@Test
void testSpiListenersToSkip() {
var ops = new TestNgOperation().spiListenersToSkip(FOO, BAR);
- assertThat(ops.options.get("-spilistenerstoskip")).isEqualTo(String.format("%s,%s", FOO, BAR));
+ assertThat(ops.options().get("-spilistenerstoskip")).isEqualTo(String.format("%s,%s", FOO, BAR));
+
+ ops = new TestNgOperation().spiListenersToSkip(List.of(FOO, BAR));
+ assertThat(ops.options().get("-spilistenerstoskip")).as("as list").isEqualTo(String.format("%s,%s", FOO, BAR));
}
@Test
void testSuiteName() {
var op = new TestNgOperation().suiteName(FOO);
- assertThat(op.options.get("-suitename")).isEqualTo("\"" + FOO + '\"');
+ assertThat(op.options().get("-suitename")).isEqualTo("\"" + FOO + '\"');
}
@Test
void testSuiteThreadPoolSize() {
var op = new TestNgOperation().suiteThreadPoolSize(1);
- assertThat(op.options.get("-suitethreadpoolsize")).isEqualTo("1");
+ assertThat(op.options().get("-suitethreadpoolsize")).isEqualTo("1");
}
@Test
void testSuites() {
var op = new TestNgOperation().suites(FOO, BAR);
- assertThat(op.suites).contains(FOO).contains(BAR);
+ assertThat(op.suites()).contains(FOO).contains(BAR);
+
+ op = new TestNgOperation().suites(List.of(FOO, BAR));
+ assertThat(op.suites()).as("as list").contains(FOO).contains(BAR);
}
@Test
void testThreadCount() {
var op = new TestNgOperation().threadCount(1);
- assertThat(op.options.get("-threadcount")).isEqualTo("1");
+ assertThat(op.options().get("-threadcount")).isEqualTo("1");
}
@Test
void testThreadPoolFactoryClass() {
var op = new TestNgOperation().threadPoolFactoryClass(FOO);
- assertThat(op.options.get("-threadpoolfactoryclass")).isEqualTo(FOO);
+ assertThat(op.options().get("-threadpoolfactoryclass")).isEqualTo(FOO);
}
@Test
void testUseDefaultListeners() {
var op = new TestNgOperation().useDefaultListeners(false);
- assertThat(op.options.get("-usedefaultlisteners")).isEqualTo("false");
+ assertThat(op.options().get("-usedefaultlisteners")).isEqualTo("false");
op = new TestNgOperation().useDefaultListeners(true);
- assertThat(op.options.get("-usedefaultlisteners")).isEqualTo("true");
+ assertThat(op.options().get("-usedefaultlisteners")).isEqualTo("true");
+ }
+
+ @Test
+ void testUseGlobalThreadPool() {
+ var op = new TestNgOperation().useGlobalThreadPool(true);
+ assertThat(op.options().get("-useGlobalThreadPool")).isEqualTo("true");
+
+ op = new TestNgOperation().useGlobalThreadPool(false);
+ assertThat(op.options().get("-useGlobalThreadPool")).isNull();
}
@Test
void testVerbose() {
var op = new TestNgOperation().log(1);
- assertThat(op.options.get("-log")).isEqualTo("1");
+ assertThat(op.options().get("-log")).isEqualTo("1");
op = new TestNgOperation().verbose(1);
- assertThat(op.options.get("-verbose")).isEqualTo("1");
+ assertThat(op.options().get("-verbose")).isEqualTo("1");
}
@Test
void testXmlPathInJar() {
+ var foo = new File(FOO);
var op = new TestNgOperation().xmlPathInJar(FOO);
- assertThat(op.options.get("-xmlpathinjar")).isEqualTo(FOO);
+ assertThat(op.options().get("-xmlpathinjar")).as("as string").isEqualTo(FOO);
+
+ op = new TestNgOperation().xmlPathInJar(foo);
+ assertThat(op.options().get("-xmlpathinjar")).as("as file").isEqualTo(foo.getAbsolutePath());
+
+ op = new TestNgOperation().xmlPathInJar(foo.toPath());
+ assertThat(op.options().get("-xmlpathinjar")).as("as path").isEqualTo(foo.getAbsolutePath());
}
}
diff --git a/src/test/java/rife/bld/extension/TestNgSimple2Test.java b/src/test/java/rife/bld/extension/TestNgSimple2Test.java
deleted file mode 100644
index 3b20bc4..0000000
--- a/src/test/java/rife/bld/extension/TestNgSimple2Test.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2023 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package rife.bld.extension;
-
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/**
- * Implements the TestNgSimpleTest class.
- *
- * @author Erik C. Thauvin
- * @since 1.0
- */
-class TestNgSimple2Test {
- public static void main(String[] args) {
- new TestNgSimple2Test().verifyHello();
- }
-
- @Test
- void verifyHello() {
- Assert.assertTrue(true);
- }
-}
diff --git a/src/test/java/rife/bld/extension/TestNgSimpleTest.java b/src/test/java/rife/bld/extension/TestNgSimpleTest.java
deleted file mode 100644
index 6c091ec..0000000
--- a/src/test/java/rife/bld/extension/TestNgSimpleTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2023 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package rife.bld.extension;
-
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/**
- * Implements the TestNgSimpleTest class.
- *
- * @author Erik C. Thauvin
- * @since 1.0
- */
-class TestNgSimpleTest {
- public static void main(String[] args) {
- new TestNgSimpleTest().verifyHello();
- }
-
- @Test
- void testFail() {
- Assert.fail("failed");
- }
-
- @Test
- void verifyHello() {
- Assert.assertTrue(true);
- }
-}
diff --git a/src/test/resources/testng-args.txt b/src/test/resources/testng-args.txt
new file mode 100644
index 0000000..8eec8d5
--- /dev/null
+++ b/src/test/resources/testng-args.txt
@@ -0,0 +1,38 @@
+-alwaysrunlisteners
+-configfailurepolicy
+-d
+-dataproviderthreadcount
+-dependencyinjectorfactory
+-excludegroups
+-failwheneverythingskipped
+-generateResultsPerSuite
+-groups
+-ignoreMissedTestNames
+-includeAllDataDrivenTestsWhenSkipping
+-listener
+-listenercomparator
+-listenerfactory
+-log
+-methods
+-methodselectors
+-mixed
+-objectfactory
+-overrideincludedmethods
+-parallel
+-propagateDataProviderFailureAsTestFailure
+-reporter
+-shareThreadPoolForDataProviders
+-spilistenerstoskip
+-suitename
+-suitethreadpoolsize
+-testclass
+-testjar
+-testname
+-testnames
+-testrunfactory
+-threadcount
+-threadpoolfactoryclass
+-usedefaultlisteners
+-useGlobalThreadPool
+-verbose
+-xmlpathinjar
diff --git a/src/test/resources/testng.xml b/src/test/resources/testng.xml
index 41fd8ae..ef68357 100644
--- a/src/test/resources/testng.xml
+++ b/src/test/resources/testng.xml
@@ -2,7 +2,11 @@
-
+
+
+
+
+
\ No newline at end of file
diff --git a/src/test/resources/testng2.xml b/src/test/resources/testng2.xml
index 01168b7..44ddf38 100644
--- a/src/test/resources/testng2.xml
+++ b/src/test/resources/testng2.xml
@@ -2,9 +2,9 @@
-
+
-
+
diff --git a/src/test/resources/testng3.xml b/src/test/resources/testng3.xml
deleted file mode 100644
index baa78e5..0000000
--- a/src/test/resources/testng3.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-