Compare commits
No commits in common. "4e444841579927d4cb26f6146bb885700ed96880" and "d4931cc3af61e0997af3cb75297febacdb1ddcd9" have entirely different histories.
4e44484157
...
d4931cc3af
7 changed files with 20 additions and 155 deletions
6
.idea/bld.xml
generated
6
.idea/bld.xml
generated
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="BldConfiguration">
|
|
||||||
<events />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,8 +1,8 @@
|
||||||
bld.downloadExtensionJavadoc=false
|
bld.downloadExtensionJavadoc=false
|
||||||
bld.downloadExtensionSources=true
|
bld.downloadExtensionSources=true
|
||||||
bld.downloadLocation=
|
bld.downloadLocation=
|
||||||
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.8-SNAPSHOT
|
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.7
|
||||||
bld.extension-testng=com.uwyn.rife2:bld-testng:1.0.0-SNAPSHOT
|
bld.extension-testng=com.uwyn.rife2:bld-testng:0.9.9
|
||||||
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
|
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
|
||||||
bld.sourceDirectories=
|
bld.sourceDirectories=
|
||||||
bld.version=2.0.1
|
bld.version=2.0.1
|
||||||
|
|
|
@ -24,7 +24,10 @@ import rife.bld.publish.PublishScm;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static rife.bld.dependencies.Repository.*;
|
import static rife.bld.dependencies.Repository.MAVEN_CENTRAL;
|
||||||
|
import static rife.bld.dependencies.Repository.MAVEN_LOCAL;
|
||||||
|
import static rife.bld.dependencies.Repository.RIFE2_RELEASES;
|
||||||
|
import static rife.bld.dependencies.Repository.RIFE2_SNAPSHOTS;
|
||||||
import static rife.bld.dependencies.Scope.compile;
|
import static rife.bld.dependencies.Scope.compile;
|
||||||
import static rife.bld.dependencies.Scope.test;
|
import static rife.bld.dependencies.Scope.test;
|
||||||
import static rife.bld.operations.JavadocOptions.DocLinkOption.NO_MISSING;
|
import static rife.bld.operations.JavadocOptions.DocLinkOption.NO_MISSING;
|
||||||
|
@ -33,7 +36,7 @@ public class TestNgOperationBuild extends Project {
|
||||||
public TestNgOperationBuild() {
|
public TestNgOperationBuild() {
|
||||||
pkg = "rife.bld.extension";
|
pkg = "rife.bld.extension";
|
||||||
name = "bld-testng";
|
name = "bld-testng";
|
||||||
version = version(1, 0, 0, "SNAPSHOT");
|
version = version(0, 9, 9);
|
||||||
|
|
||||||
javaRelease = 17;
|
javaRelease = 17;
|
||||||
|
|
||||||
|
@ -46,8 +49,8 @@ public class TestNgOperationBuild extends Project {
|
||||||
|
|
||||||
scope(test)
|
scope(test)
|
||||||
.include(dependency("org.testng", "testng", version(7, 10, 2)))
|
.include(dependency("org.testng", "testng", version(7, 10, 2)))
|
||||||
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 11, 0)))
|
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 3)))
|
||||||
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 0)))
|
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 3)))
|
||||||
.include(dependency("org.assertj", "assertj-core", version(3, 26, 3)));
|
.include(dependency("org.assertj", "assertj-core", version(3, 26, 3)));
|
||||||
|
|
||||||
javadocOperation()
|
javadocOperation()
|
||||||
|
|
|
@ -118,30 +118,6 @@ public class TestNgOperation extends TestOperation<TestNgOperation, List<String>
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The directory where the reports will be generated
|
|
||||||
*
|
|
||||||
* <p>Default is {@code build/test-output})</p>
|
|
||||||
*
|
|
||||||
* @param directoryPath the directory path
|
|
||||||
* @return this operation instance
|
|
||||||
*/
|
|
||||||
public TestNgOperation directory(File directoryPath) {
|
|
||||||
return directory(directoryPath.getAbsolutePath());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The directory where the reports will be generated
|
|
||||||
*
|
|
||||||
* <p>Default is {@code build/test-output})</p>
|
|
||||||
*
|
|
||||||
* @param directoryPath the directory path
|
|
||||||
* @return this operation instance
|
|
||||||
*/
|
|
||||||
public TestNgOperation directory(Path directoryPath) {
|
|
||||||
return directory(directoryPath.toFile());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The list of groups you want to be excluded from this run.
|
* The list of groups you want to be excluded from this run.
|
||||||
*
|
*
|
||||||
|
@ -702,49 +678,10 @@ public class TestNgOperation extends TestOperation<TestNgOperation, List<String>
|
||||||
*
|
*
|
||||||
* @param directory one or more directories
|
* @param directory one or more directories
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
* @see #sourceDir(Collection)
|
* @see #sourceDir(String...) #sourceDir(String...)
|
||||||
*/
|
*/
|
||||||
public TestNgOperation sourceDir(String... directory) {
|
public TestNgOperation sourceDir(String... directory) {
|
||||||
return sourceDir(List.of(directory));
|
options_.put("-sourcedir", String.join(";", Arrays.stream(directory).filter(this::isNotBlank).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 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<String> directory) {
|
|
||||||
options_.put("-sourcedir", String.join(";", directory.stream().filter(this::isNotBlank).toList()));
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -755,23 +692,11 @@ public class TestNgOperation extends TestOperation<TestNgOperation, List<String>
|
||||||
*
|
*
|
||||||
* @param directory the list of directories
|
* @param directory the list of directories
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
* @see #sourceDir(File...)
|
* @see #sourceDir(String...) #sourceDir(String...)
|
||||||
*/
|
*/
|
||||||
public TestNgOperation sourceDirFiles(Collection<File> directory) {
|
public TestNgOperation sourceDir(Collection<String> directory) {
|
||||||
return sourceDir(directory.stream().map(File::getAbsolutePath).toList());
|
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(Path...)
|
|
||||||
*/
|
|
||||||
public TestNgOperation sourceDirPaths(Collection<Path> directory) {
|
|
||||||
return sourceDirFiles(directory.stream().map(Path::toFile).toList());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1106,30 +1031,6 @@ public class TestNgOperation extends TestOperation<TestNgOperation, List<String>
|
||||||
return this;
|
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
|
* Parallel Mechanisms
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -22,7 +22,7 @@ package rife.bld.extension;
|
||||||
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
|
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"PMD.TestClassWithoutTestCases", "unused"})
|
@SuppressWarnings("PMD.TestClassWithoutTestCases")
|
||||||
class TestNgExample {
|
class TestNgExample {
|
||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
return "Hello World!";
|
return "Hello World!";
|
||||||
|
|
|
@ -25,7 +25,6 @@ import org.testng.annotations.Test;
|
||||||
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
|
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
|
||||||
class TestNgExampleTest {
|
class TestNgExampleTest {
|
||||||
private final TestNgExample example = new TestNgExample();
|
private final TestNgExample example = new TestNgExample();
|
||||||
|
|
||||||
|
|
|
@ -140,16 +140,8 @@ class TestNgOperationTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testDirectory() {
|
void testDirectory() {
|
||||||
var foo = new File("FOO");
|
|
||||||
|
|
||||||
var op = new TestNgOperation().directory(FOO);
|
var op = new TestNgOperation().directory(FOO);
|
||||||
assertThat(op.options().get("-d")).as("as string").isEqualTo(FOO);
|
assertThat(op.options().get("-d")).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
|
@Test
|
||||||
|
@ -409,28 +401,11 @@ class TestNgOperationTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSourceDir() {
|
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);
|
var op = new TestNgOperation().sourceDir(FOO, BAR);
|
||||||
assertThat(op.options().get("-sourcedir")).as("String...").isEqualTo(foobar);
|
assertThat(op.options().get("-sourcedir")).isEqualTo(String.format("%s;%s", FOO, BAR));
|
||||||
|
|
||||||
op = new TestNgOperation().sourceDir(List.of(FOO, BAR));
|
op = new TestNgOperation().sourceDir(List.of(FOO, BAR));
|
||||||
assertThat(op.options().get("-sourcedir")).as("List(String...)").isEqualTo(foobar);
|
assertThat(op.options().get("-sourcedir")).as("as list").isEqualTo(String.format("%s;%s", FOO, BAR));
|
||||||
|
|
||||||
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
|
@Test
|
||||||
|
@ -504,14 +479,7 @@ class TestNgOperationTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testXmlPathInJar() {
|
void testXmlPathInJar() {
|
||||||
var foo = new File(FOO);
|
|
||||||
var op = new TestNgOperation().xmlPathInJar(FOO);
|
var op = new TestNgOperation().xmlPathInJar(FOO);
|
||||||
assertThat(op.options().get("-xmlpathinjar")).as("as string").isEqualTo(FOO);
|
assertThat(op.options().get("-xmlpathinjar")).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());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue