You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2021/01/17 19:27:00 UTC
[directory-studio] branch master updated: Switch to Java 15 build
and stabilize UI tests
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 9b32cd5 Switch to Java 15 build and stabilize UI tests
9b32cd5 is described below
commit 9b32cd52f2933744c67eb63cd73f481d51cfdad2
Author: Stefan Seelmann <ma...@stefan-seelmann.de>
AuthorDate: Sun Jan 17 20:26:36 2021 +0100
Switch to Java 15 build and stabilize UI tests
---
Jenkinsfile | 4 ++--
.../directory/studio/test/integration/ui/bots/DialogBot.java | 8 +++++++-
.../studio/test/integration/ui/bots/ErrorDialogBot.java | 9 +++++++--
3 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index c8963cb..feb0d07 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -77,7 +77,7 @@ pipeline {
}
}
}
- stage ('Linux Java 14') {
+ stage ('Linux Java 15') {
options {
timeout(time: 4, unit: 'HOURS')
retry(2)
@@ -88,7 +88,7 @@ pipeline {
steps {
script {
docker.image('osixia/openldap:1.3.0').withRun() { openldap ->
- docker.image('apachedirectory/maven-build:jdk-14').inside("--link=${openldap.id}:openldap -e OPENLDAP_HOST=openldap -e OPENLDAP_PORT=389") {
+ docker.image('apachedirectory/maven-build:jdk-15').inside("--link=${openldap.id}:openldap -e OPENLDAP_HOST=openldap -e OPENLDAP_PORT=389") {
sh 'export DISPLAY=:99; mvn -V -U -f pom-first.xml clean install && mvn -V clean install -Dorg.eclipse.swtbot.search.timeout=20000 -Denable-ui-tests'
}
}
diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/DialogBot.java b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/DialogBot.java
index ef80d66..1d4715a 100644
--- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/DialogBot.java
+++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/DialogBot.java
@@ -20,6 +20,7 @@
package org.apache.directory.studio.test.integration.ui.bots;
+import org.apache.commons.lang3.StringUtils;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
@@ -126,7 +127,12 @@ public abstract class DialogBot
}, "Error", title );
String shellText = shell.getText();
- String labelText = bot.label( 1 ).getText(); // label(0) is the image
+ // label(0) may be the image
+ String labelText = bot.label( 0 ).getText();
+ if ( StringUtils.isBlank( labelText ) )
+ {
+ labelText = bot.label( 1 ).getText();
+ }
bot.button( "OK" ).click();
parentShell.activate();
diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ErrorDialogBot.java b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ErrorDialogBot.java
index 3933ac9..46b9cd7 100644
--- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ErrorDialogBot.java
+++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/bots/ErrorDialogBot.java
@@ -19,6 +19,7 @@
*/
package org.apache.directory.studio.test.integration.ui.bots;
+import org.apache.commons.lang3.StringUtils;
public class ErrorDialogBot extends DialogBot
{
@@ -37,13 +38,17 @@ public class ErrorDialogBot extends DialogBot
public String getErrorMessage()
{
- return bot.label( 1 ).getText();
+ // label(0) may be the image
+ int index = StringUtils.isBlank( bot.label( 0 ).getText() ) ? 1 : 0;
+ return bot.label( index ).getText();
}
public String getErrorDetails()
{
- return bot.label( 2 ).getText();
+ // label(0) may be the image
+ int index = StringUtils.isBlank( bot.label( 0 ).getText() ) ? 2 : 1;
+ return bot.label( index ).getText();
}
}