Search in sources :

Example 31 with ILaunchConfiguration

use of org.eclipse.debug.core.ILaunchConfiguration in project linuxtools by eclipse.

the class DoubleClickTest method testDoubleClickFile.

@Test
public void testDoubleClickFile() throws Exception {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    // $NON-NLS-1$
    doLaunch(config, "testDoubleClickFile");
    CachegrindViewPart view = (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
    CachegrindOutput output = view.getOutputs()[0];
    // $NON-NLS-1$
    CachegrindFile file = getFileByName(output, "cpptest.cpp");
    TreePath path = new TreePath(new Object[] { output, file });
    doDoubleClick(path);
    checkFile(file);
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) TreePath(org.eclipse.jface.viewers.TreePath) CachegrindOutput(org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindOutput) CachegrindFile(org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFile) CachegrindViewPart(org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart) Test(org.junit.Test)

Example 32 with ILaunchConfiguration

use of org.eclipse.debug.core.ILaunchConfiguration in project linuxtools by eclipse.

the class MultiProcessTest method testNoExec.

@Test
public void testNoExec() throws Exception {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    // $NON-NLS-1$
    doLaunch(config, "testNoExec");
    CachegrindViewPart view = (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
    assertEquals(1, view.getOutputs().length);
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) CachegrindViewPart(org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart) Test(org.junit.Test)

Example 33 with ILaunchConfiguration

use of org.eclipse.debug.core.ILaunchConfiguration in project linuxtools by eclipse.

the class BasicMemcheckTest method testNumErrors.

@Test
public void testNumErrors() throws Exception {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    // $NON-NLS-1$
    doLaunch(config, "testNumErrors");
    IValgrindMessage[] messages = ValgrindUIPlugin.getDefault().getView().getMessages();
    assertEquals(3, messages.length);
    // $NON-NLS-1$
    checkTestMessages(messages, "testNumErrors");
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) IValgrindMessage(org.eclipse.linuxtools.valgrind.core.IValgrindMessage) Test(org.junit.Test)

Example 34 with ILaunchConfiguration

use of org.eclipse.debug.core.ILaunchConfiguration in project linuxtools by eclipse.

the class DoubleClickTest method testDoubleClickLaunchRemoved.

@Test
public void testDoubleClickLaunchRemoved() throws Exception {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    // $NON-NLS-1$
    ILaunch launch = doLaunch(config, "testDoubleClickLine");
    // Remove launch - tests #284919
    DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
    doDoubleClick();
    IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    assertTrue("editor should be ITextEditor", editor instanceof ITextEditor);
    ITextEditor textEditor = (ITextEditor) editor;
    ISelection selection = textEditor.getSelectionProvider().getSelection();
    assertTrue("selection must be TextSelection", selection instanceof TextSelection);
    TextSelection textSelection = (TextSelection) selection;
    // zero-indexed
    int line = textSelection.getStartLine() + 1;
    assertEquals(frame.getLine(), line);
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) ITextEditor(org.eclipse.ui.texteditor.ITextEditor) TextSelection(org.eclipse.jface.text.TextSelection) ILaunch(org.eclipse.debug.core.ILaunch) ISelection(org.eclipse.jface.viewers.ISelection) IEditorPart(org.eclipse.ui.IEditorPart) Test(org.junit.Test)

Example 35 with ILaunchConfiguration

use of org.eclipse.debug.core.ILaunchConfiguration in project linuxtools by eclipse.

the class DoubleClickTest method testDoubleClickFile.

@Test
public void testDoubleClickFile() throws Exception {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    // $NON-NLS-1$
    doLaunch(config, "testDoubleClickFile");
    doDoubleClick();
    IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    IEditorInput input = editor.getEditorInput();
    assertTrue("Input should be IFileEditorInput", input instanceof IFileEditorInput);
    IFileEditorInput fileInput = (IFileEditorInput) input;
    File expectedFile = new File(proj.getProject().getLocation().toOSString(), frame.getFile());
    File actualFile = fileInput.getFile().getLocation().toFile();
    assertEquals(expectedFile.getCanonicalPath(), actualFile.getCanonicalPath());
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) IFileEditorInput(org.eclipse.ui.IFileEditorInput) IEditorPart(org.eclipse.ui.IEditorPart) File(java.io.File) IEditorInput(org.eclipse.ui.IEditorInput) Test(org.junit.Test)

Aggregations

ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)266 CoreException (org.eclipse.core.runtime.CoreException)96 ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)76 Test (org.junit.Test)72 ILaunchConfigurationType (org.eclipse.debug.core.ILaunchConfigurationType)50 ILaunchManager (org.eclipse.debug.core.ILaunchManager)40 ArrayList (java.util.ArrayList)37 ILaunch (org.eclipse.debug.core.ILaunch)35 IProject (org.eclipse.core.resources.IProject)20 IPath (org.eclipse.core.runtime.IPath)20 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)16 IEditorPart (org.eclipse.ui.IEditorPart)15 IStatus (org.eclipse.core.runtime.IStatus)14 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)14 IFile (org.eclipse.core.resources.IFile)13 IProcess (org.eclipse.debug.core.model.IProcess)13 CachegrindViewPart (org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart)13 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)11 Shell (org.eclipse.swt.widgets.Shell)10 ElementListSelectionDialog (org.eclipse.ui.dialogs.ElementListSelectionDialog)10