diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/DefDeclTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/DefDeclTests.java index 2424d17ddff..2a01c0eb8b0 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/DefDeclTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/DefDeclTests.java @@ -13,9 +13,11 @@ package org.eclipse.cdt.internal.pdom.tests; import java.io.File; import java.util.regex.Pattern; + import junit.framework.Assert; import junit.framework.AssertionFailedError; import junit.framework.Test; + import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.dom.IName; import org.eclipse.cdt.core.dom.ast.IASTFileLocation; @@ -29,7 +31,6 @@ import org.eclipse.core.filebuffers.FileBuffers; import org.eclipse.core.filebuffers.ITextFileBuffer; import org.eclipse.core.filebuffers.ITextFileBufferManager; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; import org.eclipse.jface.text.BadLocationException; @@ -42,8 +43,6 @@ import org.eclipse.jface.text.BadLocationException; * */ public class DefDeclTests extends PDOMTestBase { - static IPath rootPath = new Path("resources/pdomtests"); - private String projectName = null; protected PDOM pdom; @@ -122,27 +121,6 @@ public class DefDeclTests extends PDOMTestBase { } } - private IName getReference(IBinding binding, int k) throws CoreException { - return getFirstUsage(binding, k, IIndex.FIND_REFERENCES); - } - - private IName getDefinition(IBinding binding, int k) throws CoreException { - return getFirstUsage(binding, k, IIndex.FIND_DEFINITIONS); - } - - /** - * Get declaration. If k>0 check that there are k of them. - * - * @param binding - * @param k - - * number of declarations, if k==-1 no check - * @return first declaration or null of non - * @throws CoreException - */ - private IName getDeclaration(IBinding binding, int k) throws CoreException { - return getFirstUsage(binding, k, IIndex.FIND_DECLARATIONS); - } - /** * Get references defined by flags. If k>0 check that there are k of them. * diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/CallHierarchyBaseTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/CallHierarchyBaseTest.java index 6d09d8f24c7..fe0f3d32ce0 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/CallHierarchyBaseTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/callhierarchy/CallHierarchyBaseTest.java @@ -66,7 +66,7 @@ public class CallHierarchyBaseTest extends BaseUITestCase { protected void openCallHierarchy(CEditor editor) { CallHierarchyUI.setIsJUnitTest(true); CallHierarchyUI.open(editor, (ITextSelection) editor.getSelectionProvider().getSelection()); - runEventQueue(0); + runEventQueue(200); } protected Tree getCHTree(IWorkbenchPage page) { diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java index 88a488dde8e..1b834b6a73e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java @@ -96,38 +96,25 @@ public class CallHierarchyUI { final IEditorInput editorInput = editor.getEditorInput(); final Display display= Display.getCurrent(); - if (!sIsJUnitTest) { - Job job= new Job(CHMessages.CallHierarchyUI_label) { - protected IStatus run(IProgressMonitor monitor) { - try { - final ICElement[] elems= findDefinitions(project, editorInput, sel); - if (elems != null && elems.length > 0) { - display.asyncExec(new Runnable() { - public void run() { - openInViewPart(editor.getSite().getWorkbenchWindow(), elems); - }}); - } - return Status.OK_STATUS; - } - catch (CoreException e) { - return e.getStatus(); + Job job= new Job(CHMessages.CallHierarchyUI_label) { + protected IStatus run(IProgressMonitor monitor) { + try { + final ICElement[] elems= findDefinitions(project, editorInput, sel); + if (elems != null && elems.length > 0) { + display.asyncExec(new Runnable() { + public void run() { + openInViewPart(editor.getSite().getWorkbenchWindow(), elems); + }}); } + return Status.OK_STATUS; + } + catch (CoreException e) { + return e.getStatus(); } - }; - job.setUser(true); - job.schedule(); - } - else { - ICElement[] elems; - try { - elems = findDefinitions(project, editorInput, sel); - if (elems != null && elems.length > 0) { - openInViewPart(editor.getSite().getWorkbenchWindow(), elems); - } - } catch (CoreException e) { - CUIPlugin.getDefault().log(e); } - } + }; + job.setUser(true); + job.schedule(); } }