Skip to content

Commit

Permalink
Added supprot for TestNG 7.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed Apr 7, 2024
1 parent 645e6d1 commit d74ee9d
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 8 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ Don't forget to add a TestNG `test` dependency to your build file, as it is not

```java
repositories = List.of(MAVEN_CENTRAL);
scope(test).include(dependency("org.testng", "testng", version(7, 9, 0)));

scope(test).include(dependency("org.testng", "testng", version(7, 10, 0)));
```
2 changes: 1 addition & 1 deletion examples/lib/bld/bld-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.extensions=com.uwyn.rife2:bld-testng:0.9.6-SNAPSHOT
bld.extensions=com.uwyn.rife2:bld-testng:0.9.6
bld.extension.jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.5
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.downloadLocation=
Expand Down
3 changes: 2 additions & 1 deletion examples/src/bld/java/com/example/ExamplesBuild.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ public ExamplesBuild() {
version = version(0, 1, 0);

javaRelease = 17;

downloadSources = true;
autoDownloadPurge = true;

repositories = List.of(MAVEN_CENTRAL);

scope(test).include(dependency("org.testng", "testng", version(7, 9, 0)));
scope(test).include(dependency("org.testng", "testng", version(7, 10, 0)));
}

public static void main(String[] args) {
Expand Down
4 changes: 2 additions & 2 deletions src/bld/java/rife/bld/extension/TestNgOperationBuild.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class TestNgOperationBuild extends Project {
public TestNgOperationBuild() {
pkg = "rife.bld.extension";
name = "bld-testng";
version = version(0, 9, 6, "SNAPSHOT");
version = version(0, 9, 6);

javaRelease = 17;
downloadSources = true;
Expand All @@ -47,7 +47,7 @@ public TestNgOperationBuild() {
.include(dependency("com.uwyn.rife2", "bld", version(1, 9, 0)));

scope(test)
.include(dependency("org.testng", "testng", version(7, 9, 0)))
.include(dependency("org.testng", "testng", version(7, 10, 0)))
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 2)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 2)))
.include(dependency("org.assertj", "assertj-core", version(3, 25, 3)));
Expand Down
38 changes: 37 additions & 1 deletion src/main/java/rife/bld/extension/TestNgOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ public TestNgOperation failurePolicy(FailurePolicy policy) {
}

/**
* Should TestNG consider failures in Data Providers as test failures.
* Should TestNG generate results on a per suite basis by creating a sub directory for each suite and dumping
* results into it.
*
* <p>Default is {@code false}</p>.
*
Expand Down Expand Up @@ -345,6 +346,29 @@ public TestNgOperation listener(Collection<String> listener) {
return this;
}

/**
* An implementation of {@code ListenerComparator} that will be used by TestNG to determine order of execution for
* listeners.
*
* @param listenerComparator the listener comparator
* @return this operation instance
*/
public TestNgOperation listenerComparator(String listenerComparator) {
options.put("-listenercomparator", listenerComparator);
return this;
}

/**
* The factory used to create TestNG listeners.
*
* @param listenerFactory the listener factory
* @return this operation instance
*/
public TestNgOperation listenerFactory(String listenerFactory) {
options.put("-listenerfactory", listenerFactory);
return this;
}

/**
* Set the Level of verbosity.
*
Expand Down Expand Up @@ -429,6 +453,18 @@ public TestNgOperation mixed(Boolean isMixed) {
return this;
}

/**
* Fully qualified class name that implements {@code org.testng.ITestObjectFactory} which can be used to create
* test class and listener instances.
*
* @param objectFactory the object factory
* @return this operation instance
*/
public TestNgOperation objectFactory(String objectFactory) {
options.put("-objectfactory", objectFactory);
return this;
}

/**
* The list of {@code .class} files or class names implementing {@code ITestRunnerFactory}.
*
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/rife/bld/extension/TestNgOperationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package rife.bld.extension;

import org.junit.jupiter.api.Test;
import rife.bld.Project; // NOPMD
import rife.bld.Project;
import rife.bld.operations.exceptions.ExitStatusException;

import java.util.List;
Expand Down

0 comments on commit d74ee9d

Please sign in to comment.