use of com.datastax.oss.dsbulk.tests.simulacron.annotations.SimulacronConfig in project dsbulk by datastax.
the class BoundClusterFactory method createInstanceForClass.
public static BoundClusterFactory createInstanceForClass(Class<?> testClass) {
SimulacronFactoryMethod factoryRef = ReflectionUtils.locateClassAnnotation(testClass, SimulacronFactoryMethod.class);
SimulacronConfig config = ReflectionUtils.locateClassAnnotation(testClass, SimulacronConfig.class);
if (factoryRef != null) {
if (config != null) {
throw new IllegalStateException(String.format("%s can be annotated with either @SimulacronClusterFactory or @SimulacronFactoryRef, but not both", testClass));
}
return new SimulacronClusterMethodFactory(factoryRef, testClass);
}
if (config == null) {
config = DEFAULT_SIMULACRON_CONFIG;
}
return new SimulacronClusterAnnotationFactory(config);
}
Aggregations