use of com.hazelcast.simulator.test.annotations.Run in project hazelcast-simulator by hazelcast.
the class MapTransactionContextConflictTest method run.
@Run
public void run() {
ThreadSpawner spawner = new ThreadSpawner(name);
for (int i = 0; i < threadCount; i++) {
spawner.spawn(new Worker());
}
spawner.awaitCompletion();
}
use of com.hazelcast.simulator.test.annotations.Run in project hazelcast-simulator by hazelcast.
the class MapDataIntegrityTest method run.
@Run
public void run() {
ThreadSpawner spawner = new ThreadSpawner(name);
for (int i = 0; i < mapIntegrityThreadCount; i++) {
integrityThreads[i] = new MapIntegrityThread();
spawner.spawn(integrityThreads[i]);
}
for (int i = 0; i < stressThreadCount; i++) {
spawner.spawn(new StressThread());
}
spawner.awaitCompletion();
}
use of com.hazelcast.simulator.test.annotations.Run in project hazelcast-simulator by hazelcast.
the class QueueTest method run.
@Run
public void run() {
ThreadSpawner spawner = new ThreadSpawner(name);
for (int queueIndex = 0; queueIndex < queueLength; queueIndex++) {
for (int i = 0; i < threadsPerQueue; i++) {
spawner.spawn(new Worker(queueIndex));
}
}
spawner.awaitCompletion();
}
use of com.hazelcast.simulator.test.annotations.Run in project hazelcast-simulator by hazelcast.
the class GrowingMapTest method run.
@Run
public void run() {
ThreadSpawner spawner = new ThreadSpawner(name);
for (int i = 0; i < threadCount; i++) {
spawner.spawn(new Worker());
}
spawner.awaitCompletion();
}
use of com.hazelcast.simulator.test.annotations.Run in project hazelcast-simulator by hazelcast.
the class TestContainer method loadRunStrategy.
private RunStrategy loadRunStrategy() {
try {
List<String> runAnnotations = new LinkedList<String>();
RunStrategy runStrategy = null;
Method runMethod = new AnnotatedMethodRetriever(testClass, Run.class).withoutArgs().withVoidReturnType().withPublicNonStaticModifier().find();
if (runMethod != null) {
runAnnotations.add(Run.class.getName());
runStrategy = new PrimordialRunStrategy(testInstance, runMethod);
}
List<Method> timeStepMethods = new AnnotatedMethodRetriever(testClass, TimeStep.class).findAll();
if (!timeStepMethods.isEmpty()) {
runAnnotations.add(TimeStep.class.getName());
runStrategy = new TimeStepRunStrategy(this);
}
if (runAnnotations.size() == 0) {
throw new IllegalTestException("Test is missing a run strategy, it must contain one of the following annotations: " + asList(Run.class.getName(), TimeStep.class.getName()));
} else if (runAnnotations.size() > 1) {
throw new IllegalTestException("Test has more than one run strategy, found the following annotations: " + runAnnotations);
} else {
return runStrategy;
}
} catch (IllegalTestException e) {
throw rethrow(e);
} catch (Exception e) {
throw new IllegalTestException(format("Error loading run strategy in %s: [%s] %s", testClass.getName(), e.getClass().getSimpleName(), e.getMessage()), e);
}
}
Aggregations