swtbot: Fix ProjectExplorerRefreshTest last modified times

Depending on the OS and file system, the last modified time can have a
granularity of 1 second (value in milliseconds always ending in 000).

In the test, if the two copyDirectory operations were executed within
the same second, the last modified time could be unchanged and the
platform would not detect a resource change on refresh.

Using a different value of the preserveFileDate parameter ensures that
the last modified time is changed and that resource change is detected.

Change-Id: Id55dee95de9e1b772613fcede0b0d6eda74656b2
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/103961
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/105105
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
diff --git a/releng/org.eclipse.tracecompass.integration.swtbot.tests/src/org/eclipse/tracecompass/integration/swtbot/tests/projectexplorer/ProjectExplorerRefreshTest.java b/releng/org.eclipse.tracecompass.integration.swtbot.tests/src/org/eclipse/tracecompass/integration/swtbot/tests/projectexplorer/ProjectExplorerRefreshTest.java
index 64d4a22..6aab98e 100644
--- a/releng/org.eclipse.tracecompass.integration.swtbot.tests/src/org/eclipse/tracecompass/integration/swtbot/tests/projectexplorer/ProjectExplorerRefreshTest.java
+++ b/releng/org.eclipse.tracecompass.integration.swtbot.tests/src/org/eclipse/tracecompass/integration/swtbot/tests/projectexplorer/ProjectExplorerRefreshTest.java
@@ -156,6 +156,7 @@
         SWTBotTreeItem project = SWTBotUtils.selectProject(fBot, TRACE_PROJECT_NAME);
         SWTBotTreeItem experiment = SWTBotUtils.getTraceProjectItem(fBot, project, "Experiments", "Experiment");
         FileUtils.copyDirectory(TEST_FILE_KERNEL_CLASH, FileUtils.getFile(fTracesFolder, TEST_FILE_KERNEL.getName()), false);
+        // false -> last modified times are copied file time stamps
         assertTrue(kernelTrace.contextMenu().menuItems().contains("Delete Supplementary Files..."));
         assertTrue(experiment.contextMenu().menuItems().contains("Delete Supplementary Files..."));
         refresh(() -> tracesFolder.contextMenu().menu("Refresh").click());
@@ -165,7 +166,8 @@
         assertTrue(experiment.contextMenu().menuItems().contains("Delete Supplementary Files..."));
         SWTBotUtils.activateEditor(fBot, TEST_FILE_KERNEL.getName());
         SWTBotUtils.activateEditor(fBot, "Experiment");
-        FileUtils.copyDirectory(TEST_FILE_KERNEL, FileUtils.getFile(fTracesFolder, TEST_FILE_KERNEL.getName()), false);
+        FileUtils.copyDirectory(TEST_FILE_KERNEL, FileUtils.getFile(fTracesFolder, TEST_FILE_KERNEL.getName()), true);
+        // true -> last modified times are original file time stamps
         assertTrue(kernelTrace.contextMenu().menuItems().contains("Delete Supplementary Files..."));
         refresh(() -> tracesFolder.contextMenu().menu("Refresh").click());
         shell = fBot.shell("Trace Changed");