use of com.hazelcast.simulator.test.annotations.BeforeRun in project hazelcast-simulator by hazelcast.
the class TimeStepModel method loadBeforeRunMethods.
private void loadBeforeRunMethods() {
List<Method> methods = new AnnotatedMethodRetriever(testClass, BeforeRun.class).findAll();
validateModifiers(methods);
validateBeforeAndAfterRunArguments(BeforeRun.class.getSimpleName(), methods);
for (Method method : methods) {
BeforeRun beforeRun = method.getAnnotation(BeforeRun.class);
String executionGroupName = beforeRun.executionGroup();
ensureExecutionGroupIsIdentifier(method, executionGroupName);
ExecutionGroup executionGroup = executionGroups.get(executionGroupName);
if (executionGroup == null) {
if (executionGroupName.equals("")) {
throw new IllegalTestException("@BeforeRun " + method + " is part of default executionGroup," + " but no timeStep methods for that executionGroup exist ");
} else {
throw new IllegalTestException("@BeforeRun " + method + " is part of executionGroup [" + executionGroupName + "], but no timeStep methods for that executionGroup exist ");
}
}
executionGroup.beforeRunMethods.add(method);
}
}
Aggregations