junit.extensions.RepeatedTest Java Examples

The following examples show how to use junit.extensions.RepeatedTest. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RepeatedTestTest.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void testRepeatedOnce() {
	Test test= new RepeatedTest(fSuite, 1);
	assertEquals(2, test.countTestCases());
	TestResult result= new TestResult();
	test.run(result);
	assertEquals(2, result.runCount());
}
 
Example #2
Source File: RepeatedTestTest.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void testRepeatedMoreThanOnce() {
	Test test= new RepeatedTest(fSuite, 3);
	assertEquals(6, test.countTestCases());
	TestResult result= new TestResult();
	test.run(result);
	assertEquals(6, result.runCount());
}
 
Example #3
Source File: RepeatedTestTest.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void testRepeatedZero() {
	Test test= new RepeatedTest(fSuite, 0);
	assertEquals(0, test.countTestCases());
	TestResult result= new TestResult();
	test.run(result);
	assertEquals(0, result.runCount());
}
 
Example #4
Source File: RepeatedTestTest.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void testRepeatedNegative() {
		try {
		new RepeatedTest(fSuite, -1);
		} catch (IllegalArgumentException e) {
			return;
		}
		fail("Should throw an IllegalArgumentException");
}
 
Example #5
Source File: ActiveTestTest.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void testActiveRepeatedTest() {		
	Test test= new RepeatedTest(createActiveTestSuite(), 5);
	TestResult result= new TestResult();
	test.run(result);
	assertEquals(500, result.runCount());
	assertEquals(0, result.failureCount());
	assertEquals(0, result.errorCount());
}
 
Example #6
Source File: ActiveTestTest.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
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());
}
 
Example #7
Source File: ActiveTestTest.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void testActiveRepeatedTest1() {		
	Test test= new RepeatedTest(createActiveTestSuite(), 1);
	TestResult result= new TestResult();
	test.run(result);
	assertEquals(100, result.runCount());
	assertEquals(0, result.failureCount());
	assertEquals(0, result.errorCount());
}
 
Example #8
Source File: RunJUnit4TestsFromJava.java    From tutorials with MIT License 5 votes vote down vote up
public static void runRepeated() {
    Test test = new JUnit4TestAdapter(SecondUnitTest.class);
    RepeatedTest repeatedTest = new RepeatedTest(test, 5);

    JUnitCore junit = new JUnitCore();
    junit.addListener(new TextListener(System.out));

    junit.run(repeatedTest);
}
 
Example #9
Source File: RunJUnit4TestsFromJava.java    From tutorials with MIT License 5 votes vote down vote up
public static void runRepeatedSuite() {
    TestSuite mySuite = new ActiveTestSuite();

    JUnitCore junit = new JUnitCore();
    junit.addListener(new TextListener(System.out));

    mySuite.addTest(new RepeatedTest(new JUnit4TestAdapter(FirstUnitTest.class), 5));
    mySuite.addTest(new RepeatedTest(new JUnit4TestAdapter(SecondUnitTest.class), 3));

    junit.run(mySuite);
}
 
Example #10
Source File: SWTBotStressTests.java    From tracecompass with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * @return Test suite definition
 */
public static TestSuite suite() {
    TestSuite s = new TestSuite(String.format("Stress Test [%d runs]", NB_RUNS));
    s.addTest(new RepeatedTest(new JUnit4TestAdapter(RunAllSWTBotTests.class), NB_RUNS));
    return s;
}