use of org.testng.TestNG in project mockito by mockito.
the class TestNGShouldFailWhenMockitoListenerFailsTest method report_failure_on_incorrect_stubbing_syntax_with_matchers_in_configuration_methods.
@Test
public void report_failure_on_incorrect_stubbing_syntax_with_matchers_in_configuration_methods() throws Exception {
TestNG testNG = new_TestNG_with_failure_recorder_for(FailingOnPurposeBecauseWrongStubbingSyntaxInConfigurationMethod.class);
testNG.run();
assertTrue(testNG.hasFailure());
assertThat(failureRecorder.lastThrowable()).isInstanceOf(InvalidUseOfMatchersException.class);
}
use of org.testng.TestNG in project mockito by mockito.
the class TestNGShouldFailWhenMockitoListenerFailsTest method report_failure_on_incorrect_annotation_usage.
public void report_failure_on_incorrect_annotation_usage() throws Throwable {
TestNG testNG = new_TestNG_with_failure_recorder_for(FailingOnPurposeBecauseIncorrectAnnotationUsage.class);
testNG.run();
assertTrue(testNG.hasFailure());
assertThat(failureRecorder.lastThrowable()).isInstanceOf(MockitoException.class);
}
use of org.testng.TestNG in project mockito by mockito.
the class TestNGShouldFailWhenMockitoListenerFailsTest method new_TestNG_with_failure_recorder_for.
private TestNG new_TestNG_with_failure_recorder_for(Class<?>... testNGClasses) {
TestNG testNG = new TestNG();
testNG.setVerbose(0);
testNG.setUseDefaultListeners(false);
testNG.addListener(failureRecorder);
testNG.setTestClasses(testNGClasses);
return testNG;
}
use of org.testng.TestNG in project powermock by powermock.
the class SimpleBaseTest method create.
public static TestNG create(Class<?>... testClasses) {
TestNG result = create();
result.setTestClasses(testClasses);
return result;
}
use of org.testng.TestNG in project powermock by powermock.
the class SimpleBaseTest method create.
protected TestNG create(XmlSuite... suites) {
TestNG result = create();
result.setXmlSuites(Arrays.asList(suites));
return result;
}
Aggregations