Search in sources :

Example 51 with JUnit4TestAdapter

use of junit.framework.JUnit4TestAdapter in project JMRI by JMRI.

the class PackageTest method suite.

// test suite from all defined tests
public static Test suite() {
    TestSuite suite = new TestSuite("jmri.jmrit.roster.PackageTest");
    suite.addTest(new JUnit4TestAdapter(BundleTest.class));
    suite.addTest(RosterEntryTest.suite());
    suite.addTest(new JUnit4TestAdapter(RosterTest.class));
    suite.addTest(new JUnit4TestAdapter(jmri.jmrit.roster.configurexml.PackageTest.class));
    suite.addTest(new JUnit4TestAdapter(CopyRosterItemActionTest.class));
    suite.addTest(RosterEntryPaneTest.suite());
    suite.addTest(new JUnit4TestAdapter(FunctionLabelPaneTest.class));
    suite.addTest(IdentifyLocoTest.suite());
    suite.addTest(jmri.jmrit.roster.swing.PackageTest.suite());
    suite.addTest(new JUnit4TestAdapter(LocoFileTest.class));
    suite.addTest(new JUnit4TestAdapter(RecreateRosterActionTest.class));
    suite.addTest(new JUnit4TestAdapter(RosterConfigManagerTest.class));
    suite.addTest(new JUnit4TestAdapter(RosterConfigPaneTest.class));
    suite.addTest(new JUnit4TestAdapter(RosterIconFactoryTest.class));
    suite.addTest(new JUnit4TestAdapter(RosterMediaPaneTest.class));
    suite.addTest(new JUnit4TestAdapter(RosterRecorderTest.class));
    suite.addTest(new JUnit4TestAdapter(jmri.jmrit.roster.rostergroup.PackageTest.class));
    return suite;
}
Also used : TestSuite(junit.framework.TestSuite) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter)

Example 52 with JUnit4TestAdapter

use of junit.framework.JUnit4TestAdapter in project bnd by bndtools.

the class Activator method addTest.

@SuppressWarnings("unchecked")
private void addTest(TestSuite suite, Class<?> clazz, final String method) {
    if (TestCase.class.isAssignableFrom(clazz)) {
        if (hasJunit4Annotations(clazz)) {
            error("The test class %s extends %s and it uses JUnit 4 annotations. This means that the annotations will be ignored.", clazz.getName(), TestCase.class.getName());
        }
        trace("using JUnit 3");
        if (method != null) {
            suite.addTest(TestSuite.createTest(clazz, method));
            return;
        }
        suite.addTestSuite((Class<? extends TestCase>) clazz);
        return;
    }
    trace("using JUnit 4");
    JUnit4TestAdapter adapter = new JUnit4TestAdapter(clazz);
    if (method != null) {
        trace("method specified " + clazz + ":" + method);
        final Pattern glob = Pattern.compile(method.replaceAll("\\*", ".*").replaceAll("\\?", ".?"));
        try {
            adapter.filter(new org.junit.runner.manipulation.Filter() {

                @Override
                public String describe() {
                    return "Method filter for " + method;
                }

                @Override
                public boolean shouldRun(Description description) {
                    if (glob.matcher(description.getMethodName()).lookingAt()) {
                        trace("accepted " + description.getMethodName());
                        return true;
                    }
                    trace("rejected " + description.getMethodName());
                    return false;
                }
            });
        } catch (NoTestsRemainException e) {
            return;
        }
    }
    suite.addTest(adapter);
}
Also used : Pattern(java.util.regex.Pattern) Description(org.junit.runner.Description) TestCase(junit.framework.TestCase) NoTestsRemainException(org.junit.runner.manipulation.NoTestsRemainException) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter)

Example 53 with JUnit4TestAdapter

use of junit.framework.JUnit4TestAdapter in project pentaho-kettle by pentaho.

the class AllRegressionTestsIT method suite.

