Java Code Examples for org.junit.experimental.ParallelComputer

The following are top voted examples for showing how to use org.junit.experimental.ParallelComputer. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to product more good examples.

Example 1
Project: RoboBuggy   File: ParallelMethodTest.java View source code 6 votes vote down vote up
@Test
public void testsRunInParallel() {
    Result result = JUnitCore.runClasses(ParallelComputer.methods(), Example.class);
    assertTrue(result.wasSuccessful());
    assertNotNull(fOne);
    assertNotNull(fTwo);
    assertThat(fOne, is(not(fTwo)));
}
 
Example 2
Project: RoboBuggy   File: ParallelClassTest.java View source code 6 votes vote down vote up
@Test
public void testsRunInParallel() {
    Result result = JUnitCore.runClasses(ParallelComputer.classes(), Example1.class, Example2.class);
    assertTrue(result.wasSuccessful());
    assertNotNull(fExample1One);
    assertNotNull(fExample1Two);
    assertNotNull(fExample2One);
    assertNotNull(fExample2Two);
    assertThat(fExample1One, is(fExample1Two));
    assertThat(fExample2One, is(fExample2Two));
    assertThat(fExample1One, is(not(fExample2One)));
}
 
Example 3
Project: log4jna   File: ParallelMethodTest.java View source code 6 votes vote down vote up
@Test public void testsRunInParallel() {
	long start= System.currentTimeMillis();
	Result result= JUnitCore.runClasses(ParallelComputer.methods(),
			Example.class);
	assertTrue(result.wasSuccessful());
	long end= System.currentTimeMillis();
	assertThat(end - start, betweenInclusive(1000, 1900));
}
 
Example 4
Project: log4jna   File: ParallelClassTest.java View source code 6 votes vote down vote up
@Test(timeout=1500) public void testsRunInParallel() {
	long start= System.currentTimeMillis();
	Result result= JUnitCore.runClasses(ParallelComputer.classes(), Example1.class, Example2.class);
	assertTrue(result.wasSuccessful());
	long end= System.currentTimeMillis();
	assertThat(end - start, greaterThan(999)); // Overhead could be less than half a millisecond
}
 
Example 5
Project: sosies-generator   File: ParallelMethodTest.java View source code 6 votes vote down vote up
@Test
public void testsRunInParallel() {
    Result result = JUnitCore.runClasses(ParallelComputer.methods(), Example.class);
    assertTrue(result.wasSuccessful());
    assertNotNull(fOne);
    assertNotNull(fTwo);
    assertThat(fOne, is(not(fTwo)));
}
 
Example 6
Project: sosies-generator   File: ParallelClassTest.java View source code 6 votes vote down vote up
@Test
public void testsRunInParallel() {
    Result result = JUnitCore.runClasses(ParallelComputer.classes(), Example1.class, Example2.class);
    assertTrue(result.wasSuccessful());
    assertNotNull(fExample1One);
    assertNotNull(fExample1Two);
    assertNotNull(fExample2One);
    assertNotNull(fExample2Two);
    assertThat(fExample1One, is(fExample1Two));
    assertThat(fExample2One, is(fExample2Two));
    assertThat(fExample1One, is(not(fExample2One)));
}
 
Example 7
Project: test4j   File: ParallelTestDemo.java View source code 6 votes vote down vote up
/**
 * ????Example????
 */
@Test
public void testsRunInParallel() {
	long start = System.currentTimeMillis();
	Result result = JUnitCore.runClasses(ParallelComputer.methods(), Example.class);
	assertTrue(result.wasSuccessful());
	long end = System.currentTimeMillis();
	boolean between = end - start >= 1000 && end - start <= 2000;
	System.out.println(end - start);
	assertTrue(between);
}