/** * @return the {@code ClassRule}s that can transform the block that runs * each method in the tested class. */ protected List<TestRule> classRules() { List<TestRule> result = fTestClass.getAnnotatedMethodValues(null, ClassRule.class, TestRule.class); result.addAll(fTestClass.getAnnotatedFieldValues(null, ClassRule.class, TestRule.class)); return result; }
/** * @param target the test case instance * @return a list of TestRules that should be applied when executing this * test */ protected List<TestRule> getTestRules(Object target) { List<TestRule> result = getTestClass().getAnnotatedMethodValues(target, Rule.class, TestRule.class); result.addAll(getTestClass().getAnnotatedFieldValues(target, Rule.class, TestRule.class)); return result; }
/** * @return the {@code ClassRule}s that can transform the block that runs * each method in the tested class. */ protected List<TestRule> classRules() { List<TestRule> result = fTestClass.getAnnotatedMethodValues(null, ClassRule.class, TestRule.class); result.addAll(fTestClass.getAnnotatedFieldValues(null, ClassRule.class, TestRule.class)); return result; }
/** * @param target the test case instance * @return a list of TestRules that should be applied when executing this * test */ protected List<TestRule> getTestRules(Object target) { List<TestRule> result = getTestClass().getAnnotatedMethodValues(target, Rule.class, TestRule.class); result.addAll(getTestClass().getAnnotatedFieldValues(target, Rule.class, TestRule.class)); return result; }
/** * @return the {@code ClassRule}s that can transform the block that runs * each method in the tested class. */ protected List<TestRule> classRules() { List<TestRule> result = fTestClass.getAnnotatedMethodValues(null, ClassRule.class, TestRule.class); result.addAll(fTestClass.getAnnotatedFieldValues(null, ClassRule.class, TestRule.class)); return result; }
@Override protected List<TestRule> classRules() { List<TestRule> result = fTestClass.getAnnotatedMethodValues(null, ClassRule.class, TestRule.class); result.addAll(fTestClass.getAnnotatedFieldValues(null, ClassRule.class, TestRule.class)); return result; } }
/** * @param testClass * @return the {@code ClassRule}s that can transform the block that runs * each method in the tested class. * * @see ParentRunner#classRules() */ public static List<TestRule> getClassRules(TestClass testClass) { List<TestRule> result = testClass.getAnnotatedMethodValues(null, ClassRule.class, TestRule.class); result.addAll(testClass.getAnnotatedFieldValues(null, ClassRule.class, TestRule.class)); return result; }
/** * Find the test rules within the test mixin. * @param target the test case instance * @return a list of TestRules that should be applied when executing this * test */ private List<TestRule> getTestRules(final Object target) { return Stream.concat( testClass.getAnnotatedMethodValues(target, Rule.class, TestRule.class).stream(), testClass.getAnnotatedFieldValues(target, Rule.class, TestRule.class).stream()) .collect(Collectors.toList()); }
/** * @return the {@code ClassRule}s that can transform the block that runs each method in the tested class. */ protected List<TestRule> classRules() { List<TestRule> result = testClass.getAnnotatedMethodValues(null, ClassRule.class, TestRule.class); result.addAll(testClass.getAnnotatedFieldValues(null, ClassRule.class, TestRule.class)); return result; }
/** * @return the {@code ClassRule}s that can transform the block that runs * each method in the tested class. */ protected List<TestRule> classRules() { List<TestRule> result = testClass.getAnnotatedMethodValues(null, ClassRule.class, TestRule.class); result.addAll(testClass.getAnnotatedFieldValues(null, ClassRule.class, TestRule.class)); return result; }
protected Statement withRules(final Interaction interaction, final Object target, final Statement statement) { final List<TestRule> testRules = testClass.getAnnotatedMethodValues(target, Rule.class, TestRule.class); testRules.addAll(testClass.getAnnotatedFieldValues(target, Rule.class, TestRule.class)); return testRules.isEmpty() ? statement : new RunRules(statement, testRules, describeChild(interaction)); } }
/** * @param target the test case instance * @return a list of TestRules that should be applied when executing this * test */ protected List<TestRule> getTestRules(Object target) { List<TestRule> result = getTestClass().getAnnotatedMethodValues(target, Rule.class, TestRule.class); result.addAll(getTestClass().getAnnotatedFieldValues(target, Rule.class, TestRule.class)); return result; }
/** * @param target the test case instance * @return a list of MethodRules that should be applied when executing this test */ protected List<MethodRule> rules(Object target) { List<MethodRule> rules = getTestClass().getAnnotatedMethodValues(target, Rule.class, MethodRule.class); rules.addAll(getTestClass().getAnnotatedFieldValues(target, Rule.class, MethodRule.class)); return rules; }
/** * @param target the test case instance * @return a list of MethodRules that should be applied when executing this * test */ protected List<MethodRule> rules(Object target) { List<MethodRule> rules = getTestClass().getAnnotatedMethodValues(target, Rule.class, MethodRule.class); rules.addAll(getTestClass().getAnnotatedFieldValues(target, Rule.class, MethodRule.class)); return rules; }
/** * @return the {@code ClassRule}s that can transform the block that runs * each method in the tested class. */ protected List<TestRule> classRules() { List<TestRule> result = getTestClass().getAnnotatedMethodValues(null, ClassRule.class, TestRule.class); result.addAll(getTestClass().getAnnotatedFieldValues(null, ClassRule.class, TestRule.class)); return result; }
/** * @param target the test case instance * @return a list of TestRules that should be applied when executing this * test */ protected List<TestRule> getTestRules(Object target) { List<TestRule> result = getTestClass().getAnnotatedMethodValues(target, Rule.class, TestRule.class); result.addAll(getTestClass().getAnnotatedFieldValues(target, Rule.class, TestRule.class)); return result; }
@Override protected List<TestRule> getTestRules(Object target) { List<TestRule> result = getTestClass().getAnnotatedMethodValues(target, Rule.class, TestRule.class); result.addAll(getTestClass().getAnnotatedFieldValues(target, Rule.class, TestRule.class)); return result; }
/** * @param target the test case instance * @return a list of MethodRules that should be applied when executing this * test */ protected List<MethodRule> rules(Object target) { List<MethodRule> rules = getTestClass().getAnnotatedMethodValues(target, Rule.class, MethodRule.class); rules.addAll(getTestClass().getAnnotatedFieldValues(target, Rule.class, MethodRule.class)); return rules; }
/** * @param target the test case instance * @return a list of TestRules that should be applied when executing this * test */ protected List<TestRule> getTestRules(Object target) { List<TestRule> result = getTestClass().getAnnotatedMethodValues(target, Rule.class, TestRule.class); result.addAll(getTestClass().getAnnotatedFieldValues(target, Rule.class, TestRule.class)); return result; }
/** * @param target the test case instance * @return a list of TestRules that should be applied when executing this * test */ protected List<TestRule> getTestRules(Object target) { List<TestRule> result = getTestClass().getAnnotatedMethodValues(target, Rule.class, TestRule.class); result.addAll(getTestClass().getAnnotatedFieldValues(target, Rule.class, TestRule.class)); return result; }