Search in sources :

Example 1 with TestNG

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);
}
Also used : TestNG(org.testng.TestNG) Test(org.testng.annotations.Test)

Example 2 with TestNG

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);
}
Also used : TestNG(org.testng.TestNG)

Example 3 with TestNG

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;
}
Also used : TestNG(org.testng.TestNG)

Example 4 with 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;
}
Also used : TestNG(org.testng.TestNG)

Example 5 with TestNG

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;
}
Also used : TestNG(org.testng.TestNG)

Aggregations

TestNG (org.testng.TestNG)18 Test (org.testng.annotations.Test)5 TrackingTestNGTestListener (org.springframework.test.context.testng.TrackingTestNGTestListener)2 TestListenerAdapter (org.testng.TestListenerAdapter)2 BeforeClass (org.testng.annotations.BeforeClass)2 IOException (java.io.IOException)1 InetAddress (java.net.InetAddress)1 MalformedURLException (java.net.MalformedURLException)1 UnknownHostException (java.net.UnknownHostException)1 ArrayList (java.util.ArrayList)1 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)1 GradleException (org.gradle.api.GradleException)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1 ITestListener (org.testng.ITestListener)1 SimpleBaseTest (samples.testng.SimpleBaseTest)1