use of org.eclipse.debug.core.ILaunchConfiguration in project linuxtools by eclipse.
the class LaunchTest method testDelegate.
@Test
public void testDelegate() throws CoreException {
ILaunchConfiguration config = createConfiguration(proj.getProject());
ProviderLaunchConfigurationDelegate delegate = new ProviderLaunchConfigurationDelegate();
ILaunch launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
setProfileAttributes(wc);
delegate.launch(wc, ILaunchManager.PROFILE_MODE, launch, null);
}
use of org.eclipse.debug.core.ILaunchConfiguration in project linuxtools by eclipse.
the class ValgrindCoreParser method copyLaunchSourceLocator.
/**
* Return a safe source locator from launch object which won't be disposed if launch object is disposed
* @param launch - launch object
* @return source locator
*/
public static ISourceLocator copyLaunchSourceLocator(ILaunch launch) {
if (launch == null)
return null;
ISourceLocator sourceLocator = launch.getSourceLocator();
ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();
// since we want to use it later we need to create a copy of it
if (sourceLocator instanceof ISourceLookupDirector) {
try {
ISourceLookupDirector director = (ISourceLookupDirector) sourceLocator;
String id = director.getId();
String memento = director.getMemento();
IPersistableSourceLocator sourceLocatorCopy = DebugPlugin.getDefault().getLaunchManager().newSourceLocator(id);
if (sourceLocatorCopy instanceof IPersistableSourceLocator2) {
((IPersistableSourceLocator2) sourceLocatorCopy).initializeFromMemento(memento, launchConfiguration);
} else
sourceLocatorCopy.initializeFromMemento(memento);
return sourceLocatorCopy;
} catch (CoreException e) {
// ignore
}
}
return sourceLocator;
}
use of org.eclipse.debug.core.ILaunchConfiguration in project linuxtools by eclipse.
the class ShortcutTest method testShortcutExistingConfig.
@Test
public void testShortcutExistingConfig() throws CoreException {
ILaunchConfiguration prev = createConfiguration(proj.getProject());
ValgrindTestHelgrindLaunchShortcut shortcut = new ValgrindTestHelgrindLaunchShortcut();
shortcut.launch(new StructuredSelection(proj.getProject()), ILaunchManager.PROFILE_MODE);
ILaunchConfiguration current = shortcut.getConfig();
assertEquals(prev, current);
}
use of org.eclipse.debug.core.ILaunchConfiguration in project linuxtools by eclipse.
the class ShortcutTest method testShortcutSelection.
@Test
public void testShortcutSelection() throws CoreException {
ValgrindTestHelgrindLaunchShortcut shortcut = new ValgrindTestHelgrindLaunchShortcut();
shortcut.launch(new StructuredSelection(proj.getProject()), ILaunchManager.PROFILE_MODE);
ILaunchConfiguration config = shortcut.getConfig();
compareWithDefaults(config);
}
use of org.eclipse.debug.core.ILaunchConfiguration in project linuxtools by eclipse.
the class BasicMassifTest method testNumSnapshots.
@Test
public void testNumSnapshots() throws Exception {
ILaunchConfiguration config = createConfiguration(proj.getProject());
// $NON-NLS-1$
doLaunch(config, "testNumSnapshots");
MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
MassifSnapshot[] snapshots = view.getSnapshots();
assertEquals(14, snapshots.length);
checkSnapshots(snapshots, 40, 16);
}
Aggregations