コード例 #1
0
  public void launch() {
    try {
      testSuiteDir = agent.getTestSuiteDir();
      ensureExistingDirectory(testSuiteDir);

      WorkerType type = workerJvmSettings.getWorkerType();
      int workerIndex = workerJvmSettings.getWorkerIndex();
      LOGGER.info(format("Starting a Java Virtual Machine for %s Worker #%d", type, workerIndex));

      String hzConfigFileName = (type == WorkerType.MEMBER) ? "hazelcast" : "client-hazelcast";
      hzConfigFile = createTmpXmlFile(hzConfigFileName, workerJvmSettings.getHazelcastConfig());
      log4jFile = createTmpXmlFile("worker-log4j", workerJvmSettings.getLog4jConfig());
      LOGGER.info("Spawning Worker JVM using settings: " + workerJvmSettings);

      WorkerJvm worker = startWorkerJvm();
      LOGGER.info(format("Finished starting a JVM for %s Worker #%d", type, workerIndex));

      waitForWorkersStartup(worker, workerJvmSettings.getWorkerStartupTimeout());
    } catch (Exception e) {
      LOGGER.error("Failed to start Worker", e);

      agent.getCoordinatorLogger().fatal("Failed to start Worker: " + e.getMessage());
      throw new SpawnWorkerFailedException("Failed to start Worker", e);
    }
  }
コード例 #2
0
 private String getClasspath() {
   String hzVersionDirectory =
       directoryForVersionSpec(workerJvmSettings.getHazelcastVersionSpec());
   return CLASSPATH
       + CLASSPATH_SEPARATOR
       + getSimulatorHome()
       + "/hz-lib/"
       + hzVersionDirectory
       + "/*"
       + CLASSPATH_SEPARATOR
       + getSimulatorHome()
       + "/user-lib/*"
       + CLASSPATH_SEPARATOR
       + new File(agent.getTestSuiteDir(), "lib/*").getAbsolutePath();
 }