import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.tracecompass.internal.tmf.core.Activator;
import org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace;
import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimePreferencesConstants;
+import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
+import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimePreferences;
+import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
+import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestampFormat;
+import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.ConditionHelpers;
import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.ConditionHelpers.SWTBotTestCondition;
import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotUtils;
+import org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils.Resolution;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils.TimeFormat;
private static final long LTTNG_CONSUMER_BIRTHTIME = 1361214078963717040L;
private static final String LTTNG_CONSUMER_TID = "4034";
+ private static final @NonNull ITmfTimestamp TRACE_START_TIME = TmfTimestamp.create(1361214078963711320L, ITmfTimestamp.NANOSECOND_SCALE);
+
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
@Override
public void after() {
IEclipsePreferences defaultPreferences = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
- defaultPreferences.put(ITmfTimePreferencesConstants.TIME_ZONE, "Local Time");
+ defaultPreferences.put(ITmfTimePreferencesConstants.TIME_ZONE, TmfTimePreferences.getDefaultPreferenceMap().get(ITmfTimePreferencesConstants.TIME_ZONE));
TmfTimestampFormat.updateDefaultFormats();
super.after();
}
*/
@Test
public void testColumnSorting() {
+ fBot.waitUntil(ConditionHelpers.timeGraphIsReadyCondition((AbstractTimeGraphView) fViewBot.getViewReference().getPart(false), new TmfTimeRange(TRACE_START_TIME, TRACE_START_TIME), TRACE_START_TIME));
+
// Create a known state
applyFilter();
final SWTBotTree tree = fViewBot.bot().tree();
assertEquals("default", 0, checked.intValue());
// select root nodes and their children
- checkTreeItem(bot, treeBot, SYSTEMD_PROCESS_NAME, 54);
- checkTreeItem(bot, treeBot, KTHREAD_PROCESS_NAME, 88);
- checkTreeItem(bot, treeBot, LTTNG_CONSUMER_PROCESS_NAME, 89);
+ checkFilterTreeItems(bot, treeBot, SYSTEMD_PROCESS_NAME);
+ checkFilterTreeItems(bot, treeBot, KTHREAD_PROCESS_NAME);
+ checkFilterTreeItems(bot, treeBot, LTTNG_CONSUMER_PROCESS_NAME);
bot.button(OK_BUTTON).click();
}
- private static void checkTreeItem(SWTBot bot, SWTBotTree treeBot, String process, int nbChecked) {
+ private static void checkFilterTreeItems(SWTBot bot, SWTBotTree treeBot, String process) {
SWTBotTreeItem item = SWTBotUtils.getTreeItem(bot, treeBot, process);
item.select();
bot.button(CHECK_SUBTREE).click();
TreeCheckedCounter treeCheckCounter = new TreeCheckedCounter(treeBot);
- Integer checked = UIThreadRunnable.syncExec(treeCheckCounter);
- assertEquals(process, nbChecked, checked.intValue());
+ UIThreadRunnable.syncExec(treeCheckCounter);
}
private static void testProcessSorting(final SWTBotTree tree) {