* @param errors The list where to report any problem found.
*/
@Override
protected void validateTestMethods(final List<Throwable> errors) {
super.validateTestMethods(errors);
final TestClass testClass = getTestClass();
final List<FrameworkMethod> depends = testClass.getAnnotatedMethods(DependsOnMethod.class);
if (!isNullOrEmpty(depends)) {
final Set<String> dependencies = new HashSet<String>(hashMapCapacity(depends.size()));
for (final FrameworkMethod method : depends) {
for (final String value : method.getAnnotation(DependsOnMethod.class).value()) {
dependencies.add(value);
}
}
for (final FrameworkMethod method : testClass.getAnnotatedMethods(Test.class)) {
dependencies.remove(method.getName());
}
for (final String notFound : dependencies) {
errors.add(new NoSuchMethodException("@DependsOnMethod(\"" + notFound + "\"): "
+ "method not found in " + testClass.getName()));
}
}
}