try {
Method runMethod= getClass().getMethod(getName());
for( final Annotation a : runMethod.getAnnotations() ) {
Recipe r = a.annotationType().getAnnotation(Recipe.class);
if(r==null) continue;
final Runner runner = r.value().newInstance();
recipes.add(runner);
tearDowns.add(new LenientRunnable() {
public void run() throws Exception {
runner.tearDown(HudsonTestCase.this,a);
}
});
runner.setup(this,a);
}
} catch (NoSuchMethodException e) {
// not a plain JUnit test.
}
}