mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 06:45:43 +02:00
Fixes some callhierarchy-tests for use with platform 3.3rc3.
This commit is contained in:
parent
f5ed6d257d
commit
5bdf330f79
2 changed files with 15 additions and 2 deletions
|
@ -29,11 +29,13 @@ import org.eclipse.swt.widgets.Tree;
|
|||
import org.eclipse.swt.widgets.TreeItem;
|
||||
import org.eclipse.ui.IEditorPart;
|
||||
import org.eclipse.ui.IViewPart;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.IWorkbenchPartSite;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.PartInitException;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.WorkbenchException;
|
||||
import org.eclipse.ui.handlers.IHandlerService;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||
|
@ -44,6 +46,7 @@ import org.eclipse.cdt.core.model.CModelException;
|
|||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
|
||||
import org.eclipse.cdt.core.testplugin.util.TestSourceReader;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.cdt.ui.testplugin.CTestPlugin;
|
||||
|
||||
public class BaseUITestCase extends BaseTestCase {
|
||||
|
@ -187,6 +190,12 @@ public class BaseUITestCase extends BaseTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
protected void showCDTPerspective() throws WorkbenchException {
|
||||
final IWorkbench workbench = PlatformUI.getWorkbench();
|
||||
workbench.showPerspective(CUIPlugin.ID_CPERSPECTIVE, workbench.getActiveWorkbenchWindow());
|
||||
runEventQueue(0);
|
||||
}
|
||||
|
||||
protected IViewPart activateView(String id) throws PartInitException {
|
||||
IViewPart view= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(id);
|
||||
assertNotNull(view);
|
||||
|
|
|
@ -20,8 +20,8 @@ import org.eclipse.swt.widgets.Tree;
|
|||
import org.eclipse.ui.IPageLayout;
|
||||
import org.eclipse.ui.IViewPart;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.PartInitException;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.WorkbenchException;
|
||||
import org.eclipse.ui.ide.IDE;
|
||||
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
|
@ -40,6 +40,10 @@ public class CallHierarchyBugs extends CallHierarchyBaseTest {
|
|||
return suite(CallHierarchyBugs.class);
|
||||
}
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
showCDTPerspective();
|
||||
}
|
||||
|
||||
// class SomeClass {
|
||||
// public:
|
||||
|
@ -136,7 +140,7 @@ public class CallHierarchyBugs extends CallHierarchyBaseTest {
|
|||
checkTreeNode(chTree, 0, 0, "SomeClass::ref2");
|
||||
}
|
||||
|
||||
private void openEditor(IFile file) throws PartInitException {
|
||||
private void openEditor(IFile file) throws WorkbenchException {
|
||||
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
|
||||
IDE.openEditor(page, file, true);
|
||||
getFocusControl(StyledText.class, 8000);
|
||||
|
|
Loading…
Add table
Reference in a new issue