Search in sources :

Example 71 with Failure

use of org.junit.runner.notification.Failure in project spring-boot by spring-projects.

the class Mockito110Tests method runTests.

private void runTests(Class<?> testClass) {
    Result result = new JUnitCore().run(testClass);
    for (Failure failure : result.getFailures()) {
        System.err.println(failure.getTrace());
    }
    assertThat(result.getFailureCount()).isEqualTo(0);
    assertThat(result.getRunCount()).isGreaterThan(0);
}
Also used : JUnitCore(org.junit.runner.JUnitCore) Failure(org.junit.runner.notification.Failure) Result(org.junit.runner.Result)

Example 72 with Failure

use of org.junit.runner.notification.Failure in project spring-boot by spring-projects.

the class Mockito21Tests method runTests.

private void runTests(Class<?> testClass) {
    Result result = new JUnitCore().run(testClass);
    for (Failure failure : result.getFailures()) {
        System.err.println(failure.getTrace());
    }
    assertThat(result.getFailureCount()).isEqualTo(0);
    assertThat(result.getRunCount()).isGreaterThan(0);
}
Also used : JUnitCore(org.junit.runner.JUnitCore) Failure(org.junit.runner.notification.Failure) Result(org.junit.runner.Result)

Example 73 with Failure

use of org.junit.runner.notification.Failure in project spring-boot by spring-projects.

the class Mockito22Tests method runTests.

private void runTests(Class<?> testClass) {
    Result result = new JUnitCore().run(testClass);
    for (Failure failure : result.getFailures()) {
        System.err.println(failure.getTrace());
    }
    assertThat(result.getFailureCount()).isEqualTo(0);
    assertThat(result.getRunCount()).isGreaterThan(0);
}
Also used : JUnitCore(org.junit.runner.JUnitCore) Failure(org.junit.runner.notification.Failure) Result(org.junit.runner.Result)

Example 74 with Failure

use of org.junit.runner.notification.Failure in project spring-boot by spring-projects.

the class Mockito25Tests method runTests.

private void runTests(Class<?> testClass) {
    Result result = new JUnitCore().run(testClass);
    for (Failure failure : result.getFailures()) {
        System.err.println(failure.getTrace());
    }
    assertThat(result.getFailureCount()).isEqualTo(0);
    assertThat(result.getRunCount()).isGreaterThan(0);
}
Also used : JUnitCore(org.junit.runner.JUnitCore) Failure(org.junit.runner.notification.Failure) Result(org.junit.runner.Result)

Example 75 with Failure

use of org.junit.runner.notification.Failure in project lombok by rzwitserloot.

the class DirectoryRunner method run.

@Override
public void run(RunNotifier notifier) {
    if (failure != null) {
        reportInitializationFailure(notifier, description, failure);
        return;
    }
    for (Map.Entry<String, Description> entry : tests.entrySet()) {
        Description testDescription = entry.getValue();
        FileTester tester;
        try {
            tester = createTester(entry.getKey());
        } catch (IOException e) {
            reportInitializationFailure(notifier, testDescription, e);
            continue;
        }
        if (tester == null) {
            notifier.fireTestIgnored(testDescription);
            continue;
        }
        notifier.fireTestStarted(testDescription);
        try {
            tester.runTest();
        } catch (Throwable t) {
            notifier.fireTestFailure(new Failure(testDescription, t));
        }
        notifier.fireTestFinished(testDescription);
    }
}
Also used : Description(org.junit.runner.Description) IOException(java.io.IOException) TreeMap(java.util.TreeMap) Map(java.util.Map) Failure(org.junit.runner.notification.Failure)

Aggregations

Failure (org.junit.runner.notification.Failure)194 Test (org.junit.Test)101 Result (org.junit.runner.Result)91 Description (org.junit.runner.Description)40 IOException (java.io.IOException)32 UnitTest (org.apache.geode.test.junit.categories.UnitTest)27 JUnitCore (org.junit.runner.JUnitCore)24 FileInputStream (java.io.FileInputStream)20 InputStream (java.io.InputStream)20 RunListener (org.junit.runner.notification.RunListener)19 ArrayList (java.util.ArrayList)11 ByteArrayInputStream (java.io.ByteArrayInputStream)9 ComparisonFailure (org.junit.ComparisonFailure)9 JUnit4TestListener (com.intellij.junit4.JUnit4TestListener)7 RunNotifier (org.junit.runner.notification.RunNotifier)7 ResourceImpl (ddf.catalog.resource.impl.ResourceImpl)6 Request (org.junit.runner.Request)6 BinaryContentImpl (ddf.catalog.data.impl.BinaryContentImpl)5 Before (org.junit.Before)5 Runner (org.junit.runner.Runner)5