diff options
author | Stefan Seelmann <mail@stefan-seelmann.de> | 2021-06-20 16:56:28 +0300 |
---|---|---|
committer | Stefan Seelmann <mail@stefan-seelmann.de> | 2021-06-20 16:56:28 +0300 |
commit | f5a228cfc7c23fadbeaca600768f756311bc5ae6 (patch) | |
tree | 3cc7d2c0df16d5793c27de33b5f27594b197568c | |
parent | 18ad16e89deb2998ee0fef0f16a9a85a0df1ddd2 (diff) |
Close open shells/dialogs/wizards and fix an invalid thread access
2 files changed, 13 insertions, 2 deletions
diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/AbstractTestBase.java b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/AbstractTestBase.java index 7978ed9df..0fc749726 100644 --- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/AbstractTestBase.java +++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/AbstractTestBase.java @@ -44,6 +44,7 @@ import org.apache.directory.studio.test.integration.ui.bots.SearchLogsViewBot; import org.apache.directory.studio.test.integration.ui.bots.StudioBot; import org.apache.directory.studio.test.integration.ui.utils.Assertions; import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; +import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; import org.eclipse.swtbot.swt.finder.junit5.SWTBotJunit5Extension; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -74,8 +75,10 @@ public class AbstractTestBase searchLogsViewBot = studioBot.getSearchLogsViewBot(); modificationLogsViewBot = studioBot.getModificationLogsViewBot(); serversViewBot = studioBot.getApacheDSServersViewBot(); - BrowserCorePlugin.getDefault() - .getPluginPreferences().setValue( BrowserCoreConstants.PREFERENCE_LDIF_LINE_WIDTH, 1000 ); + UIThreadRunnable.syncExec( () -> { + BrowserCorePlugin.getDefault() + .getPluginPreferences().setValue( BrowserCoreConstants.PREFERENCE_LDIF_LINE_WIDTH, 1000 ); + } ); } diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java index f781dab12..ce9848b04 100644 --- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java +++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/StudioBot.java @@ -183,6 +183,14 @@ public class StudioBot } // close shells (open dialogs) + Shell[] shells = Display.getCurrent().getShells(); + for ( Shell shell : shells ) + { + if ( shell != null && shell != window.getShell() ) + { + shell.close(); + } + } Shell activeShell = Display.getCurrent().getActiveShell(); if ( activeShell != null && activeShell != window.getShell() ) { |