public static Test suite() throws Exception {
    TestSuite suite = new TestSuite("Run regression tests");
    // The testcases should be executed from easy to hard. It
    // actually defines the debugging sequence if ever required.
    // If some of the suites fail you should start checking/debugging
    // the suites from the first that failed onwards.
    // 
    // So adding testcases in the right order is important.
    // 
    suite.addTest(new JUnit4TestAdapter(StringEvaluatorIT.class));
    suite.addTestSuite(ParameterSimpleTransIT.class);
    // suite.addTestSuite( ValueDataUtilTest.class );
    suite.addTest(new JUnit4TestAdapter(DatabaseIT.class));
    suite.addTest(new JUnit4TestAdapter(ConnectionPoolUtilIntegrationIT.class));
    suite.addTestSuite(HopIT.class);
    suite.addTestSuite(InjectorIT.class);
    suite.addTestSuite(RowGeneratorIT.class);
    suite.addTestSuite(ConstantIT.class);
    suite.addTestSuite(AppendIT.class);
    suite.addTestSuite(DetectLastRowStepIT.class);
    suite.addTestSuite(BlockingStepIT.class);
    suite.addTest(new JUnit4TestAdapter(SortRowsIT.class));
    suite.addTest(new JUnit4TestAdapter(FilterRowsIT.class));
    suite.addTestSuite(ValueMapperIT.class);
    suite.addTestSuite(NullIfIT.class);
    suite.addTestSuite(RegexEvalIT.class);
    suite.addTestSuite(AddSequenceIT.class);
    suite.addTestSuite(TableInputIT.class);
    suite.addTestSuite(TableOutputIT.class);
    // suite.addTestSuite(DatabaseLookupTest.class);    Now a JUnit 4 testcase
    suite.addTestSuite(CombinationLookupIT.class);
    suite.addTestSuite(JavaScriptStringIT.class);
    suite.addTestSuite(JavaScriptSpecialIT.class);
    // suite.addTestSuite( GetXMLDataTest.class );
    suite.addTestSuite(CsvInput1IT.class);
    suite.addTestSuite(CsvInput2IT.class);
    suite.addTestSuite(WebServiceIT.class);
    suite.addTest(new JUnit4TestAdapter(GPLoadIT.class));
    suite.addTest(new JUnit4TestAdapter(TransExecutorIT.class));
    return suite;
}
Also used : TransExecutorIT(org.pentaho.di.trans.steps.transexecutor.TransExecutorIT) FilterRowsIT(org.pentaho.di.trans.steps.filterrows.FilterRowsIT) TestSuite(junit.framework.TestSuite) SortRowsIT(org.pentaho.di.trans.steps.sort.SortRowsIT) StringEvaluatorIT(org.pentaho.di.core.util.StringEvaluatorIT) DatabaseIT(org.pentaho.di.core.database.DatabaseIT) GPLoadIT(org.pentaho.di.trans.steps.gpload.GPLoadIT) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter) ConnectionPoolUtilIntegrationIT(org.pentaho.di.core.database.ConnectionPoolUtilIntegrationIT)

Example 54 with JUnit4TestAdapter

use of junit.framework.JUnit4TestAdapter in project JMRI by JMRI.

the class PackageTest method suite.

// test suite from all defined tests
public static Test suite() {
    // no tests in this class itself
    TestSuite suite = new TestSuite("jmri.jmrit.withrottle.PackageTest");
    suite.addTest(new junit.framework.JUnit4TestAdapter(BundleTest.class));
    suite.addTest(ConsistControllerTest.suite());
    suite.addTest(ConsistFunctionControllerTest.suite());
    suite.addTest(DeviceServerTest.suite());
    suite.addTest(FacelessServerTest.suite());
    suite.addTest(MultiThrottleControllerTest.suite());
    suite.addTest(MultiThrottleTest.suite());
    suite.addTest(RouteControllerTest.suite());
    suite.addTest(ThrottleControllerTest.suite());
    suite.addTest(TrackPowerControllerTest.suite());
    suite.addTest(TurnoutControllerTest.suite());
    suite.addTest(WiFiConsistFileTest.suite());
    suite.addTest(WiFiConsistTest.suite());
    suite.addTest(WiFiConsistManagerTest.suite());
    suite.addTest(WiThrottleManagerTest.suite());
    suite.addTest(WiThrottlePreferencesTest.suite());
    suite.addTest(WiThrottlesListModelTest.suite());
    suite.addTest(new JUnit4TestAdapter(WiThrottlePrefsPanelTest.class));
    suite.addTest(new JUnit4TestAdapter(ControllerFilterActionTest.class));
    suite.addTest(new JUnit4TestAdapter(ControllerFilterFrameTest.class));
    suite.addTest(new JUnit4TestAdapter(UserInterfaceTest.class));
    suite.addTest(new JUnit4TestAdapter(WiThrottleCreationActionTest.class));
    return suite;
}
Also used : TestSuite(junit.framework.TestSuite) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter)

Example 55 with JUnit4TestAdapter

use of junit.framework.JUnit4TestAdapter in project JMRI by JMRI.

the class PackageTest method suite.

