From commits-return-52618-archive-asf-public=cust-asf.ponee.io@directory.apache.org Sun Jun 20 13:56:43 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 7751118064A for ; Sun, 20 Jun 2021 15:56:43 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id DEFEF60070 for ; Sun, 20 Jun 2021 13:56:42 +0000 (UTC) Received: (qmail 96741 invoked by uid 500); 20 Jun 2021 13:56:42 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 96732 invoked by uid 99); 20 Jun 2021 13:56:42 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Jun 2021 13:56:42 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id D218A821E0; Sun, 20 Jun 2021 13:56:41 +0000 (UTC) Date: Sun, 20 Jun 2021 13:56:41 +0000 To: "commits@directory.apache.org" Subject: [directory-studio] branch master updated: Close open shells/dialogs/wizards and fix an invalid thread access MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <162419740178.21753.7501507848152473997@gitbox.apache.org> From: seelmann@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: directory-studio X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 18ad16e89deb2998ee0fef0f16a9a85a0df1ddd2 X-Git-Newrev: f5a228cfc7c23fadbeaca600768f756311bc5ae6 X-Git-Rev: f5a228cfc7c23fadbeaca600768f756311bc5ae6 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. seelmann pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/directory-studio.git The following commit(s) were added to refs/heads/master by this push: new f5a228c Close open shells/dialogs/wizards and fix an invalid thread access f5a228c is described below commit f5a228cfc7c23fadbeaca600768f756311bc5ae6 Author: Stefan Seelmann AuthorDate: Sun Jun 20 15:56:28 2021 +0200 Close open shells/dialogs/wizards and fix an invalid thread access --- .../directory/studio/test/integration/ui/AbstractTestBase.java | 7 +++++-- .../directory/studio/test/integration/ui/bots/StudioBot.java | 8 ++++++++ 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 7978ed9..0fc7497 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 f781dab..ce9848b 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() ) {