Added option to set the tests classpath
This commit is contained in:
parent
89a662a1c4
commit
65b9ea190b
8 changed files with 55 additions and 25 deletions
|
@ -77,32 +77,42 @@ class TestNgOperationTest {
|
|||
assertThatThrownBy(() ->
|
||||
new TestNgOperation().fromProject(new Project())
|
||||
.testClass("rife.bld.extension.TestNgSimpleTest")
|
||||
.execute()).isInstanceOf(ExitStatusException.class);
|
||||
.execute())
|
||||
.as("with testClass").isInstanceOf(ExitStatusException.class);
|
||||
|
||||
assertThatThrownBy(() ->
|
||||
new TestNgOperation().fromProject(new Project())
|
||||
.suites("src/test/resources/testng.xml")
|
||||
.execute()).isInstanceOf(ExitStatusException.class);
|
||||
.execute())
|
||||
.as("with suites").isInstanceOf(ExitStatusException.class);
|
||||
|
||||
assertThatCode(() ->
|
||||
new TestNgOperation().fromProject(new Project())
|
||||
.testClass("rife.bld.extension.TestNgSimpleTest")
|
||||
.methods("rife.bld.extension.TestNgSimpleTest.verifyHello")
|
||||
.execute())
|
||||
.doesNotThrowAnyException();
|
||||
.as("with methods").doesNotThrowAnyException();
|
||||
|
||||
assertThatCode(() ->
|
||||
new TestNgOperation().fromProject(new Project())
|
||||
.suites("src/test/resources/testng2.xml")
|
||||
.execute())
|
||||
.doesNotThrowAnyException();
|
||||
.as("suite 2").doesNotThrowAnyException();
|
||||
|
||||
assertThatCode(() ->
|
||||
new TestNgOperation().fromProject(new Project())
|
||||
.suites("src/test/resources/testng3.xml")
|
||||
.log(2)
|
||||
.execute())
|
||||
.doesNotThrowAnyException();
|
||||
.as("suite 3").doesNotThrowAnyException();
|
||||
|
||||
assertThatCode(() ->
|
||||
new TestNgOperation().fromProject(new Project())
|
||||
.suites("src/test/resources/testng3.xml")
|
||||
.testClasspath("lib/test/*", "build/main", "build/test")
|
||||
.log(2)
|
||||
.execute())
|
||||
.as("with run classpath").doesNotThrowAnyException();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -30,13 +30,13 @@ class TestNgSimpleTest {
|
|||
new TestNgSimpleTest().verifyHello();
|
||||
}
|
||||
|
||||
@Test
|
||||
void verifyHello() {
|
||||
Assert.assertTrue(true);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFail() {
|
||||
Assert.fail("failed");
|
||||
}
|
||||
|
||||
@Test
|
||||
void verifyHello() {
|
||||
Assert.assertTrue(true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue