diff --git a/.idea/libraries/bld.xml b/.idea/libraries/bld.xml index 8105a64..867d049 100644 --- a/.idea/libraries/bld.xml +++ b/.idea/libraries/bld.xml @@ -2,12 +2,12 @@ - + - + diff --git a/.idea/libraries/compile.xml b/.idea/libraries/compile.xml index 99cc0c0..9bd86aa 100644 --- a/.idea/libraries/compile.xml +++ b/.idea/libraries/compile.xml @@ -7,7 +7,7 @@ - - + + \ No newline at end of file diff --git a/.idea/libraries/runtime.xml b/.idea/libraries/runtime.xml index d4069f2..2ae5c4b 100644 --- a/.idea/libraries/runtime.xml +++ b/.idea/libraries/runtime.xml @@ -8,7 +8,7 @@ - - + + \ No newline at end of file diff --git a/.idea/libraries/test.xml b/.idea/libraries/test.xml index 57ed5ef..b80486a 100644 --- a/.idea/libraries/test.xml +++ b/.idea/libraries/test.xml @@ -8,7 +8,7 @@ - - + + \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 4c33beb..5b2667b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,7 +9,7 @@ ], "java.configuration.updateBuildConfiguration": "automatic", "java.project.referencedLibraries": [ - "${HOME}/.bld/dist/bld-2.1.0.jar", + "${HOME}/.bld/dist/bld-2.0.1.jar", "lib/**/*.jar" ] } diff --git a/README.md b/README.md index 88aaf69..60344f8 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) -[![bld](https://img.shields.io/badge/2.1.0-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) +[![bld](https://img.shields.io/badge/2.0.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) [![Release](https://flat.badgen.net/maven/v/metadata-url/repo.rife2.com/releases/com/uwyn/rife2/bld-testng/maven-metadata.xml?color=blue)](https://repo.rife2.com/#/releases/com/uwyn/rife2/bld-testng) [![Snapshot](https://flat.badgen.net/maven/v/metadata-url/repo.rife2.com/snapshots/com/uwyn/rife2/bld-testng/maven-metadata.xml?label=snapshot)](https://repo.rife2.com/#/snapshots/com/uwyn/rife2/bld-testng) [![GitHub CI](https://github.com/rife2/bld-testng/actions/workflows/bld.yml/badge.svg)](https://github.com/rife2/bld-testng/actions/workflows/bld.yml) diff --git a/examples/.idea/libraries/bld.xml b/examples/.idea/libraries/bld.xml index 8105a64..867d049 100644 --- a/examples/.idea/libraries/bld.xml +++ b/examples/.idea/libraries/bld.xml @@ -2,12 +2,12 @@ - + - + diff --git a/examples/.idea/libraries/compile.xml b/examples/.idea/libraries/compile.xml index 99cc0c0..9bd86aa 100644 --- a/examples/.idea/libraries/compile.xml +++ b/examples/.idea/libraries/compile.xml @@ -7,7 +7,7 @@ - - + + \ No newline at end of file diff --git a/examples/.idea/libraries/runtime.xml b/examples/.idea/libraries/runtime.xml index d4069f2..2ae5c4b 100644 --- a/examples/.idea/libraries/runtime.xml +++ b/examples/.idea/libraries/runtime.xml @@ -8,7 +8,7 @@ - - + + \ No newline at end of file diff --git a/examples/.idea/libraries/test.xml b/examples/.idea/libraries/test.xml index 57ed5ef..b80486a 100644 --- a/examples/.idea/libraries/test.xml +++ b/examples/.idea/libraries/test.xml @@ -8,7 +8,7 @@ - - + + \ No newline at end of file diff --git a/examples/.vscode/settings.json b/examples/.vscode/settings.json index 688ef4b..2104130 100644 --- a/examples/.vscode/settings.json +++ b/examples/.vscode/settings.json @@ -10,7 +10,7 @@ ], "java.configuration.updateBuildConfiguration": "automatic", "java.project.referencedLibraries": [ - "${HOME}/.bld/dist/bld-2.1.0.jar", + "${HOME}/.bld/dist/bld-2.0.1.jar", "lib/**/*.jar" ] } diff --git a/examples/lib/bld/bld-wrapper.jar b/examples/lib/bld/bld-wrapper.jar index dc0e1fa..cea3974 100644 Binary files a/examples/lib/bld/bld-wrapper.jar and b/examples/lib/bld/bld-wrapper.jar differ diff --git a/examples/lib/bld/bld-wrapper.properties b/examples/lib/bld/bld-wrapper.properties index 2d44651..26902e5 100644 --- a/examples/lib/bld/bld-wrapper.properties +++ b/examples/lib/bld/bld-wrapper.properties @@ -1,8 +1,8 @@ bld.downloadExtensionJavadoc=false bld.downloadExtensionSources=true bld.downloadLocation= -bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.8 -bld.extension-testng=com.uwyn.rife2:bld-testng:1.0.0 +bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.8-SNAPSHOT +bld.extension-testng=com.uwyn.rife2:bld-testng:1.0.0-SNAPSHOT bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.sourceDirectories= -bld.version=2.1.0 +bld.version=2.0.1 diff --git a/lib/bld/bld-wrapper.jar b/lib/bld/bld-wrapper.jar index fe98c21..ee23353 100644 Binary files a/lib/bld/bld-wrapper.jar and b/lib/bld/bld-wrapper.jar differ diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties index 5d0bba4..79b2f59 100644 --- a/lib/bld/bld-wrapper.properties +++ b/lib/bld/bld-wrapper.properties @@ -1,8 +1,8 @@ bld.downloadExtensionJavadoc=false bld.downloadExtensionSources=true bld.downloadLocation= -bld.extension-exec=com.uwyn.rife2:bld-exec:1.0.3 -bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.1.5 +bld.extension-exec=com.uwyn.rife2:bld-exec:1.0.2 +bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.1.4 bld.repositories=MAVEN_CENTRAL,MAVEN_LOCAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.sourceDirectories= -bld.version=2.1.0 +bld.version=2.0.1 diff --git a/src/bld/java/rife/bld/extension/TestNgOperationBuild.java b/src/bld/java/rife/bld/extension/TestNgOperationBuild.java index aee5a33..32da44c 100644 --- a/src/bld/java/rife/bld/extension/TestNgOperationBuild.java +++ b/src/bld/java/rife/bld/extension/TestNgOperationBuild.java @@ -33,7 +33,7 @@ public class TestNgOperationBuild extends Project { public TestNgOperationBuild() { pkg = "rife.bld.extension"; name = "bld-testng"; - version = version(1, 0, 0); + version = version(1, 0, 0, "SNAPSHOT"); javaRelease = 17; @@ -42,7 +42,7 @@ public class TestNgOperationBuild extends Project { repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES, RIFE2_SNAPSHOTS); scope(compile) - .include(dependency("com.uwyn.rife2", "bld", version(2, 1, 0))); + .include(dependency("com.uwyn.rife2", "bld", version(2, 0, 1))); scope(test) .include(dependency("org.testng", "testng", version(7, 10, 2))) diff --git a/src/main/java/rife/bld/extension/TestNgOperation.java b/src/main/java/rife/bld/extension/TestNgOperation.java index de4587e..62966eb 100644 --- a/src/main/java/rife/bld/extension/TestNgOperation.java +++ b/src/main/java/rife/bld/extension/TestNgOperation.java @@ -150,7 +150,8 @@ public class TestNgOperation extends TestOperation * @see #excludeGroups(Collection) #excludeGroups(Collection) */ public TestNgOperation excludeGroups(String... group) { - return excludeGroups(List.of(group)); + options_.put("-excludegroups", String.join(",", Arrays.stream(group).filter(this::isNotBlank).toList())); + return this; } /** @@ -308,7 +309,8 @@ public class TestNgOperation extends TestOperation * @see #groups(Collection) #groups(Collection) */ public TestNgOperation groups(String... group) { - return groups(List.of(group)); + options_.put("-groups", String.join(",", Arrays.stream(group).filter(this::isNotBlank).toList())); + return this; } /** @@ -381,7 +383,8 @@ public class TestNgOperation extends TestOperation * @see #listener(Collection) #listener(Collection) */ public TestNgOperation listener(String... listener) { - return listener(List.of(listener)); + options_.put("-listener", String.join(",", Arrays.stream(listener).filter(this::isNotBlank).toList())); + return this; } /** @@ -444,7 +447,9 @@ public class TestNgOperation extends TestOperation * @see #methodSelectors(Collection) #methodSelectors(Collection) */ public TestNgOperation methodSelectors(String... selector) { - return methodSelectors(List.of(selector)); + options_.put("-methodselectors", + String.join(",", Arrays.stream(selector).filter(this::isNotBlank).toList())); + return this; } /** @@ -471,7 +476,8 @@ public class TestNgOperation extends TestOperation * @see #methods(Collection) #methods(Collection) */ public TestNgOperation methods(String... method) { - return methods(List.of(method)); + methods_.addAll(List.of(method)); + return this; } /** @@ -511,24 +517,31 @@ public class TestNgOperation extends TestOperation } /** - * 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 + * 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 + * @param objectFactory the object factory * @return this operation instance - * @see #objectFactory(Collection) #objectFactory(Collection) */ - public TestNgOperation objectFactory(String... factory) { - return objectFactory(List.of(factory)); + public TestNgOperation objectFactory(String objectFactory) { + options_.put("-objectfactory", objectFactory); + return this; + } + + /** + * The list of {@code .class} files or class names implementing {@code ITestRunnerFactory}. + * + * @param factory one or more factories + * @return this operation instance + * @see #objectFactory(Collection) #objectFactory(Collection) + */ + public TestNgOperation objectFactory(String... factory) { + options_.put("-objectfactory", String.join(",", Arrays.stream(factory).filter(this::isNotBlank).toList())); + 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 the list of factories * @return this operation instance @@ -557,7 +570,9 @@ public class TestNgOperation extends TestOperation * @see #overrideIncludedMethods(Collection) #overrideIncludedMethods(Collection) */ public TestNgOperation overrideIncludedMethods(String... method) { - return overrideIncludedMethods(List.of(method)); + options_.put("-overrideincludedmethods", + String.join(",", Arrays.stream(method).filter(this::isNotBlank).toList())); + return this; } /** @@ -585,7 +600,8 @@ public class TestNgOperation extends TestOperation * @see #packages(Collection) #packages(Collection) */ public TestNgOperation packages(String... name) { - return packages(List.of(name)); + packages_.addAll(Arrays.stream(name).filter(this::isNotBlank).toList()); + return this; } /** @@ -767,7 +783,9 @@ public class TestNgOperation extends TestOperation * @see #spiListenersToSkip(Collection) #spiListenersToSkip(Collection) */ public TestNgOperation spiListenersToSkip(String... listenerToSkip) { - return spiListenersToSkip(List.of(listenerToSkip)); + options_.put("-spilistenerstoskip", + String.join(",", Arrays.stream(listenerToSkip).filter(this::isNotBlank).toList())); + return this; } /** @@ -822,7 +840,8 @@ public class TestNgOperation extends TestOperation * @see #suites(Collection) #suites(Collection) */ public TestNgOperation suites(String... suite) { - return suites(List.of(suite)); + suites_.addAll(Arrays.stream(suite).filter(this::isNotBlank).toList()); + return this; } /** @@ -869,7 +888,8 @@ public class TestNgOperation extends TestOperation * @see #testClass(Collection) #testClass(Collection) */ public TestNgOperation testClass(String... aClass) { - return testClass(List.of(aClass)); + options_.put("-testclass", String.join(",", Arrays.stream(aClass).filter(this::isNotBlank).toList())); + return this; } /** @@ -894,7 +914,8 @@ public class TestNgOperation extends TestOperation * @see #testClasspath(String...) #testClasspath(String...) */ public TestNgOperation testClasspath(String... entry) { - return testClasspath(List.of(entry)); + testClasspath_.addAll(Arrays.stream(entry).filter(this::isNotBlank).toList()); + return this; } /** @@ -955,7 +976,9 @@ public class TestNgOperation extends TestOperation * @see #testNames(Collection) #testNames(Collection) */ public TestNgOperation testNames(String... name) { - return testNames(List.of(name)); + options_.put("-testnames", + Arrays.stream(name).filter(this::isNotBlank).map(s -> '"' + s + '"').collect(Collectors.joining(","))); + return this; } /** diff --git a/src/test/java/rife/bld/extension/TestNgExample.java b/src/test/java/rife/bld/extension/TestNgExample.java index abe0606..bfe36ca 100644 --- a/src/test/java/rife/bld/extension/TestNgExample.java +++ b/src/test/java/rife/bld/extension/TestNgExample.java @@ -24,7 +24,6 @@ package rife.bld.extension; */ @SuppressWarnings({"PMD.TestClassWithoutTestCases", "unused"}) class TestNgExample { - @SuppressWarnings("SameReturnValue") public String getMessage() { return "Hello World!"; }