forked from eclipse-platform/eclipse.platform.ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix faulty test name access in FindReplaceDialogTest utilities
The DialogAccess class used for FindReplaceDialogTest currently tried to access the test name via a test rule, but since it is not a test class, that one is not assigned correctly. This change moves the functionality depending on the test information to an actual test class and also moves the runEventQueue() utility method to a proper utility class.
- Loading branch information
1 parent
51d6f45
commit f44acf3
Showing
5 changed files
with
65 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...h.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/FindReplaceTestUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Vector Informatik GmbH and others. | ||
* | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.ui.workbench.texteditor.tests; | ||
|
||
import org.eclipse.swt.widgets.Display; | ||
|
||
import org.eclipse.ui.PlatformUI; | ||
|
||
public final class FindReplaceTestUtil { | ||
|
||
private FindReplaceTestUtil() { | ||
} | ||
|
||
public static void runEventQueue() { | ||
Display display= PlatformUI.getWorkbench().getDisplay(); | ||
for (int i= 0; i < 10; i++) { // workaround for https://bugs.eclipse.org/323272 | ||
while (display.readAndDispatch()) { | ||
// do nothing | ||
} | ||
try { | ||
Thread.sleep(50); | ||
} catch (InterruptedException e) { | ||
// do nothing | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters