/** The class (suite) being tested. */ public Class<?> getTargetClass() { checkDisposed(); return suiteClass; }
/** * @return Return the currently executing test case method (the thread may still * be within test rules and may never actually hit the method). This method may return * <code>null</code> if called from the static context (no test case is being executed at * the moment). */ public Method getTargetMethod() { checkDisposed(); return currentMethod; } }
/** The class (suite) being tested. */ public Class<?> getTargetClass() { checkDisposed(); return suiteClass; }
/** * @return Return the currently executing test case method (the thread may still * be within test rules and may never actually hit the method). This method may return * <code>null</code> if called from the static context (no test case is being executed at * the moment). */ public Method getTargetMethod() { checkDisposed(); return currentMethod; } }
/** Return per-thread resources associated with the current thread. */ private PerThreadResources getPerThread() { checkDisposed(); synchronized (_contextLock) { return perThreadResources.get(Thread.currentThread()); } }
/** Return per-thread resources associated with the current thread. */ private PerThreadResources getPerThread() { checkDisposed(); synchronized (_contextLock) { return perThreadResources.get(Thread.currentThread()); } }
/** * Returns the runner's master seed, formatted. */ public String getRunnerSeedAsString() { checkDisposed(); return SeedUtils.formatSeed(getRunnerSeed()); }
/** * Return <code>true</code> if {@link Nightly} test group is explicitly enabled. * * @see RandomizedContext#getGroupEvaluator() * @see GroupEvaluator#isGroupEnabled(Class) */ public boolean isNightly() { checkDisposed(); return getGroupEvaluator().isGroupEnabled(Nightly.class); }
/** * Returns the runner's master seed, formatted. */ public String getRunnerSeedAsString() { checkDisposed(); return SeedUtils.formatSeed(getRunnerSeed()); }
/** * Return <code>true</code> if {@link Nightly} test group is explicitly enabled. * * @see RandomizedContext#getGroupEvaluator() * @see GroupEvaluator#isGroupEnabled(Class) */ public boolean isNightly() { checkDisposed(); return getGroupEvaluator().isGroupEnabled(Nightly.class); }
/** * Dispose of the context. */ void dispose() { synchronized (_globalLock) { checkDisposed(); disposed = true; contexts.remove(threadGroup); // Clean up and invalidate any per-thread published randoms. synchronized (_contextLock) { for (PerThreadResources ref : perThreadResources.values()) { if (ref != null) { for (Randomness randomness : ref.randomnesses) { randomness.destroy(); } } } } } }
/** * Dispose of the context. */ void dispose() { synchronized (_globalLock) { checkDisposed(); disposed = true; contexts.remove(threadGroup); // Clean up and invalidate any per-thread published randoms. synchronized (_contextLock) { for (PerThreadResources ref : perThreadResources.values()) { if (ref != null) { for (Randomness randomness : ref.randomnesses) { randomness.destroy(); } } } } } }