// test suite from all defined tests
public static Test suite() {
    apps.tests.AllTest.initLogging();
    TestSuite suite = new TestSuite("jmri.jmrix.easydcc.EasyDccTest");
    suite.addTest(new junit.framework.JUnit4TestAdapter(EasyDccTurnoutTest.class));
    suite.addTest(new junit.framework.JUnit4TestAdapter(EasyDccTurnoutManagerTest.class));
    suite.addTest(jmri.jmrix.easydcc.EasyDccProgrammerTest.suite());
    suite.addTest(new junit.framework.JUnit4TestAdapter(EasyDccTrafficControllerTest.class));
    suite.addTest(jmri.jmrix.easydcc.EasyDccMessageTest.suite());
    suite.addTest(jmri.jmrix.easydcc.EasyDccReplyTest.suite());
    suite.addTest(new JUnit4TestAdapter(EasyDccPowerManagerTest.class));
    suite.addTest(jmri.jmrix.easydcc.EasyDccConsistManagerTest.suite());
    suite.addTest(new JUnit4TestAdapter(EasyDccConsistTest.class));
    suite.addTest(new JUnit4TestAdapter(jmri.jmrix.easydcc.serialdriver.PackageTest.class));
    suite.addTest(new JUnit4TestAdapter(jmri.jmrix.easydcc.networkdriver.PackageTest.class));
    suite.addTest(new JUnit4TestAdapter(jmri.jmrix.easydcc.configurexml.PackageTest.class));
    suite.addTest(new JUnit4TestAdapter(jmri.jmrix.easydcc.easydccmon.EasyDccMonFrameTest.class));
    suite.addTest(jmri.jmrix.easydcc.easydccmon.EasyDccMonActionTest.suite());
    suite.addTest(new JUnit4TestAdapter(jmri.jmrix.easydcc.packetgen.PackageTest.class));
    suite.addTest(new JUnit4TestAdapter(EasyDccNetworkPortControllerTest.class));
    suite.addTest(new JUnit4TestAdapter(EasyDccSystemConnectionMemoTest.class));
    suite.addTest(new JUnit4TestAdapter(EasyDccPortControllerTest.class));
    suite.addTest(new JUnit4TestAdapter(EasyDCCMenuTest.class));
    suite.addTest(new JUnit4TestAdapter(EasyDccConnectionTypeListTest.class));
    suite.addTest(new JUnit4TestAdapter(EasyDccCommandStationTest.class));
    suite.addTest(new JUnit4TestAdapter(EasyDccOpsModeProgrammerTest.class));
    suite.addTest(new JUnit4TestAdapter(EasyDccProgrammerManagerTest.class));
    suite.addTest(new JUnit4TestAdapter(EasyDccThrottleManagerTest.class));
    suite.addTest(new JUnit4TestAdapter(EasyDccThrottleTest.class));
    return suite;
}
Also used : JUnit4TestAdapter(junit.framework.JUnit4TestAdapter) TestSuite(junit.framework.TestSuite) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter)

Aggregations

JUnit4TestAdapter (junit.framework.JUnit4TestAdapter)74 TestSuite (junit.framework.TestSuite)50 TestResult (junit.framework.TestResult)17 Test (org.junit.Test)6 Test (junit.framework.Test)2 Result (org.junit.runner.Result)2 I18nManagerTest (com.agiletec.aps.system.services.i18n.I18nManagerTest)1 I18nManagerCacheWrapperTest (com.agiletec.aps.system.services.i18n.cache.I18nManagerCacheWrapperTest)1 KeyGeneratorManagerTest (com.agiletec.aps.system.services.keygenerator.KeyGeneratorManagerTest)1 LangManagerTest (com.agiletec.aps.system.services.lang.LangManagerTest)1 ContentManagerTest (com.agiletec.plugins.jacms.aps.system.services.content.ContentManagerTest)1 ContentModelManagerTest (com.agiletec.plugins.jacms.aps.system.services.contentmodel.ContentModelManagerTest)1 ContentPageMapperManagerTest (com.agiletec.plugins.jacms.aps.system.services.contentpagemapper.ContentPageMapperManagerTest)1 ContentMapperCacheWrapperTest (com.agiletec.plugins.jacms.aps.system.services.contentpagemapper.cache.ContentMapperCacheWrapperTest)1 ResourceManagerTest (com.agiletec.plugins.jacms.aps.system.services.resource.ResourceManagerTest)1 ListLastIndexOfTester (com.google.common.collect.testing.testers.ListLastIndexOfTester)1 ListListIteratorTester (com.google.common.collect.testing.testers.ListListIteratorTester)1 ListSubListTester (com.google.common.collect.testing.testers.ListSubListTester)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 IOException (java.io.IOException)1