@@ -78,7 +80,7 @@ public class JUnitLauncherTaskTest {
}
}
}
/**
* Tests that when a test, that's isn't configured with {@code haltOnFailure=true}, continues the
* build even when there are test failures
@@ -368,6 +370,39 @@ public class JUnitLauncherTaskTest {
Assert.assertFalse("testMethodIncludeTagisNotExecutedTagSampleTest2 was expected NOT to be run", wasTestRun(tracker2, JupiterTagSampleTest.class.getName(),
* Tests that failure at with beforeall stops the build
*/
@Test
public void testBeforeAllFailureStopsBuild() throws Exception {
final String targetName = "test-beforeall-failure-stops-build";
final Path trackerFile = setupTrackerProperty(targetName);
try {
buildRule.executeTarget(targetName);
Assert.fail(targetName + " was expected to fail");
} catch (BuildException e) {
// expected, but do further tests to make sure the build failed for expected reason
if (!verifySetupFailed(trackerFile, JupiterSampleTestFailingBeforeAll.class.getName())) {
// throw back the original cause
throw e;
}
}
}
/**
* Tests that when a test, that's isn't configured with {@code haltOnFailure=true}, continues the
* build even when there are test failures
*/
@Test
public void testBeforeAllFailureContinuesBuild() throws Exception {
final String targetName = "test-beforeall-failure-continues-build";
final Path trackerFile = setupTrackerProperty(targetName);
buildRule.executeTarget(targetName);
Assert.assertTrue("Expected @BeforeAll failure to lead to failing testcase", verifySetupFailed(trackerFile, JupiterSampleTestFailingBeforeAll.class.getName()));
}
/**
* Tests execution of a test which is configured to execute only methods with special tags, two classes specified
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.