Added script to list parameters

This commit is contained in:
Erik C. Thauvin 2024-05-27 16:22:32 -07:00
parent 6020dde8eb
commit b0cf0f5035
Signed by: erik
GPG key ID: 776702A6A2DA330E
3 changed files with 20 additions and 9 deletions

1
.gitignore vendored
View file

@ -55,3 +55,4 @@ atlassian-ide-plugin.xml
.idea/httpRequests .idea/httpRequests
local.properties local.properties
test-output

10
cliargs.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/bash
MAIN="org.testng.TestNG"
TMP=/tmp/cliargs
java -cp "lib/test/*" $MAIN >$TMP 2>/dev/null
cat $TMP | grep "^ -.*" | sed -e "s/ -/-/" -e "s/^-/\"-/" -e "s/$/\",/" -e "s/, -/\",\n\"-/" | sed "/testRunFactory/d" | sort | sed '$s/,//'
rm -rf $TMP

View file

@ -47,8 +47,9 @@ class TestNgOperationTest {
} }
@Test @Test
void testCheckAll() { void testCheckAllParameters() {
var params = List.of( var params = List.of(
"-alwaysrunlisteners",
"-configfailurepolicy", "-configfailurepolicy",
"-d", "-d",
"-dataproviderthreadcount", "-dataproviderthreadcount",
@ -63,7 +64,6 @@ class TestNgOperationTest {
"-listenercomparator", "-listenercomparator",
"-listenerfactory", "-listenerfactory",
"-log", "-log",
"-verbose",
"-methods", "-methods",
"-methodselectors", "-methodselectors",
"-mixed", "-mixed",
@ -85,18 +85,19 @@ class TestNgOperationTest {
"-threadpoolfactoryclass", "-threadpoolfactoryclass",
"-usedefaultlisteners", "-usedefaultlisteners",
"-useGlobalThreadPool", "-useGlobalThreadPool",
"-xmlpathinjar", "-verbose",
"-alwaysrunlisteners" "-xmlpathinjar"
); );
var args = new TestNgOperation() var args = new TestNgOperation()
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example", "Examples")) .fromProject(new BaseProjectBlueprint(new File("examples"), "com.example", "Examples"))
.failurePolicy(TestNgOperation.FailurePolicy.SKIP) .alwaysRunListeners(true)
.directory("dir")
.dataProviderThreadCount(1) .dataProviderThreadCount(1)
.dependencyInjectorFactory("injectorfactory") .dependencyInjectorFactory("injectorfactory")
.directory("dir")
.excludeGroups("group") .excludeGroups("group")
.failWhenEverythingSkipped(true) .failWhenEverythingSkipped(true)
.failurePolicy(TestNgOperation.FailurePolicy.SKIP)
.generateResultsPerSuite(true) .generateResultsPerSuite(true)
.groups("group1", "group2") .groups("group1", "group2")
.ignoreMissedTestName(true) .ignoreMissedTestName(true)
@ -105,9 +106,8 @@ class TestNgOperationTest {
.listenerComparator("comparator") .listenerComparator("comparator")
.listenerFactory("factory") .listenerFactory("factory")
.log(1) .log(1)
.verbose(1)
.methods("methods")
.methodSelectors("selector") .methodSelectors("selector")
.methods("methods")
.mixed(true) .mixed(true)
.objectFactory("objectFactory") .objectFactory("objectFactory")
.overrideIncludedMethods("method") .overrideIncludedMethods("method")
@ -127,8 +127,8 @@ class TestNgOperationTest {
.threadPoolFactoryClass("poolClass") .threadPoolFactoryClass("poolClass")
.useDefaultListeners(true) .useDefaultListeners(true)
.useGlobalThreadPool(true) .useGlobalThreadPool(true)
.verbose(1)
.xmlPathInJar("jarPath") .xmlPathInJar("jarPath")
.alwaysRunListeners(true)
.executeConstructProcessCommandList(); .executeConstructProcessCommandList();
for (var p : params) { for (var p : params) {