private MockBigArrays(PageCacheRecycler recycler, CircuitBreakerService breakerService, boolean checkBreaker) { super(recycler, breakerService, checkBreaker); this.recycler = recycler; this.breakerService = breakerService; long seed; try { seed = SeedUtils.parseSeed(RandomizedContext.current().getRunnerSeedAsString()); } catch (IllegalStateException e) { // rest tests don't run randomized and have no context seed = 0; } random = new Random(seed); }
@BeforeClass public static void printMasterContext() { System.out.println("# Static context (@BeforeClass)"); System.out.println(getContext().getRunnerSeedAsString()); System.out.println(RandomizedContext.current().getRandomness()); }
@Test public void printContext() { System.out.println("# Test context (@Test)"); System.out.println(getContext().getRunnerSeedAsString()); System.out.println(RandomizedContext.current().getRandomness()); }
/** * Append all JVM options that may help in reproducing the error. Options are * appended to the provided StringBuilder in the "command-line" syntax of: * <pre> * -Doption="value" * </pre> * * @param description Suite or test description. */ public ReproduceErrorMessageBuilder appendAllOpts(Description description) { RandomizedContext ctx = null; try { ctx = RandomizedContext.current(); appendOpt(SYSPROP_RANDOM_SEED(), ctx.getRunnerSeedAsString()); } catch (IllegalStateException e) { logger.warning("No context available when dumping reproduce options?"); } if (description.getClassName() != null) { appendOpt(SYSPROP_TESTCLASS(), description.getClassName()); } if (description.getMethodName() != null) { appendOpt(SYSPROP_TESTMETHOD(), methodName(description)); } appendRunnerProperties(); appendTestGroupOptions(ctx); appendEnvironmentSettings(); return this; }
/** * Append all JVM options that may help in reproducing the error. Options are * appended to the provided StringBuilder in the "command-line" syntax of: * <pre> * -Doption="value" * </pre> * * @param description Suite or test description. */ public ReproduceErrorMessageBuilder appendAllOpts(Description description) { RandomizedContext ctx = null; try { ctx = RandomizedContext.current(); appendOpt(SYSPROP_RANDOM_SEED(), ctx.getRunnerSeedAsString()); } catch (IllegalStateException e) { logger.warning("No context available when dumping reproduce options?"); } if (description.getClassName() != null) { appendOpt(SYSPROP_TESTCLASS(), description.getClassName()); } if (description.getMethodName() != null) { appendOpt(SYSPROP_TESTMETHOD(), methodName(description)); } appendRunnerProperties(); appendTestGroupOptions(ctx); appendEnvironmentSettings(); return this; }