Search in sources :

Example 1 with FullResult

use of com.carrotsearch.randomizedtesting.WithNestedTestClass.FullResult in project randomizedtesting by randomizedtesting.

the class TestHookMethodOrderWithExceptions method checkOrderSameAsJUnit.

@Test
@Repeat(iterations = 20)
public void checkOrderSameAsJUnit() throws Exception {
    long seed = RandomizedContext.current().getRandomness().getSeed();
    callOrder.clear();
    Super.rnd = new Random(seed);
    FullResult r1 = WithNestedTestClass.runTests(WithRegularRunner.class);
    List<String> junitOrder = new ArrayList<String>(callOrder);
    callOrder.clear();
    Super.rnd = new Random(seed);
    FullResult r2 = WithNestedTestClass.runTests(WithRandomizedRunner.class);
    List<String> rrunnerOrder = new ArrayList<String>(callOrder);
    Assert.assertEquals(junitOrder, rrunnerOrder);
    Assertions.assertThat(r1.getRunCount()).isEqualTo(r2.getRunCount());
}
Also used : FullResult(com.carrotsearch.randomizedtesting.WithNestedTestClass.FullResult) Random(java.util.Random) ArrayList(java.util.ArrayList) Test(org.junit.Test) Repeat(com.carrotsearch.randomizedtesting.annotations.Repeat)

Aggregations

FullResult (com.carrotsearch.randomizedtesting.WithNestedTestClass.FullResult)1 Repeat (com.carrotsearch.randomizedtesting.annotations.Repeat)1 ArrayList (java.util.ArrayList)1 Random (java.util.Random)1 Test (org.junit.Test)1