use of junit.framework.Test in project junit4 by junit-team.
the class SuiteTest method testNoTestCases.
public void testNoTestCases() {
Test t = new TestSuite(NoTestCases.class);
t.run(fResult);
// warning test
assertTrue(fResult.runCount() == 1);
assertTrue(fResult.failureCount() == 1);
assertTrue(!fResult.wasSuccessful());
}
use of junit.framework.Test in project junit4 by junit-team.
the class ActiveTestTest method testActiveRepeatedTest0.
public void testActiveRepeatedTest0() {
Test test = new RepeatedTest(createActiveTestSuite(), 0);
TestResult result = new TestResult();
test.run(result);
assertEquals(0, result.runCount());
assertEquals(0, result.failureCount());
assertEquals(0, result.errorCount());
}
use of junit.framework.Test in project junit4 by junit-team.
the class RepeatedTestTest method testRepeatedOnce.
public void testRepeatedOnce() {
Test test = new RepeatedTest(fSuite, 1);
assertEquals(2, test.countTestCases());
TestResult result = new TestResult();
test.run(result);
assertEquals(2, result.runCount());
}
use of junit.framework.Test in project caffeine by ben-manes.
the class JSR166TestCase method addNamedTestClasses.
public static void addNamedTestClasses(TestSuite suite, String... testClassNames) {
for (String testClassName : testClassNames) {
try {
Class<?> testClass = Class.forName(testClassName);
Method m = testClass.getDeclaredMethod("suite", new Class<?>[0]);
suite.addTest(newTestSuite((Test) m.invoke(null)));
} catch (Exception e) {
throw new Error("Missing test class", e);
}
}
}
use of junit.framework.Test in project caffeine by ben-manes.
the class JSR166TestCase method main.
/**
* Runs all JSR166 unit tests using junit.textui.TestRunner.
* Optional command line arg provides the number of iterations to
* repeat running the tests.
*/
public static void main(String[] args) {
if (useSecurityManager) {
System.err.println("Setting a permissive security manager");
Policy.setPolicy(permissivePolicy());
System.setSecurityManager(new SecurityManager());
}
int iters = (args.length == 0) ? 1 : Integer.parseInt(args[0]);
Test s = suite();
for (int i = 0; i < iters; ++i) {
junit.textui.TestRunner.run(s);
System.gc();
System.runFinalization();
}
System.exit(0);
}
Aggregations