NGrinderAgentStarter implements AgentConstants, CommonConstants { public void startAgent() { printLog("***************************************************"); printLog(" Start nGrinder Agent ..."); printLog("***************************************************"); if (StringUtils.isEmpty(System.getenv("JAVA_HOME"))) { printLog("Hey!! JAVA_HOME env var was not provided. " + "Please provide JAVA_HOME env var before running agent." + "Otherwise you can not execute the agent in the security mode."); } boolean serverMode = agentConfig.isServerMode(); if (!serverMode) { printLog("JVM server mode is disabled."); } if (agentConfig.isConnectionMode()) { LOG.info("waiting for connection on {}:{}", agentConfig.getBroadcastIP(), agentConfig.getConnectionAgentPort()); } else { String controllerIP = getIP(agentConfig.getControllerIP()); agentConfig.setControllerHost(controllerIP); LOG.info("connecting to controller {}:{}", controllerIP, agentConfig.getControllerPort()); } try { agentController = new AgentControllerDaemon(agentConfig); agentController.run(); } catch (Exception e) { LOG.error("Error while starting Agent", e); printHelpAndExit("Error while starting Agent", e); } } NGrinderAgentStarter(); void init(); String getStartMode(); String getVersion(); void startMonitor(); void startAgent(); static void main(String[] args); void checkDuplicatedRun(String startMode);  }
@Test public void testStartAgent() { starter.startAgent(); ThreadUtils.sleep(5000); starter.stopAgent(); }