diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportExistingArchiveProjectFilterTest.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportExistingArchiveProjectFilterTest.java index 1aff6631812..5132ead15f5 100644 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportExistingArchiveProjectFilterTest.java +++ b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ImportExistingArchiveProjectFilterTest.java @@ -40,13 +40,13 @@ import org.eclipse.ui.IPageLayout; import org.eclipse.ui.IViewPart; import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PlatformUI; import org.eclipse.ui.internal.WorkbenchPlugin; import org.eclipse.ui.internal.dialogs.ImportExportWizard; import org.eclipse.ui.internal.wizards.datatransfer.WizardProjectsImportPage; import org.eclipse.ui.internal.wizards.datatransfer.WizardProjectsImportPage.ProjectRecord; import org.eclipse.ui.navigator.resources.ProjectExplorer; import org.eclipse.ui.tests.TestPlugin; -import org.eclipse.ui.tests.harness.util.DialogCheck; import org.eclipse.ui.tests.harness.util.EmptyPerspective; import org.eclipse.ui.tests.harness.util.FileUtil; import org.eclipse.ui.tests.harness.util.UITestCase; @@ -66,6 +66,10 @@ public ImportExistingArchiveProjectFilterTest() { @Override protected void doTearDown() throws Exception { + if (dialog != null) { + dialog.close(); + dialog = null; + } IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot(); IProject[] projects = wsRoot.getProjects(); for (int i = projects.length - 1; i >= 0; i--) { @@ -158,6 +162,7 @@ private void processElementAndChildren(Object element, ITreeContentProvider cont } } + private WizardDialog dialog; public WizardProjectsImportPage getNewWizard() { ImportExportWizard wizard = new ImportExportWizard(ImportExportWizard.IMPORT); wizard.init(getWorkbench(), null); @@ -173,7 +178,10 @@ public WizardProjectsImportPage getNewWizard() { Shell shell = getShell(); - WizardDialog dialog = new WizardDialog(shell, wizard); + if (dialog != null) { + dialog.close(); + } + dialog = new WizardDialog(shell, wizard); dialog.create(); dialog.getShell().setSize(Math.max(100, dialog.getShell().getSize().x), 100); @@ -185,6 +193,6 @@ public WizardProjectsImportPage getNewWizard() { } private Shell getShell() { - return DialogCheck.getShell(); + return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); } }