use of org.eclipse.sisu.equinox.launching.internal.EquinoxLaunchConfiguration in project tycho by eclipse.
the class TestMojoTest method testAddProgramArgsWithSpaces.
@Test
public void testAddProgramArgsWithSpaces() throws Exception {
EquinoxLaunchConfiguration cli = createEquinoxConfiguration();
TestMojo testMojo = new TestMojo();
testMojo.addProgramArgs(cli, "-data", "/path with spaces ");
assertEquals(2, cli.getProgramArguments().length);
assertEquals("-data", cli.getProgramArguments()[0]);
assertEquals("/path with spaces ", cli.getProgramArguments()[1]);
}
use of org.eclipse.sisu.equinox.launching.internal.EquinoxLaunchConfiguration in project tycho by eclipse.
the class TestMojo method createCommandLine.
LaunchConfiguration createCommandLine(EquinoxInstallation testRuntime) throws MalformedURLException, MojoExecutionException {
EquinoxLaunchConfiguration cli = new EquinoxLaunchConfiguration(testRuntime);
String executable = null;
Toolchain tc = getToolchain();
if (tc != null) {
getLog().info("Toolchain in tycho-surefire-plugin: " + tc);
executable = tc.findTool("java");
}
cli.setJvmExecutable(executable);
cli.setWorkingDirectory(project.getBasedir());
if (debugPort > 0) {
cli.addVMArguments("-Xdebug", "-Xrunjdwp:transport=dt_socket,address=" + debugPort + ",server=y,suspend=y");
}
cli.addVMArguments("-Dosgi.noShutdown=false");
Properties properties = (Properties) project.getContextValue(TychoConstants.CTX_MERGED_PROPERTIES);
//
cli.addVMArguments(//
"-Dosgi.os=" + PlatformPropertiesUtils.getOS(properties), //
"-Dosgi.ws=" + PlatformPropertiesUtils.getWS(properties), "-Dosgi.arch=" + PlatformPropertiesUtils.getArch(properties));
addCustomProfileArg(cli);
cli.addVMArguments(splitArgLine(argLine));
for (Map.Entry<String, String> entry : getMergedSystemProperties().entrySet()) {
cli.addVMArguments("-D" + entry.getKey() + "=" + entry.getValue());
}
if (getLog().isDebugEnabled() || showEclipseLog) {
cli.addProgramArguments("-debug", "-consolelog");
}
addProgramArgs(//
cli, //
"-data", //
osgiDataDirectory.getAbsolutePath(), //
"-install", //
testRuntime.getLocation().getAbsolutePath(), //
"-configuration", //
testRuntime.getConfigurationLocation().getAbsolutePath(), //
"-application", //
getTestApplication(testRuntime.getInstallationDescription()), "-testproperties", surefireProperties.getAbsolutePath());
if (application != null) {
cli.addProgramArguments("-testApplication", application);
}
if (product != null) {
cli.addProgramArguments("-product", product);
}
if (useUIHarness && !useUIThread) {
cli.addProgramArguments("-nouithread");
}
cli.addProgramArguments(splitArgLine(appArgLine));
if (environmentVariables != null) {
cli.addEnvironmentVariables(environmentVariables);
}
return cli;
}
use of org.eclipse.sisu.equinox.launching.internal.EquinoxLaunchConfiguration in project tycho by eclipse.
the class TestMojoTest method testAddProgramArgsNullArg.
@Test
public void testAddProgramArgsNullArg() throws Exception {
EquinoxLaunchConfiguration cli = createEquinoxConfiguration();
TestMojo testMojo = new TestMojo();
// null arg must be ignored
testMojo.addProgramArgs(cli, "-data", null);
assertEquals(1, cli.getProgramArguments().length);
}
Aggregations