use of org.eclipse.debug.core.Launch in project linuxtools by eclipse.
the class LaunchRemoteTest method setUp.
@Before
public void setUp() throws Exception {
if ((!(AbstractRemoteTest.USERNAME.isEmpty()))) {
project = null;
config = createConfiguration(project);
delegate = new PerfLaunchConfigDelegate();
launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
wc = config.getWorkingCopy();
setProfileAttributes(wc);
}
}
use of org.eclipse.debug.core.Launch in project linuxtools by eclipse.
the class LaunchTest method setUp.
@Before
public void setUp() throws Exception {
// $NON-NLS-1$
proj = createProjectAndBuild(FrameworkUtil.getBundle(this.getClass()), "fibTest");
config = createConfiguration(proj.getProject());
delegate = new PerfLaunchConfigDelegate();
launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
wc = config.getWorkingCopy();
setProfileAttributes(wc);
}
use of org.eclipse.debug.core.Launch in project linuxtools by eclipse.
the class AbstractValgrindTest method doLaunch.
protected ILaunch doLaunch(ILaunchConfiguration config, String testName) throws URISyntaxException, IOException, CoreException {
ILaunch launch;
IPath pathToFiles = getPathToFiles(testName);
if (!ValgrindTestsPlugin.RUN_VALGRIND) {
bindLocation(pathToFiles);
}
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
wc.setAttribute(LaunchConfigurationConstants.ATTR_INTERNAL_OUTPUT_DIR, pathToFiles.toOSString());
wc.doSave();
ValgrindTestLaunchDelegate delegate = new ValgrindTestLaunchDelegate();
launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
DebugPlugin.getDefault().getLaunchManager().addLaunch(launch);
launches.add(launch);
delegate.launch(config, ILaunchManager.PROFILE_MODE, launch, null);
if (ValgrindTestsPlugin.RUN_VALGRIND) {
unbindLocation(pathToFiles);
}
return launch;
}
use of org.eclipse.debug.core.Launch in project webtools.servertools by eclipse.
the class TomcatRuntime method checkForCompiler.
/**
* Checks for the existence of the Java compiler in the given java
* executable. A main program is run (<code>org.eclipse.jst.tomcat.core.
* internal.ClassDetector</code>), that dumps a true or false value
* depending on whether the compiler is found. This output is then
* parsed and cached for future reference.
*
* @return true if the compiler was found
*/
protected boolean checkForCompiler() {
// first try the cache
File javaHome = getVMInstall().getInstallLocation();
try {
Boolean b = sdkMap.get(javaHome);
return b.booleanValue();
} catch (Exception e) {
// ignore
}
// locate tomcatcore.jar - it contains the class detector main program
File file = TomcatPlugin.getPlugin();
if (file != null && file.exists()) {
IVMRunner vmRunner = getVMInstall().getVMRunner(ILaunchManager.RUN_MODE);
VMRunnerConfiguration config = new VMRunnerConfiguration("org.eclipse.jst.server.tomcat.core.internal.ClassDetector", new String[] { file.getAbsolutePath() });
config.setProgramArguments(new String[] { "com.sun.tools.javac.Main" });
ILaunch launch = new Launch(null, ILaunchManager.RUN_MODE, null);
try {
vmRunner.run(config, launch, null);
for (int i = 0; i < 600; i++) {
// wait no more than 30 seconds (600 * 50 mils)
if (launch.isTerminated()) {
break;
}
try {
Thread.sleep(50);
} catch (InterruptedException e) {
// ignore
}
}
IStreamsProxy streamsProxy = launch.getProcesses()[0].getStreamsProxy();
String text = null;
if (streamsProxy != null) {
text = streamsProxy.getOutputStreamMonitor().getContents();
if (text != null && text.length() > 0) {
boolean found = false;
if ("true".equals(text))
found = true;
sdkMap.put(javaHome, new Boolean(found));
return found;
}
}
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error checking for JDK", e);
} finally {
if (!launch.isTerminated()) {
try {
launch.terminate();
} catch (Exception ex) {
// ignore
}
}
}
}
// log error that we were unable to check for the compiler
TomcatPlugin.log(MessageFormat.format("Failed compiler check for {0}", (Object[]) new String[] { javaHome.getAbsolutePath() }));
return false;
}
use of org.eclipse.debug.core.Launch in project iobserve-analysis by research-iobserve.
the class PerOpteryxHeadless method launchPeropteryx.
private void launchPeropteryx(final String workingDir) throws CoreException {
LOG.info("Configuring PerOpteryx run...");
DSELaunch launch = new DSELaunch();
this.configureInternalWorkspace(workingDir);
String projectDir = PerOpteryxLaunchConfigurationBuilder.DEFAULT_PROJECT_NAME + "/" + PerOpteryxLaunchConfigurationBuilder.DEFAULT_PROJECT_WORKING_DIR;
ILaunchConfiguration launchConfig = PerOpteryxLaunchConfigurationBuilder.getDefaultLaunchConfiguration(projectDir, workingDir);
ILaunch currentLaunch = new Launch(launchConfig, ILaunchManager.RUN_MODE, null);
DebugPlugin.getDefault().getLaunchManager().addLaunch(currentLaunch);
LOG.info("Launching PerOpteryx...");
launch.launch(launchConfig, ILaunchManager.RUN_MODE, currentLaunch, new NullProgressMonitor());
}
Aggregations