use of com.datastax.oss.dsbulk.tests.ccm.annotations.CCMFactoryMethod in project dsbulk by datastax.
the class CCMClusterFactory method createInstanceForClass.
public static CCMClusterFactory createInstanceForClass(Class<?> testClass) {
CCMFactoryMethod factoryRef = ReflectionUtils.locateClassAnnotation(testClass, CCMFactoryMethod.class);
CCMConfig config = ReflectionUtils.locateClassAnnotation(testClass, CCMConfig.class);
if (factoryRef != null) {
if (config != null) {
throw new IllegalStateException(String.format("%s can be annotated with either @CCMConfig or @CCMFactoryMethod, but not both", testClass));
}
return new CCMClusterMethodFactory(factoryRef, testClass);
}
if (config == null) {
config = DEFAULT_CCM_CONFIG;
}
return new CCMClusterAnnotationFactory(config);
}
Aggregations