@Run
 public void run() {
   ThreadSpawner spawner = new ThreadSpawner(testContext.getTestId());
   for (int i = 0; i < threadCount; i++) {
     spawner.spawn(new Worker());
   }
   spawner.awaitCompletion();
 }
 @Run
 public void run() {
   ThreadSpawner spawner = new ThreadSpawner(testContext.getTestId());
   for (int k = 0; k < producerCount; k++) {
     spawner.spawn("ProducerThread", new Producer(k));
   }
   for (int k = 0; k < consumerCount; k++) {
     spawner.spawn("ConsumerThread", new Consumer(k));
   }
   spawner.awaitCompletion();
 }
 @Run
 public void run() {
   ThreadSpawner spawner = new ThreadSpawner(testContext.getTestId());
   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();
 }
예제 #4
0
  private IWorker spawnWorkerThreads(Field testContextField, Field workerProbeField, Probe probe)
      throws Exception {
    IWorker worker = null;

    ThreadSpawner spawner = new ThreadSpawner(testContext.getTestId());
    for (int i = 0; i < threadCount; i++) {
      worker = invokeMethod(testClassInstance, runWithWorkerMethod);

      if (testContextField != null) {
        setFieldValue(worker, testContextField, testContext);
      }
      if (workerProbeField != null) {
        setFieldValue(worker, workerProbeField, probe);
      }

      bindOptionalProperty(
          worker, testCase, OptionalTestProperties.LOG_FREQUENCY.getPropertyName());

      spawner.spawn(worker);
    }
    spawner.awaitCompletion();

    return worker;
  }