Commit
6941941dae56 (https://git.eclipse.org/r/#/c/66579/)
changed tests to set explicitly a time zone but it doesn't
reset it properly. Because of this, TestRefreshTextTrace had
mismatching time stamps.
This can reproduced by running FilterViewerTest first then
running TestRefreshTextTrace. The easiest way is to modify
SWTBotStressTests to have this:
s.addTest(new JUnit4TestAdapter(FilterViewerTest.class));
s.addTest(new JUnit4TestAdapter(TestRefreshTextTrace.class));
To fix it, we reset the time zone to the time zone id, not the label.
The safest way to do this is to use what we decided to use in the
default preference map.
Change-Id: I9b25e2c3a458cee62b74cfde61043270b62b1c01
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/66723
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
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.TmfTimePreferences;
import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestampFormat;
import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.ConditionHelpers.SWTBotTestCondition;
import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotUtils;
@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();
}
prefToMap(prefs, prefsMap, ITmfTimePreferencesConstants.SSEC_DELIMITER, SSEC_DELIMITER_DEFAULT);
prefToMap(prefs, prefsMap, ITmfTimePreferencesConstants.DATIME, DATIME_DEFAULT);
prefToMap(prefs, prefsMap, ITmfTimePreferencesConstants.DATE_DELIMITER, DATE_DELIMITER_DEFAULT);
+ prefToMap(prefs, prefsMap, ITmfTimePreferencesConstants.TIME_ZONE, TIME_ZONE_DEFAULT);
return prefsMap;
}
private static class EventsTableSelectionCondition extends DefaultCondition {
private long fSelectionTime;
private SWTWorkbenchBot fBot;
+ private long fCurValue;
private EventsTableSelectionCondition(SWTWorkbenchBot bot, long selectionTime) {
fBot = bot;
if (eventsTableSelection.isEmpty()) {
return false;
}
- return ((ITmfEvent) eventsTableSelection.getFirstElement()).getTimestamp().getValue() == fSelectionTime;
+ fCurValue = ((ITmfEvent) eventsTableSelection.getFirstElement()).getTimestamp().getValue();
+ return fCurValue == fSelectionTime;
}
@Override
public String getFailureMessage() {
- return "The selection in the table was not an event with timestamp " + fSelectionTime;
+ return "The selection in the table was not an event with timestamp " + fSelectionTime + ". Actual is " + fCurValue;
}
private StructuredSelection getEventsTableSelection() {
import org.eclipse.tracecompass.internal.tmf.core.Activator;
import org.eclipse.tracecompass.tmf.core.io.BufferedRandomAccessFile;
import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimePreferencesConstants;
+import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimePreferences;
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.SWTBotUtils;
SWTBotUtils.closeViewById(FilterView.ID, fBot);
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();
}
import org.eclipse.tracecompass.internal.tmf.core.Activator;
import org.eclipse.tracecompass.tmf.core.io.BufferedRandomAccessFile;
import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimePreferencesConstants;
+import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimePreferences;
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.SWTBotUtils;
fLogger.removeAllAppenders();
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();
}