use of com.carrotsearch.randomizedtesting.RandomizedRunner in project randomizedtesting by randomizedtesting.
the class TestBeforeAfterMethodOrder method checkOrderFixedSeed.
@Test
public void checkOrderFixedSeed() throws Exception {
new JUnitCore().run(new RandomizedRunner(SubSubFixedSeed.class));
ArrayList<String> order = new ArrayList<String>(callOrder);
callOrder.clear();
new JUnitCore().run(new RandomizedRunner(SubSubFixedSeed.class));
assertEquals(order, callOrder);
}
use of com.carrotsearch.randomizedtesting.RandomizedRunner in project randomizedtesting by randomizedtesting.
the class JUnitAnnotationPropagation method assertSameExecution.
private void assertSameExecution(Class<?> clazz) throws Exception {
order.clear();
WithNestedTestClass.runTests(clazz);
List<String> order1 = new ArrayList<>(order);
order.clear();
new JUnitCore().run(Request.runner(new RandomizedRunner(clazz)));
List<String> order2 = new ArrayList<>(order);
order.clear();
String msg = "# JUnit order:\n" + order1 + "\n" + "# RR order:\n" + order2;
// Don't care about relative ordering of hook methods.
Assertions.assertThat(noNumbers(order2)).as(msg).isEqualTo(noNumbers(order1));
// But do care that all methods show up.
Collections.sort(order1);
Collections.sort(order2);
Assertions.assertThat(order2).as(msg).isEqualTo(order1);
}
Aggregations