Search in sources :

Example 11 with Launch

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);
    }
}
Also used : PerfLaunchConfigDelegate(org.eclipse.linuxtools.internal.perf.launch.PerfLaunchConfigDelegate) Launch(org.eclipse.debug.core.Launch) ILaunch(org.eclipse.debug.core.ILaunch) Before(org.junit.Before)

Example 12 with Launch

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);
}
Also used : PerfLaunchConfigDelegate(org.eclipse.linuxtools.internal.perf.launch.PerfLaunchConfigDelegate) Launch(org.eclipse.debug.core.Launch) ILaunch(org.eclipse.debug.core.ILaunch) Before(org.junit.Before)

Example 13 with Launch

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;
}
Also used : IPath(org.eclipse.core.runtime.IPath) ILaunch(org.eclipse.debug.core.ILaunch) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) Launch(org.eclipse.debug.core.Launch) ILaunch(org.eclipse.debug.core.ILaunch)

Example 14 with 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;
}
Also used : ILaunch(org.eclipse.debug.core.ILaunch) IStreamsProxy(org.eclipse.debug.core.model.IStreamsProxy) File(java.io.File) Launch(org.eclipse.debug.core.Launch) ILaunch(org.eclipse.debug.core.ILaunch) IOException(java.io.IOException)

Example 15 with Launch

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());
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) DSELaunch(de.uka.ipd.sdq.dsexplore.launch.DSELaunch) ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) ILaunch(org.eclipse.debug.core.ILaunch) Launch(org.eclipse.debug.core.Launch) ILaunch(org.eclipse.debug.core.ILaunch) DSELaunch(de.uka.ipd.sdq.dsexplore.launch.DSELaunch)

Aggregations

ILaunch (org.eclipse.debug.core.ILaunch)16 Launch (org.eclipse.debug.core.Launch)16 AbstractTest (org.eclipse.linuxtools.profiling.tests.AbstractTest)4 Before (org.junit.Before)4 Test (org.junit.Test)4 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)3 ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)3 LaunchTestingOptions (org.eclipse.linuxtools.oprofile.launch.tests.utils.LaunchTestingOptions)3 TestingOprofileLaunchConfigurationDelegate (org.eclipse.linuxtools.oprofile.launch.tests.utils.TestingOprofileLaunchConfigurationDelegate)3 DSELaunch (de.uka.ipd.sdq.dsexplore.launch.DSELaunch)2 File (java.io.File)2 IOException (java.io.IOException)2 ProjectScope (org.eclipse.core.resources.ProjectScope)2 CoreException (org.eclipse.core.runtime.CoreException)2 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)2 IExtensionPoint (org.eclipse.core.runtime.IExtensionPoint)2 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)2 IProcess (org.eclipse.debug.core.model.IProcess)2 IStreamsProxy (org.eclipse.debug.core.model.IStreamsProxy)2 PerfLaunchConfigDelegate (org.eclipse.linuxtools.internal.perf.launch.PerfLaunchConfigDelegate)2