Search in sources :

Example 1 with ValgrindTestLaunchShortcut

use of org.eclipse.linuxtools.internal.valgrind.tests.ValgrindTestLaunchShortcut in project linuxtools by eclipse.

the class ShortcutTest method testShortcutEditor.

@Test
public void testShortcutEditor() throws Exception {
    ValgrindTestLaunchShortcut shortcut = new ValgrindTestLaunchShortcut();
    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    // $NON-NLS-1$
    IFile file = proj.getProject().getFile("test.c");
    IEditorPart editor = IDE.openEditor(page, file);
    assertNotNull(editor);
    shortcut.launch(editor, ILaunchManager.PROFILE_MODE);
    ILaunchConfiguration config = shortcut.getConfig();
    compareWithDefaults(config);
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) IFile(org.eclipse.core.resources.IFile) ValgrindTestLaunchShortcut(org.eclipse.linuxtools.internal.valgrind.tests.ValgrindTestLaunchShortcut) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IEditorPart(org.eclipse.ui.IEditorPart) Test(org.junit.Test)

Example 2 with ValgrindTestLaunchShortcut

use of org.eclipse.linuxtools.internal.valgrind.tests.ValgrindTestLaunchShortcut in project linuxtools by eclipse.

the class ShortcutTest method testShortcutSelection.

@Test
public void testShortcutSelection() throws Exception {
    ValgrindTestLaunchShortcut shortcut = new ValgrindTestLaunchShortcut();
    shortcut.launch(new StructuredSelection(proj.getProject()), ILaunchManager.PROFILE_MODE);
    ILaunchConfiguration config = shortcut.getConfig();
    compareWithDefaults(config);
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) ValgrindTestLaunchShortcut(org.eclipse.linuxtools.internal.valgrind.tests.ValgrindTestLaunchShortcut) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) Test(org.junit.Test)

Example 3 with ValgrindTestLaunchShortcut

use of org.eclipse.linuxtools.internal.valgrind.tests.ValgrindTestLaunchShortcut in project linuxtools by eclipse.

the class ShortcutTest method testShortcutExistingConfig.

@Test
public void testShortcutExistingConfig() throws Exception {
    ILaunchConfiguration prev = createConfiguration(proj.getProject());
    ValgrindTestLaunchShortcut shortcut = new ValgrindTestLaunchShortcut();
    shortcut.launch(new StructuredSelection(proj.getProject()), ILaunchManager.PROFILE_MODE);
    ILaunchConfiguration current = shortcut.getConfig();
    assertEquals(prev, current);
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) ValgrindTestLaunchShortcut(org.eclipse.linuxtools.internal.valgrind.tests.ValgrindTestLaunchShortcut) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) Test(org.junit.Test)

Aggregations

ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)3 ValgrindTestLaunchShortcut (org.eclipse.linuxtools.internal.valgrind.tests.ValgrindTestLaunchShortcut)3 Test (org.junit.Test)3 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)2 IFile (org.eclipse.core.resources.IFile)1 IEditorPart (org.eclipse.ui.IEditorPart)1 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)1