@Override protected Description describeChild(Runner child) { return child.getDescription(); }
@Override protected Description describeChild(Runner child) { return child.getDescription(); }
@Override public Description getDescription() { return runner.getDescription(); }
/** * @return the number of tests to be run by the receiver */ public int testCount() { return getDescription().testCount(); } }
public Description getDescription() { Description description = fRunner.getDescription(); return removeIgnored(description); }
@Override protected Description describeChild(Runner child) { return child.getDescription(); }
/** * @return the number of tests to be run by the receiver */ public int testCount() { return getDescription().testCount(); } }
public Description getDescription() { Description description = fRunner.getDescription(); return removeIgnored(description); }
@Override protected Description describeChild(Runner child) { return child.getDescription(); }
private List<Description> findLeaves(Request request) { List<Description> results = new ArrayList<Description>(); findLeaves(null, request.getRunner().getDescription(), results); return results; }
private List<Description> findLeaves(Request request) { List<Description> results = new ArrayList<Description>(); findLeaves(null, request.getRunner().getDescription(), results); return results; }
public RunnerTestDescriptor(UniqueId uniqueId, Class<?> testClass, Runner runner) { super(uniqueId, runner.getDescription(), testClass.getSimpleName(), ClassSource.from(testClass)); this.runner = runner; }
/** * Creates a {@link Filter}. * * A filter specification is of the form "package.of.FilterFactory=args-to-filter-factory" or * "package.of.FilterFactory". * * @param request the request that will be filtered * @param filterSpec the filter specification * @throws org.junit.runner.FilterFactory.FilterNotCreatedException */ public static Filter createFilterFromFilterSpec(Request request, String filterSpec) throws FilterFactory.FilterNotCreatedException { Description topLevelDescription = request.getRunner().getDescription(); String[] tuple; if (filterSpec.contains("=")) { tuple = filterSpec.split("=", 2); } else { tuple = new String[]{ filterSpec, "" }; } return createFilter(tuple[0], new FilterFactoryParams(topLevelDescription, tuple[1])); }
private Description createChildrenDescriptions(Runner runner, String suiteName) { Description suite = Description.createSuiteDescription(suiteName); for (Description child : runner.getDescription().getChildren()) { suite.addChild(child); } return suite; }
private void configureRunner(Runner runner) throws InvalidOrderingException { Description description = runner.getDescription(); OrderWith orderWith = description.getAnnotation(OrderWith.class); if (orderWith != null) { Ordering ordering = Ordering.definedBy(orderWith.value(), description); ordering.apply(runner); } }
@Override public Runner getRunner() { Runner runner = request.getRunner(); try { filter.apply(runner); return runner; } catch (NoTestsRemainException e) { return new EmptyRunner(runner.getDescription()); } } }
@Override public void prune() { if (wasFiltered) { // filtering the runner may render intermediate Descriptions obsolete // (e.g. test classes without any remaining children in a suite) pruneDescriptorsForObsoleteDescriptions(singletonList(runner.getDescription())); } if (rejectedExclusions.isEmpty()) { super.prune(); } else if (rejectedExclusions.containsAll(getDescription().getChildren())) { // since the Runner was asked to remove all of its direct children, // it's safe to remove it entirely removeFromHierarchy(); } else { logIncompleteFiltering(); } }
/** * Do not use. Testing purposes only. */ public Result run(Runner runner) { Result result = new Result(); RunListener listener = result.createListener(); notifier.addFirstListener(listener); try { notifier.fireTestRunStarted(runner.getDescription()); runner.run(notifier); notifier.fireTestRunFinished(result); } finally { removeListener(listener); } return result; }
/** * Do not use. Testing purposes only. */ public Result run(Runner runner) { Result result = new Result(); RunListener listener = result.createListener(); fNotifier.addFirstListener(listener); try { fNotifier.fireTestRunStarted(runner.getDescription()); runner.run(fNotifier); fNotifier.fireTestRunFinished(result); } finally { removeListener(listener); } return result; }
/** * @return delegates to the internal runner to get the description needed by JUnit. */ @Override public Description getDescription() { return delegate.getDescription(); }