Search in sources :

Example 51 with JUnitCore

use of org.junit.runner.JUnitCore in project jna by java-native-access.

the class GDI32UtilTest method main.

public static void main(String[] args) {
    JUnitCore jUnitCore = new JUnitCore();
    jUnitCore.run(GDI32UtilTest.class);
}
Also used : JUnitCore(org.junit.runner.JUnitCore)

Example 52 with JUnitCore

use of org.junit.runner.JUnitCore in project junit4 by junit-team.

the class AnnotationTest method testRunAllAfterClassesRegardless.

public void testRunAllAfterClassesRegardless() {
    log = "";
    JUnitCore core = new JUnitCore();
    Result result = core.run(RunAllAfterClassesRegardless.class);
    assertTrue(log.contains("one"));
    assertTrue(log.contains("two"));
    assertEquals(2, result.getFailureCount());
}
Also used : JUnitCore(org.junit.runner.JUnitCore) Result(org.junit.runner.Result) PrintableResult.testResult(org.junit.experimental.results.PrintableResult.testResult)

Example 53 with JUnitCore

use of org.junit.runner.JUnitCore in project junit4 by junit-team.

the class ExpectedTest method expected.

@Test
public void expected() {
    JUnitCore core = new JUnitCore();
    Result result = core.run(Expected.class);
    assertTrue(result.wasSuccessful());
}
Also used : JUnitCore(org.junit.runner.JUnitCore) Result(org.junit.runner.Result) Test(org.junit.Test)

Example 54 with JUnitCore

use of org.junit.runner.JUnitCore in project junit4 by junit-team.

the class TimeoutTest method runAndTime.

private long runAndTime(Class<?> clazz) {
    JUnitCore core = new JUnitCore();
    long startTime = System.currentTimeMillis();
    core.run(clazz);
    long totalTime = System.currentTimeMillis() - startTime;
    return totalTime;
}
Also used : JUnitCore(org.junit.runner.JUnitCore)

Example 55 with JUnitCore

use of org.junit.runner.JUnitCore in project junit4 by junit-team.

the class TimeoutTest method successWithTimeout.

@Test
public void successWithTimeout() throws Exception {
    JUnitCore core = new JUnitCore();
    Result result = core.run(SuccessWithTimeoutTest.class);
    assertEquals(1, result.getRunCount());
    assertEquals(0, result.getFailureCount());
}
Also used : JUnitCore(org.junit.runner.JUnitCore) Result(org.junit.runner.Result) TestResult(junit.framework.TestResult) Test(org.junit.Test)

Aggregations

JUnitCore (org.junit.runner.JUnitCore)173 Result (org.junit.runner.Result)104 Test (org.junit.Test)88 Request (org.junit.runner.Request)33 Failure (org.junit.runner.notification.Failure)24 PrintableResult.testResult (org.junit.experimental.results.PrintableResult.testResult)22 RunListener (org.junit.runner.notification.RunListener)17 Description (org.junit.runner.Description)16 ArrayList (java.util.ArrayList)14 TestResult (junit.framework.TestResult)14 TextListener (org.junit.internal.TextListener)12 Runner (org.junit.runner.Runner)9 RandomizedRunner (com.carrotsearch.randomizedtesting.RandomizedRunner)7 TestSuiteModel (com.google.testing.junit.runner.model.TestSuiteModel)6 ByteArrayOutputStream (java.io.ByteArrayOutputStream)6 OutputStream (java.io.OutputStream)5 CategoryFilter (org.junit.experimental.categories.Categories.CategoryFilter)5 File (java.io.File)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)4 InOrder (org.mockito.InOrder)4