Read parameters from resource file
This commit is contained in:
parent
b0cf0f5035
commit
0a869da1d5
3 changed files with 52 additions and 45 deletions
|
@ -5,6 +5,11 @@ TMP=/tmp/cliargs
|
||||||
|
|
||||||
java -cp "lib/test/*" $MAIN >$TMP 2>/dev/null
|
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/,//'
|
cat $TMP |\
|
||||||
|
grep "^ -.*" |\
|
||||||
|
sed -e "s/ -/-/" -e "s/, -/\n-/" |\
|
||||||
|
sed "/testRunFactory/d" |\
|
||||||
|
sort |\
|
||||||
|
sed '$s/,//' > "src/test/resources/testng-args.txt"
|
||||||
|
|
||||||
rm -rf $TMP
|
rm -rf $TMP
|
||||||
|
|
|
@ -22,6 +22,9 @@ import rife.bld.blueprints.BaseProjectBlueprint;
|
||||||
import rife.bld.operations.exceptions.ExitStatusException;
|
import rife.bld.operations.exceptions.ExitStatusException;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.*;
|
import static org.assertj.core.api.Assertions.*;
|
||||||
|
@ -47,49 +50,10 @@ class TestNgOperationTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testCheckAllParameters() {
|
void testCheckAllParameters() throws IOException {
|
||||||
var params = List.of(
|
var args = Files.readAllLines(Paths.get("src", "test", "resources", "testng-args.txt"));
|
||||||
"-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"
|
|
||||||
);
|
|
||||||
|
|
||||||
var args = new TestNgOperation()
|
var params = new TestNgOperation()
|
||||||
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example", "Examples"))
|
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example", "Examples"))
|
||||||
.alwaysRunListeners(true)
|
.alwaysRunListeners(true)
|
||||||
.dataProviderThreadCount(1)
|
.dataProviderThreadCount(1)
|
||||||
|
@ -131,9 +95,9 @@ class TestNgOperationTest {
|
||||||
.xmlPathInJar("jarPath")
|
.xmlPathInJar("jarPath")
|
||||||
.executeConstructProcessCommandList();
|
.executeConstructProcessCommandList();
|
||||||
|
|
||||||
for (var p : params) {
|
for (var p : args) {
|
||||||
var found = false;
|
var found = false;
|
||||||
for (var a : args) {
|
for (var a : params) {
|
||||||
if (a.startsWith(p)) {
|
if (a.startsWith(p)) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
|
|
38
src/test/resources/testng-args.txt
Normal file
38
src/test/resources/testng-args.txt
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue