use of com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters in project randomizedtesting by randomizedtesting.
the class ThreadLeakControl method instantiateFilters.
/**
* Instantiate a full set of {@link ThreadFilter}s for a suite.
*/
private ThreadFilter instantiateFilters(List<Throwable> errors, Class<?> suiteClass) {
ThreadLeakFilters ann = firstAnnotated(ThreadLeakFilters.class, suiteClass, DefaultAnnotationValues.class);
final ArrayList<ThreadFilter> filters = new ArrayList<ThreadFilter>();
for (Class<? extends ThreadFilter> c : ann.filters()) {
try {
filters.add(c.newInstance());
} catch (Throwable t) {
errors.add(t);
}
}
if (ann.defaultFilters()) {
filters.addAll(builtinFilters);
}
return or(filters.toArray(new ThreadFilter[filters.size()]));
}
Aggregations