Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Tasse2019-06-18 16:41:02 -0400
committerPatrick Tasse2019-06-19 11:00:28 -0400
commite773a2fc0a1b05678efa38b6e9a70564dc13a1d5 (patch)
treea64a6196c0acce05fcf0e3afb5cc4d9d95059e0a
parent127c3293fb1d8da7d1c68a48114160775a128faf (diff)
downloadorg.eclipse.tracecompass-e773a2fc0a1b05678efa38b6e9a70564dc13a1d5.tar.gz
org.eclipse.tracecompass-e773a2fc0a1b05678efa38b6e9a70564dc13a1d5.tar.xz
org.eclipse.tracecompass-e773a2fc0a1b05678efa38b6e9a70564dc13a1d5.zip
swtbot: Fix ConditionHelpers
Rename some static methods to start with a lower-case letter. Fix viewIsClosed() to check that the view is closed, instead of checking that the view is not active. Rename viewIsOpened() to viewIsActive(), which is what the condition checks. It is not possible to get a SWTBotView for a view that is not open. Add failure message for viewIsClosed() and viewIsActive(). Fix Javadoc @return tag for methods that return a condition. Change-Id: I02103c4ede05a92ae30e43f54f13928e3120af6d Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com> Reviewed-on: https://git.eclipse.org/r/144397 Tested-by: CI Bot Reviewed-by: Simon Delisle <simon.delisle@ericsson.com> Tested-by: Simon Delisle <simon.delisle@ericsson.com>
-rw-r--r--ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ctf/ui/swtbot/tests/AbstractImportAndReadSmokeTest.java4
-rw-r--r--lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewAllEventsTest.java2
-rw-r--r--lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewExcludeEventsTest.java2
-rw-r--r--lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewKernelFilterTest.java4
-rw-r--r--lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewLoggerTest.java8
-rw-r--r--lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewProfileTest.java2
-rw-r--r--lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewSpecificEventTest.java4
-rw-r--r--lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewTest.java12
-rw-r--r--releng/org.eclipse.tracecompass.integration.swtbot.tests/src/org/eclipse/tracecompass/integration/swtbot/tests/projectexplorer/ProjectExplorerTraceActionsTest.java10
-rw-r--r--tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/ui/swtbot/tests/preferences/XMLAnalysesManagerPreferencePageTest.java2
-rw-r--r--tmf/org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/remote/ui/swtbot/tests/fetch/FetchRemoteTracesTest.java4
-rw-r--r--tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/ConditionHelpers.java62
-rw-r--r--tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java12
-rw-r--r--tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/tracetype/preferences/TraceTypePreferencePageTest.java2
-rw-r--r--tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/FontEventEditorTest.java4
-rw-r--r--tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/views/TimeGraphViewTest.java2
-rw-r--r--tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/views/XYChartViewTest.java2
17 files changed, 84 insertions, 54 deletions
diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ctf/ui/swtbot/tests/AbstractImportAndReadSmokeTest.java b/ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ctf/ui/swtbot/tests/AbstractImportAndReadSmokeTest.java
index cc4a81b07f..f51ad56c85 100644
--- a/ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ctf/ui/swtbot/tests/AbstractImportAndReadSmokeTest.java
+++ b/ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ctf/ui/swtbot/tests/AbstractImportAndReadSmokeTest.java
@@ -124,12 +124,12 @@ public abstract class AbstractImportAndReadSmokeTest {
SWTBotTree tree = fBot.tree();
assertNotNull(tree);
final String tracingKey = "Tracing";
- fBot.waitUntil(ConditionHelpers.IsTreeNodeAvailable(tracingKey, tree));
+ fBot.waitUntil(ConditionHelpers.isTreeNodeAvailable(tracingKey, tree));
final SWTBotTreeItem tracingNode = tree.expandNode(tracingKey);
tracingNode.select();
final String projectKey = "Tracing Project";
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(projectKey, tracingNode));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(projectKey, tracingNode));
final SWTBotTreeItem tracingProject = tracingNode.getNode(projectKey);
assertNotNull(tracingProject);
diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewAllEventsTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewAllEventsTest.java
index 3e604a5d91..1ea866f87e 100644
--- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewAllEventsTest.java
+++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewAllEventsTest.java
@@ -84,7 +84,7 @@ public class ControlViewAllEventsTest extends ControlViewTest {
shell.bot().button(ControlViewSwtBotUtil.DIALOG_OK_BUTTON).click();
WaitUtils.waitForJobs();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME, sessionItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME, sessionItem));
SWTBotTreeItem channelItem = SWTBotUtils.getTreeItem(fBot, fTree,
getNodeName(),
diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewExcludeEventsTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewExcludeEventsTest.java
index 6b14540429..cb8ac7771d 100644
--- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewExcludeEventsTest.java
+++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewExcludeEventsTest.java
@@ -120,7 +120,7 @@ public class ControlViewExcludeEventsTest extends ControlViewTest {
shell.bot().button(ControlViewSwtBotUtil.DIALOG_OK_BUTTON).click();
WaitUtils.waitForJobs();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(ControlViewSwtBotUtil.UST_DOMAIN_NAME, sessionItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(ControlViewSwtBotUtil.UST_DOMAIN_NAME, sessionItem));
// Assert that the domain is UST global
SWTBotTreeItem ustGlobalDomainItem = SWTBotUtils.getTreeItem(fBot, fTree,
diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewKernelFilterTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewKernelFilterTest.java
index 697854e524..57b7ab376f 100644
--- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewKernelFilterTest.java
+++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewKernelFilterTest.java
@@ -120,7 +120,7 @@ public class ControlViewKernelFilterTest extends ControlViewTest {
shell.bot().button(ControlViewSwtBotUtil.DIALOG_OK_BUTTON).click();
WaitUtils.waitForJobs();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME, sessionItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME, sessionItem));
SWTBotTreeItem kernelDomainItem = SWTBotUtils.getTreeItem(fBot, fTree,
getNodeName(),
@@ -182,7 +182,7 @@ public class ControlViewKernelFilterTest extends ControlViewTest {
ControlViewSwtBotUtil.SESSION_GROUP_NAME,
getSessionName());
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME, sessionItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME, sessionItem));
SWTBotTreeItem kernelDomainItem = SWTBotUtils.getTreeItem(fBot, fTree,
getNodeName(),
diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewLoggerTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewLoggerTest.java
index 2844f87d65..f6d0fdb914 100644
--- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewLoggerTest.java
+++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewLoggerTest.java
@@ -145,7 +145,7 @@ public class ControlViewLoggerTest extends ControlViewTest {
// Click the Ok at the bottom of the dialog window
shell.bot().button(ControlViewSwtBotUtil.DIALOG_OK_BUTTON).click();
WaitUtils.waitForJobs();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(domainName, sessionItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(domainName, sessionItem));
// Assert that the domain is correct
SWTBotTreeItem domainItem = SWTBotUtils.getTreeItem(fBot, fTree,
@@ -185,7 +185,7 @@ public class ControlViewLoggerTest extends ControlViewTest {
// Click the Ok at the bottom of the dialog window
shell.bot().button(ControlViewSwtBotUtil.DIALOG_OK_BUTTON).click();
WaitUtils.waitForJobs();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(domainName, sessionItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(domainName, sessionItem));
// Assert that the domain is correct
domainItem = SWTBotUtils.getTreeItem(fBot, fTree,
@@ -224,7 +224,7 @@ public class ControlViewLoggerTest extends ControlViewTest {
// Click the Ok at the bottom of the dialog window
shell.bot().button(ControlViewSwtBotUtil.DIALOG_OK_BUTTON).click();
WaitUtils.waitForJobs();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(domainName, sessionItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(domainName, sessionItem));
// Assert that the domain is correct
domainItem = SWTBotUtils.getTreeItem(fBot, fTree,
@@ -255,7 +255,7 @@ public class ControlViewLoggerTest extends ControlViewTest {
// Click the Ok at the bottom of the dialog window
shell.bot().button(ControlViewSwtBotUtil.DIALOG_OK_BUTTON).click();
WaitUtils.waitForJobs();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(domainName, sessionItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(domainName, sessionItem));
// Assert that the domain is correct
domainItem = SWTBotUtils.getTreeItem(fBot, fTree,
diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewProfileTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewProfileTest.java
index 86d6d2b093..5feaf3a345 100644
--- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewProfileTest.java
+++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewProfileTest.java
@@ -126,7 +126,7 @@ public class ControlViewProfileTest extends ControlViewTest {
sessionGroupItem = SWTBotUtils.getTreeItem(fBot, fTree,
getNodeName(), ControlViewSwtBotUtil.SESSION_GROUP_NAME);
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(SESSION_NAME, sessionGroupItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(SESSION_NAME, sessionGroupItem));
assertEquals(1, sessionGroupItem.getNodes().size());
}
diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewSpecificEventTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewSpecificEventTest.java
index ddd4056793..77e0205e0f 100644
--- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewSpecificEventTest.java
+++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewSpecificEventTest.java
@@ -157,7 +157,7 @@ public class ControlViewSpecificEventTest extends ControlViewTest {
WaitUtils.waitForJobs();
// Wait until the child of Sessions is activated
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME, sessionItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME, sessionItem));
// Assert that the new channel name is channel0 (which is the default name)
SWTBotTreeItem channelItem = SWTBotUtils.getTreeItem(fBot, fTree,
@@ -176,7 +176,7 @@ public class ControlViewSpecificEventTest extends ControlViewTest {
if (event.equals(ControlViewSwtBotUtil.ALL_TREE_NODE)) {
eventName = ControlViewSwtBotUtil.ALL_EVENTS_NAME;
}
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(eventName, channelItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(eventName, channelItem));
// Assert that the event type in the channel node are correct
SWTBotTreeItem eventItem = SWTBotUtils.getTreeItem(fBot, fTree,
getNodeName(),
diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewTest.java
index a49e843bab..fcc4cf0330 100644
--- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewTest.java
+++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/control/ui/swtbot/tests/ControlViewTest.java
@@ -255,7 +255,7 @@ public class ControlViewTest {
SWTBotMenu menuBot = nodeItem.contextMenu(ControlViewSwtBotUtil.CONNECT_MENU_ITEM);
menuBot.click();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(ControlViewSwtBotUtil.SESSION_GROUP_NAME, nodeItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(ControlViewSwtBotUtil.SESSION_GROUP_NAME, nodeItem));
// Verify that node is connected
fBot.waitUntil(ControlViewSwtBotUtil.isStateChanged(fNode, TargetNodeState.CONNECTED));
@@ -286,7 +286,7 @@ public class ControlViewTest {
sessionGroupItem.expand();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(getSessionName(), sessionGroupItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(getSessionName(), sessionGroupItem));
assertEquals(1, sessionGroupItem.getNodes().size());
SWTBotTreeItem sessionItem = SWTBotUtils.getTreeItem(fBot, fTree,
@@ -319,7 +319,7 @@ public class ControlViewTest {
shell.bot().button(ControlViewSwtBotUtil.DIALOG_OK_BUTTON).click();
WaitUtils.waitForJobs();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME, sessionItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME, sessionItem));
SWTBotTreeItem channelItem = SWTBotUtils.getTreeItem(fBot, fTree,
getNodeName(),
@@ -369,7 +369,7 @@ public class ControlViewTest {
shell.bot().button(ControlViewSwtBotUtil.DIALOG_OK_BUTTON).click();
WaitUtils.waitForJobs();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME, sessionItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME, sessionItem));
SWTBotTreeItem kernelDomainItem = SWTBotUtils.getTreeItem(fBot, fTree,
getNodeName(),
@@ -417,7 +417,7 @@ public class ControlViewTest {
shell.bot().button(ControlViewSwtBotUtil.DIALOG_OK_BUTTON).click();
WaitUtils.waitForJobs();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME, sessionItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(ControlViewSwtBotUtil.KERNEL_DOMAIN_NAME, sessionItem));
kernelDomainItem = SWTBotUtils.getTreeItem(fBot, fTree,
getNodeName(),
@@ -482,7 +482,7 @@ public class ControlViewTest {
shell.bot().radioInGroup(ControlViewSwtBotUtil.BUFFERTYPE_PER_UID, ControlViewSwtBotUtil.BUFFERTYPE_GROUP_NAME).click();
shell.bot().button(ControlViewSwtBotUtil.DIALOG_OK_BUTTON).click();
WaitUtils.waitForJobs();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(ControlViewSwtBotUtil.UST_DOMAIN_NAME, sessionItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(ControlViewSwtBotUtil.UST_DOMAIN_NAME, sessionItem));
}
/**
diff --git a/releng/org.eclipse.tracecompass.integration.swtbot.tests/src/org/eclipse/tracecompass/integration/swtbot/tests/projectexplorer/ProjectExplorerTraceActionsTest.java b/releng/org.eclipse.tracecompass.integration.swtbot.tests/src/org/eclipse/tracecompass/integration/swtbot/tests/projectexplorer/ProjectExplorerTraceActionsTest.java
index b94beef468..152a573486 100644
--- a/releng/org.eclipse.tracecompass.integration.swtbot.tests/src/org/eclipse/tracecompass/integration/swtbot/tests/projectexplorer/ProjectExplorerTraceActionsTest.java
+++ b/releng/org.eclipse.tracecompass.integration.swtbot.tests/src/org/eclipse/tracecompass/integration/swtbot/tests/projectexplorer/ProjectExplorerTraceActionsTest.java
@@ -428,7 +428,7 @@ public class ProjectExplorerTraceActionsTest {
fBot.waitUntil(new ConditionHelpers.ActiveEventsEditor(fBot, "Experiment"));
SWTBotTreeItem experimentsItem = SWTBotUtils.getTraceProjectItem(fBot, SWTBotUtils.selectProject(fBot, TRACE_PROJECT_NAME), "Experiments");
experimentsItem.expand();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable("Experiment [2]", experimentsItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable("Experiment [2]", experimentsItem));
SWTBotTreeItem expItem = SWTBotUtils.getTraceProjectItem(fBot, experimentsItem, "Experiment");
@@ -466,7 +466,7 @@ public class ProjectExplorerTraceActionsTest {
fBot.viewByTitle(PROJECT_EXPLORER_VIEW_NAME).setFocus();
SWTBotTreeItem experimentsItem = SWTBotUtils.getTraceProjectItem(fBot, SWTBotUtils.selectProject(fBot, TRACE_PROJECT_NAME), "Experiments");
experimentsItem.expand();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable("ExampleCustomTxt.log [1]", experimentsItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable("ExampleCustomTxt.log [1]", experimentsItem));
SWTBotTreeItem expItem = SWTBotUtils.getTraceProjectItem(fBot, experimentsItem, "ExampleCustomTxt.log [1]");
expItem.expand();
SWTBotTreeItem expTrace = expItem.getNode(TRACE_NAME);
@@ -505,7 +505,7 @@ public class ProjectExplorerTraceActionsTest {
fBot.viewByTitle(PROJECT_EXPLORER_VIEW_NAME).setFocus();
SWTBotTreeItem experimentsItem = SWTBotUtils.getTraceProjectItem(fBot, SWTBotUtils.selectProject(fBot, TRACE_PROJECT_NAME), "Experiments");
experimentsItem.expand();
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable("ExampleCustomTxt.log [1]", experimentsItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable("ExampleCustomTxt.log [1]", experimentsItem));
SWTBotTreeItem expItem = SWTBotUtils.getTraceProjectItem(fBot, experimentsItem, "ExampleCustomTxt.log [1]");
expItem.expand();
SWTBotTreeItem expTrace = expItem.getNode(TRACE_NAME);
@@ -701,11 +701,11 @@ public class ProjectExplorerTraceActionsTest {
private static void testLinkStatus(SWTBotTreeItem traceItem, boolean isLinked) {
SWTBotView viewBot = fBot.viewByTitle(PROPERTIES_VIEW_NAME);
viewBot.show();
- fBot.waitUntil(ConditionHelpers.viewIsOpened(viewBot));
+ fBot.waitUntil(ConditionHelpers.viewIsActive(viewBot));
traceItem.select();
SWTBotTree tree = viewBot.bot().tree();
SWTBotTreeItem resourcePropertiesItem = tree.getTreeItem(RESOURCE_PROPERTIES_ITEM_NAME);
- fBot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(LINKED_ITEM_NAME, resourcePropertiesItem));
+ fBot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(LINKED_ITEM_NAME, resourcePropertiesItem));
SWTBotTreeItem linkedNode = resourcePropertiesItem.getNode(LINKED_ITEM_NAME);
String linkedValue = linkedNode.cell(1);
assertEquals(Boolean.toString(isLinked), linkedValue);
diff --git a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/ui/swtbot/tests/preferences/XMLAnalysesManagerPreferencePageTest.java b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/ui/swtbot/tests/preferences/XMLAnalysesManagerPreferencePageTest.java
index 4a227110cd..15d482b311 100644
--- a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/ui/swtbot/tests/preferences/XMLAnalysesManagerPreferencePageTest.java
+++ b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/ui/swtbot/tests/preferences/XMLAnalysesManagerPreferencePageTest.java
@@ -407,7 +407,7 @@ public class XMLAnalysesManagerPreferencePageTest {
SWTBotTreeItem treeNode = tree.getTreeItem("Tracing");
treeNode.select();
treeNode.expand();
- bot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable("XML Analyses", treeNode));
+ bot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable("XML Analyses", treeNode));
treeNode = treeNode.getNode("XML Analyses");
treeNode.select();
return preferencesShell;
diff --git a/tmf/org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/remote/ui/swtbot/tests/fetch/FetchRemoteTracesTest.java b/tmf/org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/remote/ui/swtbot/tests/fetch/FetchRemoteTracesTest.java
index ae5a035a55..44283a264e 100644
--- a/tmf/org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/remote/ui/swtbot/tests/fetch/FetchRemoteTracesTest.java
+++ b/tmf/org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/remote/ui/swtbot/tests/fetch/FetchRemoteTracesTest.java
@@ -979,7 +979,7 @@ public class FetchRemoteTracesTest {
SWTBotTreeItem currentNode = tree.getTreeItem(nodeNames[0]);
for (int i = 1; i < nodeNames.length; i++) {
String nodeName = nodeNames[i];
- bot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(nodeName, currentNode));
+ bot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(nodeName, currentNode));
SWTBotTreeItem newNode = currentNode.getNode(nodeName);
currentNode = newNode;
}
@@ -996,7 +996,7 @@ public class FetchRemoteTracesTest {
SWTBotTreeItem treeNode = tree.getTreeItem("Tracing");
treeNode.select();
treeNode.expand();
- bot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable("Remote Profiles", treeNode));
+ bot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable("Remote Profiles", treeNode));
treeNode = treeNode.getNode("Remote Profiles");
treeNode.select();
}
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/ConditionHelpers.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/ConditionHelpers.java
index 4a481a00fe..394075c91e 100644
--- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/ConditionHelpers.java
+++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/ConditionHelpers.java
@@ -33,6 +33,7 @@ import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.results.BoolResult;
import org.eclipse.swtbot.swt.finder.results.Result;
import org.eclipse.swtbot.swt.finder.utils.TableCollection;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
@@ -49,6 +50,9 @@ import org.eclipse.tracecompass.tmf.ui.editors.TmfEventsEditor;
import org.eclipse.tracecompass.tmf.ui.viewers.xycharts.TmfXYChartViewer;
import org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView;
import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
import org.hamcrest.Matcher;
import org.swtchart.Chart;
@@ -86,9 +90,9 @@ public final class ConditionHelpers {
* the name of the node
* @param tree
* the parent tree
- * @return true or false, it should swallow all exceptions
+ * @return ICondition for verification
*/
- public static ICondition IsTreeNodeAvailable(final String name, final SWTBotTree tree) {
+ public static ICondition isTreeNodeAvailable(final String name, final SWTBotTree tree) {
return new SWTBotTestCondition() {
@Override
public boolean test() throws Exception {
@@ -120,7 +124,7 @@ public final class ConditionHelpers {
* the name of the item
* @param table
* the parent table
- * @return true or false, it should swallow all exceptions
+ * @return ICondition for verification
*/
public static ICondition isTableItemAvailable(final String name, final SWTBotTable table) {
return new SWTBotTestCondition() {
@@ -147,9 +151,9 @@ public final class ConditionHelpers {
* the name of the node
* @param treeItem
* the treeItem
- * @return true or false, it should swallow all exceptions
+ * @return ICondition for verification
*/
- public static ICondition IsTreeChildNodeAvailable(final String name, final SWTBotTreeItem treeItem) {
+ public static ICondition isTreeChildNodeAvailable(final String name, final SWTBotTreeItem treeItem) {
return new SWTBotTestCondition() {
@Override
public boolean test() throws Exception {
@@ -175,7 +179,7 @@ public final class ConditionHelpers {
* length of the node after removal
* @param treeItem
* the treeItem
- * @return true or false, it should swallow all exceptions
+ * @return ICondition for verification
*/
public static ICondition isTreeChildNodeRemoved(final int length, final SWTBotTreeItem treeItem) {
return new SWTBotTestCondition() {
@@ -226,7 +230,7 @@ public final class ConditionHelpers {
*
* @param wizard
* the null
- * @return false if either are null
+ * @return ICondition for verification
*/
public static ICondition isWizardReady(final Wizard wizard) {
return new SWTBotTestCondition() {
@@ -247,7 +251,7 @@ public final class ConditionHelpers {
* wizard
* @param page
* the desired page
- * @return true or false
+ * @return ICondition for verification
*/
public static ICondition isWizardOnPage(final Wizard wizard, final IWizardPage page) {
return new SWTBotTestCondition() {
@@ -267,34 +271,60 @@ public final class ConditionHelpers {
}
/**
- * Wait for a view to close
+ * Condition to wait for a view to close
*
* @param view
- * bot view for the view
- * @return true if the view is closed, false if it's active.
+ * view bot for the view
+ * @return ICondition for verification
*/
- public static ICondition ViewIsClosed(final SWTBotView view) {
+ public static ICondition viewIsClosed(final SWTBotView view) {
return new SWTBotTestCondition() {
@Override
public boolean test() throws Exception {
- return (view != null) && (!view.isActive());
+ return UIThreadRunnable.syncExec(new BoolResult() {
+ @Override
+ public Boolean run() {
+ if (!PlatformUI.isWorkbenchRunning()) {
+ return true;
+ }
+ IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (workbenchWindow == null) {
+ return true;
+ }
+ IWorkbenchPage activePage = workbenchWindow.getActivePage();
+ if (activePage == null) {
+ return true;
+ }
+ return !Arrays.asList(activePage.getViewReferences()).contains(view.getReference());
+ }
+ });
+ }
+
+ @Override
+ public String getFailureMessage() {
+ return view.getTitle() + " view did not close";
}
};
}
/**
- * Wait for a view to open
+ * Condition to wait for a view to become active
*
* @param view
* bot view for the view
- * @return true if the view is open, false otherwise
+ * @return ICondition for verification
*/
- public static ICondition viewIsOpened(final SWTBotView view) {
+ public static ICondition viewIsActive(final SWTBotView view) {
return new SWTBotTestCondition() {
@Override
public boolean test() throws Exception {
return (view != null) && (view.isActive());
}
+
+ @Override
+ public String getFailureMessage() {
+ return view.getTitle() + " view did not become active";
+ }
};
}
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java
index 2ccdaf8c66..e315943257 100644
--- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java
+++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/shared/org/eclipse/tracecompass/tmf/ui/swtbot/tests/shared/SWTBotUtils.java
@@ -366,7 +366,7 @@ public final class SWTBotUtils {
for (SWTBotView view : openViews) {
if (view.getTitle().equalsIgnoreCase(title)) {
view.close();
- bot.waitUntil(ConditionHelpers.ViewIsClosed(view));
+ bot.waitUntil(ConditionHelpers.viewIsClosed(view));
}
}
}
@@ -383,7 +383,7 @@ public final class SWTBotUtils {
public static void closeViewById(String viewId, SWTWorkbenchBot bot) {
final SWTBotView view = bot.viewById(viewId);
view.close();
- bot.waitUntil(ConditionHelpers.ViewIsClosed(view));
+ bot.waitUntil(ConditionHelpers.viewIsClosed(view));
}
/**
@@ -612,7 +612,7 @@ public final class SWTBotUtils {
SWTBot projectExplorerBot = projectExplorerView.bot();
final SWTBotTree tree = projectExplorerBot.tree();
- projectExplorerBot.waitUntil(ConditionHelpers.IsTreeNodeAvailable(projectName, tree));
+ projectExplorerBot.waitUntil(ConditionHelpers.isTreeNodeAvailable(projectName, tree));
final SWTBotTreeItem treeItem = tree.getTreeItem(projectName);
treeItem.expand();
@@ -939,7 +939,7 @@ public final class SWTBotUtils {
return null;
}
- bot.waitUntil(ConditionHelpers.IsTreeNodeAvailable(nodeNames[0], tree));
+ bot.waitUntil(ConditionHelpers.isTreeNodeAvailable(nodeNames[0], tree));
SWTBotTreeItem currentNode = tree.getTreeItem(nodeNames[0]);
return getTreeItem(bot, currentNode, Arrays.copyOfRange(nodeNames, 1, nodeNames.length));
}
@@ -968,13 +968,13 @@ public final class SWTBotUtils {
String nodeName = nodeNames[i];
try {
- bot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(nodeName, currentNode));
+ bot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(nodeName, currentNode));
} catch (TimeoutException e) {
// FIXME: Sometimes in a JFace TreeViewer, it expands to
// nothing. Need to find out why.
currentNode.collapse();
currentNode.expand();
- bot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable(nodeName, currentNode));
+ bot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable(nodeName, currentNode));
}
SWTBotTreeItem newNode = currentNode.getNode(nodeName);
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/tracetype/preferences/TraceTypePreferencePageTest.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/tracetype/preferences/TraceTypePreferencePageTest.java
index 7aba1981f7..045e43b4ca 100644
--- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/tracetype/preferences/TraceTypePreferencePageTest.java
+++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/tracetype/preferences/TraceTypePreferencePageTest.java
@@ -331,7 +331,7 @@ public class TraceTypePreferencePageTest {
SWTBotTreeItem treeNode = tree.getTreeItem("Tracing");
treeNode.select();
treeNode.expand();
- bot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable("Trace Types", treeNode));
+ bot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable("Trace Types", treeNode));
treeNode = treeNode.getNode("Trace Types");
treeNode.select();
return preferencesShell;
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/FontEventEditorTest.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/FontEventEditorTest.java
index d0f047af84..4734756ce9 100644
--- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/FontEventEditorTest.java
+++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/FontEventEditorTest.java
@@ -137,11 +137,11 @@ public class FontEventEditorTest {
SWTBotTreeItem generalItem = bot.tree().getTreeItem("General");
generalItem.click();
generalItem.select();
- bot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable("Appearance", generalItem));
+ bot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable("Appearance", generalItem));
SWTBotTreeItem appearanceNode = generalItem.getNode("Appearance");
appearanceNode.click();
appearanceNode.select();
- bot.waitUntil(ConditionHelpers.IsTreeChildNodeAvailable("Colors and Fonts", appearanceNode));
+ bot.waitUntil(ConditionHelpers.isTreeChildNodeAvailable("Colors and Fonts", appearanceNode));
SWTBotTreeItem colorAndFontNode = appearanceNode.getNode("Colors and Fonts");
colorAndFontNode.click();
colorAndFontNode.select();
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/views/TimeGraphViewTest.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/views/TimeGraphViewTest.java
index 59a64b5958..940cb608c1 100644
--- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/views/TimeGraphViewTest.java
+++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/views/TimeGraphViewTest.java
@@ -318,7 +318,7 @@ public class TimeGraphViewTest {
TmfSignalManager.dispatchSignal(new TmfTraceClosedSignal(this, trace));
fBot.waitUntil(Conditions.shellCloses(legendShell));
fViewBot.close();
- fBot.waitUntil(ConditionHelpers.ViewIsClosed(fViewBot));
+ fBot.waitUntil(ConditionHelpers.viewIsClosed(fViewBot));
fTrace.dispose();
}
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/views/XYChartViewTest.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/views/XYChartViewTest.java
index 74bf07007f..f1cca8aed9 100644
--- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/views/XYChartViewTest.java
+++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/views/XYChartViewTest.java
@@ -153,7 +153,7 @@ public class XYChartViewTest {
assertNotNull(trace);
UIThreadRunnable.syncExec(() -> TmfSignalManager.dispatchSignal(new TmfTraceClosedSignal(this, trace)));
fViewBot.close();
- fBot.waitUntil(ConditionHelpers.ViewIsClosed(fViewBot));
+ fBot.waitUntil(ConditionHelpers.viewIsClosed(fViewBot));
fTrace.dispose();
}

Back to the top