@Override public Statement apply(Statement base, Description description) { if (description.isEmpty()) { return base; } else { final Class<?> testClass = description.getTestClass(); final FrameworkMethod frameworkMethod; try { final Method method = testClass.getMethod(description.getMethodName()); frameworkMethod = new FrameworkMethod(method); } catch (NoSuchMethodException e) { throw new IllegalStateException(e); } return delegate.apply(base, frameworkMethod, testInstance); } } }
private Description removeIgnored(Description description) { if (isIgnored(description)) { return Description.EMPTY; } Description result = description.childlessCopy(); for (Description each : description.getChildren()) { Description child = removeIgnored(each); if (!child.isEmpty()) { result.addChild(child); } } return result; }
private Description removeIgnored(Description description) { if (isIgnored(description)) { return Description.EMPTY; } Description result = description.childlessCopy(); for (Description each : description.getChildren()) { Description child = removeIgnored(each); if (!child.isEmpty()) { result.addChild(child); } } return result; }
private Description removeIgnored(Description description) { if (isIgnored(description)) { return Description.EMPTY; } Description result = description.childlessCopy(); for (Description each : description.getChildren()) { Description child = removeIgnored(each); if (!child.isEmpty()) { result.addChild(child); } } return result; }
@Override public Statement apply(Statement base, Description description) { if (description.isEmpty()) { return base; } else { final Class<?> testClass = description.getTestClass(); final FrameworkMethod frameworkMethod; try { final Method method = testClass.getMethod(description.getMethodName()); frameworkMethod = new FrameworkMethod(method); } catch (NoSuchMethodException e) { throw new IllegalStateException(e); } return delegate.apply(base, frameworkMethod, testInstance); } } }
private Description removeIgnored(Description description) { if (isIgnored(description)) return Description.EMPTY; Description result = description.childlessCopy(); for (Description each : description.getChildren()) { Description child= removeIgnored(each); if (! child.isEmpty()) result.addChild(child); } return result; }
private Description removeIgnored(Description description) { if (isIgnored(description)) { return Description.EMPTY; } Description result = description.childlessCopy(); for (Description each : description.getChildren()) { Description child = removeIgnored(each); if (!child.isEmpty()) { result.addChild(child); } } return result; }
private Description removeIgnored(Description description) { if (isIgnored(description)) return Description.EMPTY; Description result = description.childlessCopy(); for (Description each : description.getChildren()) { Description child= removeIgnored(each); if (! child.isEmpty()) result.addChild(child); } return result; }
private Description removeIgnored(Description description) { if (isIgnored(description)) { return Description.EMPTY; } Description result = description.childlessCopy(); for (Description each : description.getChildren()) { Description child = removeIgnored(each); if (!child.isEmpty()) { result.addChild(child); } } return result; }
private Description removeIgnored(Description description) { if (isIgnored(description)) { return Description.EMPTY; } Description result = description.childlessCopy(); for (Description each : description.getChildren()) { Description child = removeIgnored(each); if (!child.isEmpty()) { result.addChild(child); } } return result; }
private Description removeIgnored(Description description) { if (isIgnored(description)) { return Description.EMPTY; } Description result = description.childlessCopy(); for (Description each : description.getChildren()) { Description child = removeIgnored(each); if (!child.isEmpty()) { result.addChild(child); } } return result; }
private void initOtherDescription() { if (otherDescription == null) { otherDescription = Description.createSuiteDescription("other"); for (Runner child : getChildren()) { if (child instanceof ParamTestRunner) { ParamTestRunner<?> ptr = (ParamTestRunner<?>) child; Description ptrOther = ptr.getOtherDescription(); if (!ptrOther.isEmpty()) { Description ptrOtherSuite = Description.createSuiteDescription(ptr.getName(), ptr.getRunnerAnnotations()); ptrOther.getChildren().forEach(ptrOtherSuite::addChild); otherDescription.addChild(ptrOtherSuite); } } else if (child instanceof ParamSuite) { ParamSuite ps = (ParamSuite) child; ps.initOtherDescription(); if (!ps.otherDescription.isEmpty()) { ps.otherDescription.getChildren().forEach(otherDescription::addChild); } } else { otherDescription.addChild(super.describeChild(child)); } } } }
@Override public boolean shouldRun( Description description ) { if ( description.isEmpty() ) { return false; } else if ( description.isTest() ) { return combinedFilter.shouldRun( description ); } else { for ( Description o : description.getChildren() ) { if ( combinedFilter.shouldRun( o ) || shouldRun( o ) ) { return true; } } return false; } }
protected void initDescription() { if (rootDescription == null) { rootDescription = Description.createSuiteDescription(getName(), getRunnerAnnotations()); List<FrameworkMethod> tests = computeParamTestMethods(); List<Param<P>> params = getParams(); params.forEach(param -> { Description suite = param.getDescription(); tests .forEach(test -> suite.addChild(param.getDescription(test, getTestDisplayName(test, param, groupByParam)))); if (groupByParam) { rootDescription.addChild(suite); } }); tests.forEach(test -> { Description suite = Description.createSuiteDescription(test.getName()); testDescriptions.put(test, suite); params.forEach( param -> suite.addChild(param.getDescription(test, getTestDisplayName(test, param, groupByParam)))); if (!groupByParam) { rootDescription.addChild(suite); } }); Description other = getOtherDescription(); if (!other.isEmpty()) { rootDescription.addChild(other); } } }