releng: Re-enable ignored tests
Those tests were disable for build purpose.Behavior changes introduced
with Eclipse 4.9 created SWTBot failures.
Change-Id: Ibd8bb716c4f359db8dd1420e8dea186844a57574
Signed-off-by: Jean-Christian Kouame <jean-christian.kouame@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/128956
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: CI Bot
diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ControlFlowViewFindTest.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ControlFlowViewFindTest.java
index 5e68fcb..ddc1f3e 100644
--- a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ControlFlowViewFindTest.java
+++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ControlFlowViewFindTest.java
@@ -8,14 +8,11 @@
*******************************************************************************/
package org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests;
-import org.junit.Ignore;
-
/**
* SWTBot test for Control Flow View Find dialog
*
* @author Jean-Christian Kouame
*/
-@Ignore
public class ControlFlowViewFindTest extends FindDialogTestBase {
private static final String TITLE = "Control Flow";
diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ControlFlowViewTest.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ControlFlowViewTest.java
index 00a7460..e7e8f6c 100644
--- a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ControlFlowViewTest.java
+++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ControlFlowViewTest.java
@@ -24,9 +24,8 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
-import org.eclipse.swtbot.swt.finder.keyboard.Keyboard;
-import org.eclipse.swtbot.swt.finder.keyboard.KeyboardFactory;
import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCanvas;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotRadio;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
@@ -88,7 +87,6 @@
private static final String FOLLOW_CPU_FORWARD = "Follow CPU Forward";
private static final String SELECT_PREVIOUS_STATE_CHANGE = "Select Previous State Change";
private static final String SELECT_NEXT_STATE_CHANGE = "Select Next State Change";
- private static final Keyboard KEYBOARD = KeyboardFactory.getSWTKeyboard();
private static final @NonNull ITmfTimestamp START_TIME = TmfTimestamp.fromNanos(1368000272650993664L);
private static final @NonNull ITmfTimestamp TID1_TIME1 = TmfTimestamp.fromNanos(1368000272651208412L);
private static final @NonNull ITmfTimestamp TID1_TIME2 = TmfTimestamp.fromNanos(1368000272656147616L);
@@ -147,10 +145,25 @@
*/
@Test
public void testKeyboardLeftRight() {
- testNextPreviousEvent(() -> KEYBOARD.pressShortcut(Keystrokes.RIGHT),
- () -> KEYBOARD.pressShortcut(Keystrokes.SHIFT, Keystrokes.RIGHT),
- () -> KEYBOARD.pressShortcut(Keystrokes.LEFT),
- () -> KEYBOARD.pressShortcut(Keystrokes.SHIFT, Keystrokes.LEFT));
+ SWTBotView viewBot = getViewBot();
+ SWTBotCanvas canvas = viewBot.bot().canvas(1);
+ testNextPreviousEvent(
+ () -> {
+ canvas.setFocus();
+ canvas.pressShortcut(Keystrokes.RIGHT);
+ },
+ () -> {
+ canvas.setFocus();
+ canvas.pressShortcut(Keystrokes.SHIFT, Keystrokes.RIGHT);
+ },
+ () -> {
+ canvas.setFocus();
+ canvas.pressShortcut(Keystrokes.LEFT);
+ },
+ () -> {
+ canvas.setFocus();
+ canvas.pressShortcut(Keystrokes.SHIFT, Keystrokes.LEFT);
+ });
}
/**
diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/FindDialogTestBase.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/FindDialogTestBase.java
index 8d51fad..f8602d8 100644
--- a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/FindDialogTestBase.java
+++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/FindDialogTestBase.java
@@ -23,14 +23,13 @@
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
-import org.eclipse.swtbot.swt.finder.keyboard.Keyboard;
-import org.eclipse.swtbot.swt.finder.keyboard.KeyboardFactory;
import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
import org.eclipse.swtbot.swt.finder.matchers.WidgetOfType;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
import org.eclipse.swtbot.swt.finder.utils.SWTUtils;
import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCanvas;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotLabel;
@@ -75,7 +74,6 @@
/** The Log4j logger instance. */
private static final Logger fLogger = Logger.getRootLogger();
- private static final Keyboard KEYBOARD = KeyboardFactory.getSWTKeyboard();
private static final @NonNull ITmfTimestamp START_TIME = TmfTimestamp.create(1412670961211260539L, ITmfTimestamp.NANOSECOND_SCALE);
private static final @NonNull String SPACE = " ";
private static final String REGEX_PREFIX = "\\A";
@@ -144,10 +142,10 @@
String title = getViewTitle();
fViewBot = fBot.viewByTitle(title);
fViewBot.show();
- fViewBot.setFocus();
TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, START_TIME));
fBot.waitUntil(ConditionHelpers.timeGraphIsReadyCondition((AbstractTimeGraphView) fViewBot.getViewReference().getPart(false), new TmfTimeRange(START_TIME, START_TIME), START_TIME));
+ fViewBot.setFocus();
openDialog(fViewBot);
fFindText = getFindText();
@@ -158,17 +156,20 @@
*/
@After
public void after() {
+ SWTBotShell shell = getDialogShell();
closeDialog(getDialogBot());
+ fBot.waitUntil(Conditions.shellCloses(shell));
SWTBotUtils.closeSecondaryShells(fBot);
}
private static void openDialog(SWTBotView view) {
+ SWTBotCanvas canvas = view.bot().canvas(1);
view.setFocus();
- SWTBotUtils.pressShortcut(KEYBOARD, Keystrokes.HOME);
+ canvas.pressShortcut(Keystrokes.HOME);
if (SWTUtils.isMac()) {
- KEYBOARD.pressShortcut(Keystrokes.COMMAND, KeyStroke.getInstance('F'));
+ canvas.pressShortcut(Keystrokes.COMMAND, KeyStroke.getInstance('F'));
} else {
- KEYBOARD.pressShortcut(Keystrokes.CTRL, KeyStroke.getInstance('F'));
+ canvas.pressShortcut(Keystrokes.CTRL, KeyStroke.getInstance('F'));
}
fBot.shell(DIALOG_TITLE).activate();
}
diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ResourcesViewFindTest.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ResourcesViewFindTest.java
index 3744911..1eb4117 100644
--- a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ResourcesViewFindTest.java
+++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ResourcesViewFindTest.java
@@ -8,14 +8,11 @@
*******************************************************************************/
package org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests;
-import org.junit.Ignore;
-
/**
* SWTBot test for Resources view Find dialog
*
* @author Jean-Christian Kouame
*/
-@Ignore
public class ResourcesViewFindTest extends FindDialogTestBase {
private static final String TITLE = "Resources";
diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ResourcesViewTest.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ResourcesViewTest.java
index c3fdd14..36fc8fc 100644
--- a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ResourcesViewTest.java
+++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ResourcesViewTest.java
@@ -27,8 +27,6 @@
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.keyboard.Keyboard;
-import org.eclipse.swtbot.swt.finder.keyboard.KeyboardFactory;
import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
import org.eclipse.swtbot.swt.finder.matchers.WidgetOfType;
import org.eclipse.swtbot.swt.finder.results.Result;
@@ -79,7 +77,6 @@
private static final String ADD_BOOKMARK_DIALOG = "Add Bookmark";
private static final String LOST_EVENTS = "Lost Events";
private static final String OK = "OK";
- private static final Keyboard KEYBOARD = KeyboardFactory.getSWTKeyboard();
private static final @NonNull ITmfTimestamp START_TIME = TmfTimestamp.fromNanos(1368000272650993664L);
private static final @NonNull ITmfTimestamp LOST_EVENT_TIME1 = TmfTimestamp.fromNanos(1368000272681793477L);
private static final @NonNull ITmfTimestamp LOST_EVENT_END1 = TmfTimestamp.fromNanos(1368000272681793477L + 7425331L);
@@ -140,11 +137,25 @@
*/
@Test
public void testKeyboardSelectNextPreviousMarker() {
+ SWTBotView viewBot = getViewBot();
+ SWTBotCanvas canvas = viewBot.bot().canvas(1);
testNextPreviousMarker(
- () -> KEYBOARD.pressShortcut(KeyStroke.getInstance('.')),
- () -> KEYBOARD.pressShortcut(Keystrokes.SHIFT, KeyStroke.getInstance('.')),
- () -> KEYBOARD.pressShortcut(KeyStroke.getInstance(',')),
- () -> KEYBOARD.pressShortcut(Keystrokes.SHIFT, KeyStroke.getInstance(',')));
+ () -> {
+ canvas.setFocus();
+ canvas.pressShortcut(KeyStroke.getInstance('.'));
+ },
+ () -> {
+ canvas.setFocus();
+ canvas.pressShortcut(Keystrokes.SHIFT, KeyStroke.getInstance('.'));
+ },
+ () -> {
+ canvas.setFocus();
+ canvas.pressShortcut(KeyStroke.getInstance(','));
+ },
+ () -> {
+ canvas.setFocus();
+ canvas.pressShortcut(Keystrokes.SHIFT, KeyStroke.getInstance(','));
+ });
}
/**
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/parsers/custom/TestCustomTxtWizard.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/parsers/custom/TestCustomTxtWizard.java
index 8f64792..c2c38e4 100644
--- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/parsers/custom/TestCustomTxtWizard.java
+++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/parsers/custom/TestCustomTxtWizard.java
@@ -21,11 +21,12 @@
import java.io.IOException;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotUtils;
import org.eclipse.tracecompass.tmf.ui.tests.shared.WaitUtils;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -95,7 +96,6 @@
* the xml file wasn't written, this is bad
*/
@Test
- @Ignore
public void testNew() throws FileNotFoundException, IOException {
File xmlFile = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(".metadata/.plugins/org.eclipse.tracecompass.tmf.core/custom_txt_parsers.xml").toFile();
// Open the custom parsers dialog
@@ -103,27 +103,31 @@
SWTBotTreeItem treeNode = SWTBotUtils.selectTracesFolder(fBot, PROJECT_NAME);
treeNode.contextMenu("Manage Custom Parsers...").click();
- fBot.shell(MANAGE_CUSTOM_PARSERS_SHELL_TITLE).activate();
+ SWTBotShell shell = fBot.shell(MANAGE_CUSTOM_PARSERS_SHELL_TITLE).activate();
+ shell.setFocus();
+ SWTBot bot = shell.bot();
// Open the new custom txt parser dialog
- fBot.button("New...").click();
- fBot.shell(CUSTOM_TEXT_PARSER_SHELL_TITLE).activate();
+ bot.button("New...").click();
+ shell = bot.shell(CUSTOM_TEXT_PARSER_SHELL_TITLE).activate();
+ shell.setFocus();
+ bot = shell.bot();
// Setting header
- fBot.textWithLabel("Category:").setText(CATEGORY_NAME);
- fBot.textWithLabel("Trace type:").setText(TRACETYPE_NAME);
- fBot.textWithLabel("Time Stamp format:").setText("ss");
+ bot.textWithLabel("Category:").setText(CATEGORY_NAME);
+ bot.textWithLabel("Trace type:").setText(TRACETYPE_NAME);
+ bot.textWithLabel("Time Stamp format:").setText("ss");
// Fill Group 1 as time stamp
- fBot.comboBox(1).setSelection("Timestamp");
- fBot.textWithLabel("format:").setText("ss");
+ bot.comboBox(1).setSelection("Timestamp");
+ bot.textWithLabel("format:").setText("ss");
// Click on the New group button
- fBot.button(8).click();
+ bot.button(8).click();
// Add next line
- fBot.button(2).click();
- SWTBotTreeItem[] treeItems = fBot.tree().getAllItems();
+ bot.button(2).click();
+ SWTBotTreeItem[] treeItems = bot.tree().getAllItems();
SWTBotTreeItem eventLine[] = new SWTBotTreeItem[2];
- treeItems = fBot.tree().getAllItems();
+ treeItems = bot.tree().getAllItems();
for (SWTBotTreeItem item : treeItems) {
if (item.getText().startsWith("Root Line 1")) {
eventLine[0] = item;
@@ -135,25 +139,37 @@
assertNotNull(eventLine[0]);
assertNotNull(eventLine[1]);
// Set the regular expression for each event line
- fBot.styledText().setText("12 Hello\nWorld\n23 Goodbye\ncruel world");
+ bot.styledText().setText("12 Hello\nWorld\n23 Goodbye\ncruel world");
eventLine[0].select();
WaitUtils.waitForJobs();
- fBot.textWithLabel("Regular expression:").setText("\\s*(\\d\\d)\\s(.*\\S)");
+ bot.textWithLabel("Regular expression:").setText("\\s*(\\d\\d)\\s(.*\\S)");
eventLine[1].select();
- fBot.textWithLabel("Regular expression:").setText("([^0-9]*)");
+ bot.textWithLabel("Regular expression:").setText("([^0-9]*)");
// Click on the new group of root line 2
- fBot.button(7).click();
- fBot.comboBox("Set").setSelection("Append with |");
- fBot.button("Highlight All").click();
- fBot.button("Next >").click();
- fBot.button("Finish").click();
+ bot.button(7).click();
+ bot.comboBox("Set").setSelection("Append with |");
+ bot.button("Highlight All").click();
+ bot.button("Next >").click();
+ bot.button("Finish").click();
+
+ shell = bot.shell(MANAGE_CUSTOM_PARSERS_SHELL_TITLE).activate();
+ shell.setFocus();
+ bot = shell.bot();
fBot.waitUntil(new CustomDefinitionHasContent(xmlFile, CATEGORY_NAME, TRACETYPE_NAME, EXPECTED_TEST_DEFINITION));
String xmlPart = extractTestXml(xmlFile, CATEGORY_NAME, TRACETYPE_NAME);
assertEquals(EXPECTED_TEST_DEFINITION, xmlPart);
- fBot.list().select(CATEGORY_NAME + " : " + TRACETYPE_NAME);
- fBot.button("Delete").click();
- fBot.button("Yes").click();
- fBot.button("Close").click();
+ bot.list().select(CATEGORY_NAME + " : " + TRACETYPE_NAME);
+ bot.button("Delete").click();
+
+ shell = fBot.shell("Delete Custom Parser").activate();
+ shell.setFocus();
+ bot = shell.bot();
+ bot.button("Yes").click();
+
+ shell = fBot.shell(MANAGE_CUSTOM_PARSERS_SHELL_TITLE).activate();
+ shell.setFocus();
+ bot = shell.bot();
+ bot.button("Close").click();
fBot.waitUntil(new CustomDefinitionHasContent(xmlFile, CATEGORY_NAME, TRACETYPE_NAME, ""));
xmlPart = extractTestXml(xmlFile, CATEGORY_NAME, TRACETYPE_NAME);
assertEquals("", xmlPart);
@@ -170,7 +186,6 @@
* the xml file wasn't written, this is bad
*/
@Test
- @Ignore
public void testEdit() throws FileNotFoundException, IOException {
File xmlFile = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(".metadata/.plugins/org.eclipse.tracecompass.tmf.core/custom_txt_parsers.xml").toFile();
try (FileWriter fw = new FileWriter(xmlFile)) {
@@ -206,21 +221,26 @@
SWTBotUtils.createProject(PROJECT_NAME);
SWTBotTreeItem treeNode = SWTBotUtils.selectTracesFolder(fBot, PROJECT_NAME);
treeNode.contextMenu("Manage Custom Parsers...").click();
- fBot.shell(MANAGE_CUSTOM_PARSERS_SHELL_TITLE).activate();
+ SWTBotShell shell = fBot.shell(MANAGE_CUSTOM_PARSERS_SHELL_TITLE).activate();
+ shell.setFocus();
+ SWTBot bot = shell.bot();
// Open the edition dialog for txt parser
- fBot.list().select("Demo Category : Demo trace");
- fBot.button("Edit...").click();
- fBot.shell(CUSTOM_TEXT_PARSER_SHELL_TITLE).activate();
+ bot.list().select("Demo Category : Demo trace");
+ bot.button("Edit...").click();
+
+ shell = fBot.shell(CUSTOM_TEXT_PARSER_SHELL_TITLE).activate();
+ shell.setFocus();
+ bot = shell.bot();
// update parser's data
- fBot.textWithLabel("Category:").setText(CATEGORY_NAME);
- fBot.textWithLabel("Trace type:").setText(TRACETYPE_NAME);
- fBot.textWithLabel("Time Stamp format:").setText("ss");
+ bot.textWithLabel("Category:").setText(CATEGORY_NAME);
+ bot.textWithLabel("Trace type:").setText(TRACETYPE_NAME);
+ bot.textWithLabel("Time Stamp format:").setText("ss");
// update time stamp format
- fBot.comboBox(1).setSelection("Timestamp");
- fBot.textWithLabel("format:").setText("ss");
- fBot.button(2).click();
+ bot.comboBox(1).setSelection("Timestamp");
+ bot.textWithLabel("format:").setText("ss");
+ bot.button(2).click();
SWTBotTreeItem[] treeItems = fBot.tree().getAllItems();
SWTBotTreeItem eventLine[] = new SWTBotTreeItem[2];
for (SWTBotTreeItem item : treeItems) {
@@ -234,24 +254,38 @@
treeItems = fBot.tree().getAllItems();
assertNotNull(eventLine[0]);
assertNotNull(eventLine[1]);
- fBot.styledText().setText("12 Hello\nWorld\n23 Goodbye\ncruel world");
+ bot.styledText().setText("12 Hello\nWorld\n23 Goodbye\ncruel world");
eventLine[0].select();
WaitUtils.waitForJobs();
- fBot.textWithLabel("Regular expression:").setText("\\s*(\\d\\d)\\s(.*\\S)");
+ bot.textWithLabel("Regular expression:").setText("\\s*(\\d\\d)\\s(.*\\S)");
eventLine[1].select();
- fBot.textWithLabel("Regular expression:").setText("([^0-9]*)");
- fBot.button(7).click();
- fBot.comboBox("Set").setSelection("Append with |");
- fBot.button("Highlight All").click();
- fBot.button("Next >").click();
- fBot.button("Finish").click();
+ bot.textWithLabel("Regular expression:").setText("([^0-9]*)");
+ bot.button(7).click();
+ bot.comboBox("Set").setSelection("Append with |");
+ bot.button("Highlight All").click();
+ bot.button("Next >").click();
+ bot.button("Finish").click();
+
+ shell = bot.shell(MANAGE_CUSTOM_PARSERS_SHELL_TITLE).activate();
+ shell.setFocus();
+ bot = shell.bot();
+
fBot.waitUntil(new CustomDefinitionHasContent(xmlFile, CATEGORY_NAME, TRACETYPE_NAME, EXPECTED_TEST_DEFINITION));
String xmlPart = extractTestXml(xmlFile, CATEGORY_NAME, TRACETYPE_NAME);
assertEquals(EXPECTED_TEST_DEFINITION, xmlPart);
- fBot.list().select(CATEGORY_NAME + " : " + TRACETYPE_NAME);
- fBot.button("Delete").click();
- fBot.button("Yes").click();
- fBot.button("Close").click();
+ bot.list().select(CATEGORY_NAME + " : " + TRACETYPE_NAME);
+ bot.button("Delete").click();
+
+ shell = fBot.shell("Delete Custom Parser").activate();
+ shell.setFocus();
+ bot = shell.bot();
+ bot.button("Yes").click();
+
+ shell = fBot.shell(MANAGE_CUSTOM_PARSERS_SHELL_TITLE).activate();
+ shell.setFocus();
+ bot = shell.bot();
+ bot.button("Close").click();
+
fBot.waitUntil(new CustomDefinitionHasContent(xmlFile, CATEGORY_NAME, TRACETYPE_NAME, ""));
xmlPart = extractTestXml(xmlFile, CATEGORY_NAME, TRACETYPE_NAME);
assertEquals("", xmlPart);
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/parsers/custom/TestCustomXmlWizard.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/parsers/custom/TestCustomXmlWizard.java
index 220fe34..2268323 100644
--- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/parsers/custom/TestCustomXmlWizard.java
+++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/parsers/custom/TestCustomXmlWizard.java
@@ -19,10 +19,11 @@
import java.io.IOException;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotUtils;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -69,35 +70,50 @@
* the xml file wasn't written, this is bad
*/
@Test
- @Ignore
public void testNew() throws FileNotFoundException, IOException {
File xmlFile = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(".metadata/.plugins/org.eclipse.tracecompass.tmf.core/custom_xml_parsers.xml").toFile();
SWTBotUtils.createProject(PROJECT_NAME);
SWTBotTreeItem treeNode = SWTBotUtils.selectTracesFolder(fBot, PROJECT_NAME);
treeNode.contextMenu("Manage Custom Parsers...").click();
- fBot.shell(MANAGE_CUSTOM_PARSERS_SHELL_TITLE).activate();
- fBot.radio("XML").click();
- fBot.button("New...").click();
- fBot.shell(CUSTOM_XML_PARSER_SHELL_TITLE).activate();
- fBot.textWithLabel("Category:").setText(CATEGORY_NAME);
- fBot.textWithLabel("Trace type:").setText(TRACETYPE_NAME);
- fBot.textWithLabel("Time Stamp format:").setText("ss");
+ SWTBotShell shell = fBot.shell(MANAGE_CUSTOM_PARSERS_SHELL_TITLE).activate();
+ shell.setFocus();
+ SWTBot bot = shell.bot();
+ bot.radio("XML").click();
+ bot.button("New...").click();
+ shell = bot.shell(CUSTOM_XML_PARSER_SHELL_TITLE).activate();
+ shell.setFocus();
+ bot = shell.bot();
+ bot.textWithLabel("Category:").setText(CATEGORY_NAME);
+ bot.textWithLabel("Trace type:").setText(TRACETYPE_NAME);
+ bot.textWithLabel("Time Stamp format:").setText("ss");
- fBot.styledText().setText(XML_TRACE1);
- fBot.buttonWithTooltip("Feeling lucky").click();
+ bot.styledText().setText(XML_TRACE1);
+ bot.buttonWithTooltip("Feeling lucky").click();
- fBot.tree().getTreeItem(TRACE).getNode(EVENT).select();
- fBot.checkBox("Log Entry").click();
- fBot.button("Next >").click();
- fBot.button("Finish").click();
+ bot.tree().getTreeItem(TRACE).getNode(EVENT).select();
+ bot.checkBox("Log Entry").click();
+ bot.button("Next >").click();
+ bot.button("Finish").click();
- fBot.waitUntil(new CustomDefinitionHasContent(xmlFile, CATEGORY_NAME, TRACETYPE_NAME, EXPECTED_TEST_DEFINITION));
+ shell = fBot.shell(MANAGE_CUSTOM_PARSERS_SHELL_TITLE).activate();
+ shell.setFocus();
+ bot = shell.bot();
+ bot.waitUntil(new CustomDefinitionHasContent(xmlFile, CATEGORY_NAME, TRACETYPE_NAME, EXPECTED_TEST_DEFINITION));
String xmlPart = extractTestXml(xmlFile, CATEGORY_NAME, TRACETYPE_NAME);
assertEquals(EXPECTED_TEST_DEFINITION, xmlPart);
- fBot.list().select(CATEGORY_NAME + " : " + TRACETYPE_NAME);
- fBot.button("Delete").click();
- fBot.button("Yes").click();
- fBot.button("Close").click();
+ bot.list().select(CATEGORY_NAME + " : " + TRACETYPE_NAME);
+ bot.button("Delete").click();
+
+ shell = fBot.shell("Delete Custom Parser").activate();
+ shell.setFocus();
+ bot = shell.bot();
+ bot.button("Yes").click();
+
+
+ shell = fBot.shell(MANAGE_CUSTOM_PARSERS_SHELL_TITLE).activate();
+ shell.setFocus();
+ bot = shell.bot();
+ bot.button("Close").click();
fBot.waitUntil(new CustomDefinitionHasContent(xmlFile, CATEGORY_NAME, TRACETYPE_NAME, ""));
xmlPart = extractTestXml(xmlFile, CATEGORY_NAME, TRACETYPE_NAME);
assertEquals("", xmlPart);
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/CopyToClipboardTest.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/CopyToClipboardTest.java
index 5f4c540..0c1299c 100644
--- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/CopyToClipboardTest.java
+++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/CopyToClipboardTest.java
@@ -35,8 +35,6 @@
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
-import org.eclipse.swtbot.swt.finder.keyboard.Keyboard;
-import org.eclipse.swtbot.swt.finder.keyboard.KeyboardFactory;
import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
import org.eclipse.swtbot.swt.finder.results.StringResult;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
@@ -49,7 +47,6 @@
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -64,7 +61,6 @@
private static final String EVENT1_TEXT = "01:01:01.000 000 000\tHostA\tLoggerA\tSourceFile\t4\tMessage A" + LINE_SEPARATOR;
private static final String EVENT2_TEXT = "02:02:02.000 000 000\tHostB\tLoggerB\tSourceFile\t5\tMessage B" + LINE_SEPARATOR;
private static final String EVENT3_TEXT = "03:03:03.000 000 000\tHostC\tLoggerC\tSourceFile\t6\tMessage C" + LINE_SEPARATOR;
- private static final Keyboard KEYBOARD = KeyboardFactory.getSWTKeyboard();
private static final String TRACE_PROJECT_NAME = "test";
private static final String TRACE_NAME = "syslog_collapse";
private static final String TRACE_PATH = "testfiles/" + TRACE_NAME;
@@ -161,12 +157,11 @@
* Test copy to clipboard with multiple selection
*/
@Test
- @Ignore
public void testCopyMultipleSelection() {
final SWTBotTable tableBot = fEditorBot.bot().table();
tableBot.getTableItem(1).click();
- KEYBOARD.pressShortcut(Keystrokes.SHIFT, Keystrokes.DOWN);
- KEYBOARD.pressShortcut(Keystrokes.SHIFT, Keystrokes.DOWN);
+ tableBot.pressShortcut(Keystrokes.SHIFT, Keystrokes.DOWN);
+ tableBot.pressShortcut(Keystrokes.SHIFT, Keystrokes.DOWN);
tableBot.contextMenu(COPY_TO_CLIPBOARD).click();
assertClipboardContentsEquals(HEADER_TEXT + EVENT1_TEXT + EVENT2_TEXT + EVENT3_TEXT);
@@ -176,11 +171,10 @@
* Test copy to clipboard not enabled when selection includes search row
*/
@Test
- @Ignore
public void testNoCopySearchRow() {
final SWTBotTable tableBot = fEditorBot.bot().table();
tableBot.getTableItem(1).click();
- KEYBOARD.pressShortcut(Keystrokes.SHIFT, Keystrokes.UP);
+ tableBot.pressShortcut(Keystrokes.SHIFT, Keystrokes.UP);
assertContextMenuAbsent(tableBot, COPY_TO_CLIPBOARD);
}
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/ExportToTsvTest.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/ExportToTsvTest.java
index 7b9a8ef..38bb0b2 100644
--- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/ExportToTsvTest.java
+++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/ExportToTsvTest.java
@@ -36,13 +36,12 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
-import org.eclipse.swtbot.swt.finder.keyboard.Keyboard;
-import org.eclipse.swtbot.swt.finder.keyboard.KeyboardFactory;
import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.waits.ICondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
import org.eclipse.tracecompass.tmf.core.tests.TmfCoreTestPlugin;
import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
import org.eclipse.tracecompass.tmf.ui.dialog.TmfFileDialogFactory;
@@ -52,7 +51,6 @@
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -92,8 +90,6 @@
private static final String EVENT1_TEXT = "01:01:01.000 000 000\tHostA\tLoggerA\tSourceFile\t4\tMessage A";
private static final String EVENT2_TEXT = "02:02:02.000 000 000\tHostB\tLoggerB\tSourceFile\t5\tMessage B";
private static final String EVENT3_TEXT = "03:03:03.000 000 000\tHostC\tLoggerC\tSourceFile\t6\tMessage C";
- @SuppressWarnings("null")
- private static final Keyboard KEYBOARD = KeyboardFactory.getSWTKeyboard();
private static final String TRACE_PROJECT_NAME = "test";
private static final String TRACE_NAME = "syslog_collapse";
private static final String TRACE_PATH = "testfiles/" + TRACE_NAME;
@@ -211,14 +207,14 @@
* File not found or such
*/
@Test
- @Ignore
public void testExportWithFilter() throws IOException {
SWTBotEditor editorBot = fEditorBot;
assertNotNull(editorBot);
final SWTBotTable tableBot = editorBot.bot().table();
tableBot.getTableItem(0).click(3);
- KEYBOARD.typeText("LoggerA|LoggerB|LoggerC");
- KEYBOARD.pressShortcut(Keystrokes.CTRL, Keystrokes.CR);
+ SWTBotText textBot = editorBot.bot().text();
+ textBot.typeText("LoggerA|LoggerB|LoggerC");
+ textBot.pressShortcut(Keystrokes.CTRL, Keystrokes.CR);
fBot.waitUntil(Conditions.tableHasRows(tableBot, 6), 5000);
tableBot.getTableItem(1).contextMenu(EXPORT_TO_TSV).click();
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/wizards/StandardImportWizardTest.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/wizards/StandardImportWizardTest.java
index 379e1ed..6a30d35 100644
--- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/wizards/StandardImportWizardTest.java
+++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/wizards/StandardImportWizardTest.java
@@ -15,8 +15,10 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.eclipse.tracecompass.internal.tmf.ui.project.wizards.importtrace.ImportTraceWizardPage;
import org.eclipse.tracecompass.internal.tmf.ui.project.wizards.importtrace.Messages;
@@ -24,7 +26,6 @@
import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotUtils;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -65,7 +66,6 @@
* Exception
*/
@Test
- @Ignore
public void testImportTimerange() throws Exception {
openImportWizard();
selectSyslog();
@@ -83,7 +83,6 @@
* Exception
*/
@Test
- @Ignore
public void testImportTimerangeInvalidFormat() throws Exception {
SWTWorkbenchBot bot = getSWTBot();
openImportWizard();
@@ -102,7 +101,6 @@
* Exception
*/
@Test
- @Ignore
public void testImportTimerangeInverseTime() throws Exception {
openImportWizard();
selectSyslog();
@@ -128,7 +126,10 @@
}
private static void selectSyslog() throws Exception {
- SWTWorkbenchBot bot = getSWTBot();
+ SWTWorkbenchBot workbenchBot = getSWTBot();
+ SWTBotShell shell = workbenchBot.shell("Trace Import");
+ shell.setFocus();
+ SWTBot bot = shell.bot();
URL resource = TmfCoreTestPlugin.getDefault().getBundle().getResource(TEST_FOLDER_NAME);
String path = FileLocator.toFileURL(resource).toURI().getPath();
SWTBotImportWizardUtils.selectImportFromDirectory(bot, path);