Even if the jobs are finished, the table is not necessarily filled yet.
The update could be pending as a event in the UI thread queue, etc. We
can wait until cells are filled instead.
Also export the package so that it can be used elsewhere, (alltests
stress test for example).
Change-Id: I8177c7e6b7e487d59b248e0279c6bcd8da43b515
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/62959
Reviewed-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
Bundle-SymbolicName: org.eclipse.tracecompass.analysis.os.linux.ui.swtbot.tests;singleton:=true
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-SymbolicName: org.eclipse.tracecompass.analysis.os.linux.ui.swtbot.tests;singleton:=true
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Export-Package: org.eclipse.tracecompass.analysis.os.linux.ui.swtbot.tests
+Export-Package: org.eclipse.tracecompass.analysis.os.linux.ui.swtbot.tests,
+ org.eclipse.tracecompass.analysis.os.linux.ui.swtbot.tests.latency
Require-Bundle: org.apache.log4j,
org.eclipse.core.resources,
org.eclipse.core.runtime,
Require-Bundle: org.apache.log4j,
org.eclipse.core.resources,
org.eclipse.core.runtime,
package org.eclipse.tracecompass.analysis.os.linux.ui.swtbot.tests.latency;
package org.eclipse.tracecompass.analysis.os.linux.ui.swtbot.tests.latency;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
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.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.results.BoolResult;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.results.BoolResult;
assertNotNull(fTable);
fTable.updateModel(fixture);
SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable());
assertNotNull(fTable);
fTable.updateModel(fixture);
SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable());
- assertEquals("0", tableBot.cell(0, 2));
+ SWTBot bot = new SWTBot();
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "0", 0, 2));
tableBot.header("Duration").click();
tableBot.header("Duration").click();
- assertEquals("0", tableBot.cell(0, 2));
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "0", 0, 2));
tableBot.header("Duration").click();
tableBot.header("Duration").click();
- assertEquals("99", tableBot.cell(0, 2));
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "99", 0, 2));
assertNotNull(fTable);
fTable.updateModel(fixture);
SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable());
assertNotNull(fTable);
fTable.updateModel(fixture);
SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable());
- assertEquals("100", tableBot.cell(0, 2));
+ SWTBot bot = new SWTBot();
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "100", 0, 2));
tableBot.header("Duration").click();
tableBot.header("Duration").click();
- assertEquals("0", tableBot.cell(0, 2));
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "0", 0, 2));
tableBot.header("Duration").click();
tableBot.header("Duration").click();
- assertEquals("100", tableBot.cell(0, 2));
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "100", 0, 2));
assertNotNull(fTable);
fTable.updateModel(fixture);
SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable());
assertNotNull(fTable);
fTable.updateModel(fixture);
SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable());
- assertEquals("1", tableBot.cell(0, 2));
+ SWTBot bot = new SWTBot();
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "1", 0, 2));
tableBot.header("Duration").click();
tableBot.header("Duration").click();
- assertEquals("0", tableBot.cell(0, 2));
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "0", 0, 2));
tableBot.header("Duration").click();
tableBot.header("Duration").click();
- assertEquals("1", tableBot.cell(0, 2));
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "1", 0, 2));
assertNotNull(fTable);
fTable.updateModel(fixture);
SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable());
assertNotNull(fTable);
fTable.updateModel(fixture);
SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable());
- assertEquals("0", tableBot.cell(0, 2));
+ SWTBot bot = new SWTBot();
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "0", 0, 2));
tableBot.header("Duration").click();
tableBot.header("Duration").click();
- assertEquals("0", tableBot.cell(0, 2));
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "0", 0, 2));
tableBot.header("Duration").click();
tableBot.header("Duration").click();
- assertEquals("999999", tableBot.cell(0, 2));
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "999999", 0, 2));
assertNotNull(fTable);
fTable.updateModel(fixture);
SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable());
assertNotNull(fTable);
fTable.updateModel(fixture);
SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable());
- assertEquals("894633", tableBot.cell(0, 2));
+ SWTBot bot = new SWTBot();
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "894633", 0, 2));
tableBot.header("Duration").click();
tableBot.header("Duration").click();
- assertEquals("0", tableBot.cell(0, 2));
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "0", 0, 2));
tableBot.header("Duration").click();
tableBot.header("Duration").click();
- assertEquals("999999", tableBot.cell(0, 2));
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "999999", 0, 2));
assertNotNull(fTable);
fTable.updateModel(fixture);
SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable());
assertNotNull(fTable);
fTable.updateModel(fixture);
SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable());
- assertEquals("400689", tableBot.cell(0, 2));
+ SWTBot bot = new SWTBot();
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "400689", 0, 2));
tableBot.header("Duration").click();
tableBot.header("Duration").click();
- assertEquals("0", tableBot.cell(0, 2));
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "0", 0, 2));
tableBot.header("Duration").click();
tableBot.header("Duration").click();
- assertEquals("998001", tableBot.cell(0, 2));
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "998001", 0, 2));
createTable();
SWTBotUtils.waitForJobs();
SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable());
createTable();
SWTBotUtils.waitForJobs();
SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable());
- assertEquals("24100", tableBot.cell(0, 2));
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "24100", 0, 2));
tableBot.header("Duration").click();
tableBot.header("Duration").click();
- assertEquals("1000", tableBot.cell(0, 2));
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "1000", 0, 2));
tableBot.header("Duration").click();
tableBot.header("Duration").click();
- assertEquals("5904091700", tableBot.cell(0, 2));
+ bot.waitUntil(ConditionHelpers.isTableCellFilled(tableBot, "5904091700", 0, 2));
bot.closeAllEditors();
SWTBotUtils.deleteProject(PROJECT_NAME, bot);
}
bot.closeAllEditors();
SWTBotUtils.deleteProject(PROJECT_NAME, bot);
}
org.eclipse.tracecompass.gdbtrace.core.tests,
org.eclipse.tracecompass.gdbtrace.ui.tests,
org.eclipse.tracecompass.analysis.os.linux.core.tests,
org.eclipse.tracecompass.gdbtrace.core.tests,
org.eclipse.tracecompass.gdbtrace.ui.tests,
org.eclipse.tracecompass.analysis.os.linux.core.tests,
+ org.eclipse.tracecompass.analysis.os.linux.ui.swtbot.tests,
org.eclipse.tracecompass.analysis.graph.core.tests,
org.eclipse.tracecompass.lttng2.control.core.tests,
org.eclipse.tracecompass.lttng2.control.ui.tests,
org.eclipse.tracecompass.analysis.graph.core.tests,
org.eclipse.tracecompass.lttng2.control.core.tests,
org.eclipse.tracecompass.lttng2.control.ui.tests,