/** * Returns a {@link Statement}: apply all non-static {@link Value} fields * annotated with {@link Rule}. * * @param statement The base statement * @return a RunRules statement if any class-level {@link Rule}s are * found, or the base statement */ private Statement withTestRules(FrameworkMethod method, List<TestRule> testRules, Statement statement) { return testRules.isEmpty() ? statement : new RunRules(statement, testRules, describeChild(method)); }
@Override protected void runChild(final FrameworkMethod method, RunNotifier notifier) { Description description = describeChild(method); if (isIgnored(method)) { notifier.fireTestIgnored(description); } else { Statement statement = new Statement() { @Override public void evaluate() throws Throwable { methodBlock(method).evaluate(); } }; runLeaf(statement, description, notifier); } }
private Statement withRules(FrameworkMethod method, Object target, Statement statement) { RuleContainer ruleContainer = new RuleContainer(); CURRENT_RULE_CONTAINER.set(ruleContainer); try { List<TestRule> testRules = getTestRules(target); for (MethodRule each : rules(target)) { if (!(each instanceof TestRule && testRules.contains(each))) { ruleContainer.add(each); } } for (TestRule rule : testRules) { ruleContainer.add(rule); } } finally { CURRENT_RULE_CONTAINER.remove(); } return ruleContainer.apply(method, describeChild(method), target, statement); }
@Override protected void runChild(final FrameworkMethod method, RunNotifier notifier) { Description description = describeChild(method); if (method.getAnnotation(Ignore.class) != null) { notifier.fireTestIgnored(description); } else { runLeaf(methodBlock(method), description, notifier); } }
/** * Returns a {@link Statement}: apply all non-static {@link Value} fields * annotated with {@link Rule}. * * @param statement The base statement * @return a RunRules statement if any class-level {@link Rule}s are * found, or the base statement */ private Statement withTestRules(FrameworkMethod method, List<TestRule> testRules, Statement statement) { return testRules.isEmpty() ? statement : new RunRules(statement, testRules, describeChild(method)); }
@Override protected void runChild(final FrameworkMethod method, RunNotifier notifier) { Description description = describeChild(method); if (method.getAnnotation(Ignore.class) != null) { notifier.fireTestIgnored(description); } else { runLeaf(methodBlock(method), description, notifier); } }
@Override protected Description describeChild(FrameworkMethod method) { if (method.getAnnotation(Repeat.class) != null && method.getAnnotation(Ignore.class) == null) { return describeRepeatTest(method); } return super.describeChild(method); }
@Override protected Description describeChild(FrameworkMethod method) { Description description = parameterisedRunner.getDescriptionFor(method); return description == null ? super.describeChild(method) : description; }
@Override protected Description describeChild(FrameworkMethod method) { return method instanceof TestMethod ? ((TestMethod)method).getDescription() : super.describeChild(method); }
/** * Returns a {@link Statement}: apply all non-static {@link Value} fields * annotated with {@link Rule}. * * @param statement The base statement * @return a RunRules statement if any class-level {@link Rule}s are * found, or the base statement */ private Statement withTestRules(FrameworkMethod method, List<TestRule> testRules, Statement statement) { return testRules.isEmpty() ? statement : new RunRules(statement, testRules, describeChild(method)); }
/** * Returns a {@link Statement}: apply all non-static fields * annotated with {@link Rule}. * * @param statement The base statement * @return a RunRules statement if any class-level {@link Rule}s are * found, or the base statement */ private Statement withTestRules(FrameworkMethod method, List<TestRule> testRules, Statement statement) { return testRules.isEmpty() ? statement : new RunRules(statement, testRules, describeChild(method)); }
/** * Returns a {@link Statement}: apply all non-static {@link Value} fields * annotated with {@link Rule}. * * @param statement The base statement * @return a RunRules statement if any class-level {@link Rule}s are * found, or the base statement */ private Statement withTestRules(FrameworkMethod method, List<TestRule> testRules, Statement statement) { return testRules.isEmpty() ? statement : new RunRules(statement, testRules, describeChild(method)); }
private Description describeMethod(FrameworkMethod method) { return isParameterized(method) ? describeParametrizedMethodWithChildren(method, getTestClass()) : super.describeChild(method); } }
@Override protected Description describeChild(FrameworkMethod method) { return isParameterized(method) ? describeSingleInvocationOfParametrizedMethod(method, getTestClass()) : super.describeChild(method); }
@Override protected Description describeChild(FrameworkMethod method) { final Description s = super.describeChild(method); return Description.createTestDescription(s.getClassName(), s.getMethodName() + paramsToString(params), s.getAnnotations().toArray(new Annotation[0])); }
@Override protected void runChild(final FrameworkMethod method, RunNotifier notifier) { Description description = describeChild(method); if (method.getAnnotation(Ignore.class) != null) { notifier.fireTestIgnored(description); } else { runLeaf(methodBlock(method), description, notifier); } }
@Override protected void runChild(final FrameworkMethod method, RunNotifier notifier) { Description description = describeChild(method); if (isIgnored(method)) { notifier.fireTestIgnored(description); } else { runLeaf(methodBlock(method), description, notifier); } }
@Override protected void runChild(final FrameworkMethod method, RunNotifier notifier) { Description description = describeChild(method); if (isIgnored(method)) { notifier.fireTestIgnored(description); } else { runLeaf(methodBlock(method), description, notifier); } }
@Override protected void runChild(final FrameworkMethod method, RunNotifier notifier) { Description description = describeChild(method); if (method.getAnnotation(Ignore.class) != null) { notifier.fireTestIgnored(description); } else { runLeaf(methodBlock(method), description, notifier); } }
@Override protected Description describeChild( FrameworkMethod method ) { Description child = super.describeChild( method ); return Description.createTestDescription( child.getTestClass(), name + ":" + child.getMethodName() ); } }