private void applyValidators(List<Throwable> errors) { if (getTestClass().getJavaClass() != null) { for (TestClassValidator each : VALIDATORS) { errors.addAll(each.validateTestClass(getTestClass())); } } }
private void validateClassRules(List<Throwable> errors) { CLASS_RULE_VALIDATOR.validate(getTestClass(), errors); CLASS_RULE_METHOD_VALIDATOR.validate(getTestClass(), errors); }
private void validateClassRules(List<Throwable> errors) { CLASS_RULE_VALIDATOR.validate(getTestClass(), errors); CLASS_RULE_METHOD_VALIDATOR.validate(getTestClass(), errors); }
@Override protected void runChild(Runner runner, RunNotifier notifier) { // This is ugly but, for now, ORM class loading is inconsistent. // It sometimes use ClassLoaderService which takes into account AvailableSettings.CLASSLOADERS, and sometimes // ReflectHelper#classForName() which uses the TCCL. // See https://hibernate.atlassian.net/browse/HHH-13136 for more information. ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader( ( (ParentRunner<?>) runner ).getTestClass().getJavaClass().getClassLoader() ); super.runChild( runner, notifier ); } finally { Thread.currentThread().setContextClassLoader( originalClassLoader ); } }
/** * Adds to {@code errors} if any method in this class is annotated with * {@code annotation}, but: * <ul> * <li>is not public, or * <li>takes parameters, or * <li>returns something other than void, or * <li>is static (given {@code isStatic is false}), or * <li>is not static (given {@code isStatic is true}). * </ul> */ protected void validatePublicVoidNoArgMethods(Class<? extends Annotation> annotation, boolean isStatic, List<Throwable> errors) { List<FrameworkMethod> methods = getTestClass().getAnnotatedMethods(annotation); for (FrameworkMethod eachTestMethod : methods) { eachTestMethod.validatePublicVoidNoArg(isStatic, errors); } }
/** * Adds to {@code errors} if any method in this class is annotated with * {@code annotation}, but: * <ul> * <li>is not public, or * <li>takes parameters, or * <li>returns something other than void, or * <li>is static (given {@code isStatic is false}), or * <li>is not static (given {@code isStatic is true}). */ protected void validatePublicVoidNoArgMethods(Class<? extends Annotation> annotation, boolean isStatic, List<Throwable> errors) { List<FrameworkMethod> methods = getTestClass().getAnnotatedMethods(annotation); for (FrameworkMethod eachTestMethod : methods) { eachTestMethod.validatePublicVoidNoArg(isStatic, errors); } }
@Override public Description getDescription() { Class<?> clazz = getTestClass().getJavaClass(); Description description; // if subclass overrides `getName()` then we should use it // to maintain backwards compatibility with JUnit 4.12 if (clazz == null || !clazz.getName().equals(getName())) { description = Description.createSuiteDescription(getName(), getRunnerAnnotations()); } else { description = Description.createSuiteDescription(clazz, getRunnerAnnotations()); } for (T child : getFilteredChildren()) { description.addChild(describeChild(child)); } return description; }
private void validateClassRules(List<Throwable> errors) { CLASS_RULE_VALIDATOR.validate(getTestClass(), errors); CLASS_RULE_METHOD_VALIDATOR.validate(getTestClass(), errors); }
/** * Adds to {@code errors} if any method in this class is annotated with * {@code annotation}, but: * <ul> * <li>is not public, or * <li>takes parameters, or * <li>returns something other than void, or * <li>is static (given {@code isStatic is false}), or * <li>is not static (given {@code isStatic is true}). */ protected void validatePublicVoidNoArgMethods(Class<? extends Annotation> annotation, boolean isStatic, List<Throwable> errors) { List<FrameworkMethod> methods = getTestClass().getAnnotatedMethods(annotation); for (FrameworkMethod eachTestMethod : methods) { eachTestMethod.validatePublicVoidNoArg(isStatic, errors); } }
private void applyValidators(List<Throwable> errors) { if (getTestClass().getJavaClass() != null) { for (TestClassValidator each : VALIDATORS) { errors.addAll(each.validateTestClass(getTestClass())); } } }
private void applyValidators(List<Throwable> errors) { if (getTestClass().getJavaClass() != null) { for (TestClassValidator each : VALIDATORS) { errors.addAll(each.validateTestClass(getTestClass())); } } }
private void validateClassRules(List<Throwable> errors) { CLASS_RULE_VALIDATOR.validate(getTestClass(), errors); CLASS_RULE_METHOD_VALIDATOR.validate(getTestClass(), errors); }
private void validateClassRules(List<Throwable> errors) { CLASS_RULE_VALIDATOR.validate(getTestClass(), errors); CLASS_RULE_METHOD_VALIDATOR.validate(getTestClass(), errors); }
private void validateClassRules(List<Throwable> errors) { CLASS_RULE_VALIDATOR.validate(getTestClass(), errors); CLASS_RULE_METHOD_VALIDATOR.validate(getTestClass(), errors); }
private void validateClassRules(List<Throwable> errors) { CLASS_RULE_VALIDATOR.validate(getTestClass(), errors); CLASS_RULE_METHOD_VALIDATOR.validate(getTestClass(), errors); }
public DataSetAwareParentRunner(ParentRunner<T> originalRunner) throws InitializationError { super(originalRunner.getTestClass().getJavaClass()); this.originalRunner = originalRunner; this.reorganizeRunner(); }
/** * Adds to {@code errors} if any method in this class is annotated with * {@code annotation}, but: * <ul> * <li>is not public, or * <li>takes parameters, or * <li>returns something other than void, or * <li>is static (given {@code isStatic is false}), or * <li>is not static (given {@code isStatic is true}). */ protected void validatePublicVoidNoArgMethods(Class<? extends Annotation> annotation, boolean isStatic, List<Throwable> errors) { List<FrameworkMethod> methods = getTestClass().getAnnotatedMethods(annotation); for (FrameworkMethod eachTestMethod : methods) { eachTestMethod.validatePublicVoidNoArg(isStatic, errors); } }
/** * Adds to {@code errors} if any method in this class is annotated with * {@code annotation}, but: * <ul> * <li>is not public, or * <li>takes parameters, or * <li>returns something other than void, or * <li>is static (given {@code isStatic is false}), or * <li>is not static (given {@code isStatic is true}). */ protected void validatePublicVoidNoArgMethods(Class<? extends Annotation> annotation, boolean isStatic, List<Throwable> errors) { List<FrameworkMethod> methods = getTestClass().getAnnotatedMethods(annotation); for (FrameworkMethod eachTestMethod : methods) { eachTestMethod.validatePublicVoidNoArg(isStatic, errors); } }
/** * Adds to {@code errors} if any method in this class is annotated with * {@code annotation}, but: * <ul> * <li>is not public, or * <li>takes parameters, or * <li>returns something other than void, or * <li>is static (given {@code isStatic is false}), or * <li>is not static (given {@code isStatic is true}). * </ul> */ protected void validatePublicVoidNoArgMethods(Class<? extends Annotation> annotation, boolean isStatic, List<Throwable> errors) { List<FrameworkMethod> methods = getTestClass().getAnnotatedMethods(annotation); for (FrameworkMethod eachTestMethod : methods) { eachTestMethod.validatePublicVoidNoArg(isStatic, errors); } }
/** * Must be called before each test method invocation. * <p/> */ void executeMockingProviderTestInstanceProcessing() { if (mockingProvider != null) { mockingProvider.processTestClass(runner.getRunner().getTestClass().getJavaClass(), runner.getTestInstance()); } }