Example usage for junit.textui TestRunner run

List of usage examples for junit.textui TestRunner run

Introduction

In this page you can find the example usage for junit.textui TestRunner run.

Prototype

static public TestResult run(Test test) 

Source Link

Document

Runs a single test and collects its results.

Usage

From source file:edu.internet2.middleware.psp.PSPOptionsTest.java

public static void main(String[] args) {
    TestRunner.run(PSPOptionsTest.class);
    // TestRunner.run(new PSPOptionsTest("testCalc"));
}

From source file:CalendarUtilsTest.java

public static void main(String[] args) {
    TestRunner.run(suite());
}

From source file:edu.internet2.middleware.psp.shibboleth.AllGroupNamesDataConnectorTest.java

/**
 * Run tests./*from w  w  w .jav a  2  s  .co  m*/
 * 
 * @param args
 */
public static void main(String[] args) {
    TestRunner.run(AllGroupNamesDataConnectorTest.class);
    // TestRunner.run(new AllGroupNamesDataConnectorTest("testGetAllIdentifiers"));
}

From source file:edu.internet2.middleware.psp.shibboleth.AllStemNamesDataConnectorTest.java

/**
 * Run tests.//from  w  ww. ja v a  2  s  .c  o  m
 * 
 * @param args
 */
public static void main(String[] args) {
    TestRunner.run(AllStemNamesDataConnectorTest.class);
    // TestRunner.run(new AllStemNamesDataConnectorTest("testGetAllIdentifiers"));
}

From source file:edu.internet2.middleware.psp.shibboleth.AllMemberSubjectIdsDataConnectorTest.java

/**
 * Run tests./*from  ww  w. jav  a2 s .c  o  m*/
 * 
 * @param args
 */
public static void main(String[] args) {
    // TestRunner.run(MemberSourceDataConnectorTest.class);
    TestRunner.run(new AllMemberSubjectIdsDataConnectorTest("testGetAllIdentifiers"));
}

From source file:koper.kafka.KafkaSenderTest.java

public static void main(String[] args) {
    TestRunner.run(KafkaSenderTest.class);
}

From source file:koper.kafka.SendMsgAopTest.java

public static void main(String[] args) {
    TestRunner.run(SendMsgAopTest.class);
}

From source file:grails.util.RunTests.java

public static void main(String[] args) {
    int exitCode = 0;
    try {/*from  w ww .  j  ava2  s  .co  m*/
        log.info("Bootstrapping Grails from classpath");
        ConfigurableApplicationContext appCtx = (ConfigurableApplicationContext) GrailsUtil
                .bootstrapGrailsFromClassPath();
        GrailsApplication application = (GrailsApplication) appCtx.getBean(GrailsApplication.APPLICATION_ID);

        Class[] allClasses = application.getAllClasses();
        log.debug("Going through [" + allClasses.length + "] classes");
        TestSuite s = new TestSuite();
        for (int i = 0; i < allClasses.length; i++) {
            Class clazz = allClasses[i];
            if (TestCase.class.isAssignableFrom(clazz) && !Modifier.isAbstract(clazz.getModifiers())) {
                log.debug("Adding test [" + clazz.getName() + "]");
                s.addTest(new GrailsTestSuite(appCtx, clazz));
            } else {
                log.debug("[" + clazz.getName() + "] is not a test case.");
            }
        }
        String[] beanNames = appCtx.getBeanNamesForType(PersistenceContextInterceptor.class);
        PersistenceContextInterceptor interceptor = null;
        if (beanNames.length > 0) {
            interceptor = (PersistenceContextInterceptor) appCtx.getBean(beanNames[0]);
        }

        try {
            if (interceptor != null) {
                interceptor.init();
            }
            TestResult r = TestRunner.run(s);
            exitCode = r.errorCount() + r.failureCount();
            if (exitCode > 0) {
                System.err.println("Tests failed!");
            }
            if (interceptor != null)
                interceptor.flush();
        } finally {
            if (interceptor != null)
                interceptor.destroy();
        }
    } catch (Exception e) {
        log.error("Error executing tests: " + e.getMessage(), e);
        exitCode = 1;
    } finally {
        System.exit(exitCode);
    }
}

From source file:koper.kafka.KafkaBatchSenderTest.java

public static void main(String[] args) {
    TestRunner.run(KafkaBatchSenderTest.class);
}

From source file:edu.internet2.middleware.psp.shibboleth.GrouperChangeLogDataConnectorTest.java

/**
 * Run tests./* w ww. ja v a 2  s.c o  m*/
 * 
 * @param args
 */
public static void main(String[] args) {
    // TestRunner.run(ChangeLogDataConnectorTest.class);
    TestRunner.run(new GrouperChangeLogDataConnectorTest("testFilterChangeLogAttributeAssignType"));
}