Search in sources :

Example 6 with JvmOptions

use of org.sonar.application.command.JvmOptions in project sonarqube by SonarSource.

the class ProcessLauncherImplTest method temporary_properties_file_can_be_avoided.

@Test
public void temporary_properties_file_can_be_avoided() throws Exception {
    File tempDir = temp.newFolder();
    TestProcessBuilder processBuilder = new TestProcessBuilder();
    ProcessLauncher underTest = new ProcessLauncherImpl(tempDir, commands, () -> processBuilder);
    JavaCommand<JvmOptions<?>> command = new JavaCommand<>(ProcessId.WEB_SERVER, temp.newFolder());
    command.setReadsArgumentsFromFile(false);
    command.setArgument("foo", "bar");
    command.setArgument("baz", "woo");
    command.setJvmOptions(new JvmOptions<>());
    underTest.launch(command);
    String propsFilePath = processBuilder.commands.get(processBuilder.commands.size() - 1);
    File file = new File(propsFilePath);
    assertThat(file).doesNotExist();
}
Also used : JavaCommand(org.sonar.application.command.JavaCommand) EsJvmOptions(org.sonar.application.command.EsJvmOptions) JvmOptions(org.sonar.application.command.JvmOptions) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)6 Test (org.junit.Test)6 EsJvmOptions (org.sonar.application.command.EsJvmOptions)6 JvmOptions (org.sonar.application.command.JvmOptions)6 JavaCommand (org.sonar.application.command.JavaCommand)5 Properties (java.util.Properties)4 ManagedProcess (org.sonar.application.process.ManagedProcess)4 EsInstallation (org.sonar.application.es.EsInstallation)3 Props (org.sonar.process.Props)3 FileReader (java.io.FileReader)1 Random (java.util.Random)1