Search in sources :

Example 66 with JUnitCore

use of org.junit.runner.JUnitCore in project java-algorithms-implementation by phishman3579.

the class AllTests method main.

/**
     * @param args
     */
public static void main(String[] args) {
    JUnitCore core = new JUnitCore();
    core.run(AllTests.class);
}
Also used : JUnitCore(org.junit.runner.JUnitCore)

Example 67 with JUnitCore

use of org.junit.runner.JUnitCore in project zm-mailbox by Zimbra.

the class TestUtil method runTest.

public static void runTest(Class<?> testClass) {
    JUnitCore junit = new JUnitCore();
    junit.addListener(new TestLogger());
    ZimbraLog.test.info("Starting unit test %s.", testClass.getName());
    junit.run(testClass);
}
Also used : JUnitCore(org.junit.runner.JUnitCore)

Example 68 with JUnitCore

use of org.junit.runner.JUnitCore in project zm-mailbox by Zimbra.

the class ZimbraSuite method runTestsInternal.

private static TestResults runTestsInternal(Collection<Class> testClasses, Iterable<Request> requests) {
    JUnitCore junit = new JUnitCore();
    junit.addListener(new TestLogger());
    TestResults results = new TestResults();
    junit.addListener(results);
    if (testClasses != null && testClasses.size() > 0) {
        Class<?>[] classArray = new Class<?>[testClasses.size()];
        testClasses.toArray(classArray);
        junit.run(classArray);
    }
    if (requests != null) {
        for (Request request : requests) {
            junit.run(request);
        }
    }
    return results;
}
Also used : JUnitCore(org.junit.runner.JUnitCore) Request(org.junit.runner.Request)

Example 69 with JUnitCore

use of org.junit.runner.JUnitCore in project zm-mailbox by Zimbra.

the class TestImapClient method main.

public static void main(String... args) throws Exception {
    JUnitCore junit = new JUnitCore();
    if (args.length > 0) {
        for (String test : args) {
            String method = String.format("test%C%s", test.charAt(0), test.substring(1));
            junit.run(Request.method(TestImap.class, method));
        }
    } else {
        junit.run(TestImap.class);
    }
}
Also used : JUnitCore(org.junit.runner.JUnitCore)

Example 70 with JUnitCore

use of org.junit.runner.JUnitCore in project geode by apache.

the class CategoryWithParameterizedRunnerFactoryTest method testWorkingCategoryAndParameterized.

@Test
public void testWorkingCategoryAndParameterized() {
    Request request = Request.aClass(WorkingCategoryClass.class);
    ExposedParameterized runner = (ExposedParameterized) request.getRunner();
    request = request.filterWith(new CategoryFilter((ExposedGetAnnotations) runner.getChildren().get(0)));
    Result result = new JUnitCore().run(request);
    assertEquals(2, result.getRunCount());
}
Also used : JUnitCore(org.junit.runner.JUnitCore) Request(org.junit.runner.Request) Result(org.junit.runner.Result) Test(org.junit.Test) UnitTest(org.apache.geode.test.junit.categories.UnitTest)

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