private EsScriptCommand createEsCommandForUnix() { EsInstallation esInstallation = createEsInstallation(); return new EsScriptCommand(ProcessId.ELASTICSEARCH, esInstallation.getHomeDirectory()) .setEsInstallation(esInstallation) .addOption("-Epath.conf=" + esInstallation.getConfDirectory().getAbsolutePath()) .setEnvVariable("ES_JVM_OPTIONS", esInstallation.getJvmOptions().getAbsolutePath()) .setEnvVariable("JAVA_HOME", System.getProperties().getProperty("java.home")) .suppressEnvVariable(ENV_VAR_JAVA_TOOL_OPTIONS) .suppressEnvVariable(ENV_VAR_ES_JAVA_OPTS); }
private EsScriptCommand createEsScriptCommand(File tempDir, File homeDir, File dataDir, File logDir) throws IOException { EsScriptCommand command = new EsScriptCommand(ProcessId.ELASTICSEARCH, temp.newFolder()); Props props = new Props(new Properties()); props.set("sonar.path.temp", tempDir.getAbsolutePath()); props.set("sonar.path.home", homeDir.getAbsolutePath()); props.set("sonar.path.data", dataDir.getAbsolutePath()); props.set("sonar.path.logs", logDir.getAbsolutePath()); command.setEsInstallation(new EsInstallation(props) .setEsYmlSettings(mock(EsYmlSettings.class)) .setEsJvmOptions(mock(EsJvmOptions.class)) .setLog4j2Properties(new Properties()) .setHost("localhost") .setPort(9001) .setClusterName("sonarqube")); return command; }
@Before public void setUp() throws Exception { File tempDir = temporaryFolder.newFolder(); esScriptCommand = new EsScriptCommand(ELASTICSEARCH, tempDir); webLeaderCommand = new JavaCommand(WEB_SERVER, tempDir); webFollowerCommand = new JavaCommand(WEB_SERVER, tempDir); ceCommand = new JavaCommand(COMPUTE_ENGINE, tempDir); }
private EsScriptCommand createEsCommandForUnix() { EsInstallation esInstallation = createEsInstallation(); return new EsScriptCommand(ProcessId.ELASTICSEARCH, esInstallation.getHomeDirectory()) .setEsInstallation(esInstallation) .addOption("-Epath.conf=" + esInstallation.getConfDirectory().getAbsolutePath()) .setEnvVariable("ES_JVM_OPTIONS", esInstallation.getJvmOptions().getAbsolutePath()) .setEnvVariable("JAVA_HOME", System.getProperties().getProperty("java.home")) .suppressEnvVariable(ENV_VAR_JAVA_TOOL_OPTIONS); }