use of org.testng.internal.annotations.JDK15AnnotationFinder in project druid by druid-io.
the class TestNG method initializeConfiguration.
private void initializeConfiguration() {
ITestObjectFactory factory = m_objectFactory;
//
// Install the listeners found in ServiceLoader (or use the class
// loader for tests, if specified).
//
addServiceLoaderListeners();
//
for (XmlSuite s : m_suites) {
for (String listenerName : s.getListeners()) {
Class<?> listenerClass = ClassHelper.forName(listenerName);
// If specified listener does not exist, a TestNGException will be thrown
if (listenerClass == null) {
throw new TestNGException("Listener " + listenerName + " was not found in project's classpath");
}
Object listener = ClassHelper.newInstance(listenerClass);
addListener(listener);
}
//
for (XmlMethodSelector methodSelector : s.getMethodSelectors()) {
addMethodSelector(methodSelector.getClassName(), methodSelector.getPriority());
}
//
if (s.getObjectFactory() != null) {
if (factory == null) {
factory = s.getObjectFactory();
} else {
throw new TestNGException("Found more than one object-factory tag in your suites");
}
}
}
m_configuration.setAnnotationFinder(new JDK15AnnotationFinder(getAnnotationTransformer()));
m_configuration.setHookable(m_hookable);
m_configuration.setConfigurable(m_configurable);
m_configuration.setObjectFactory(factory);
}
Aggregations