From: Marc-Andre Laperle Date: Thu, 11 Sep 2014 14:38:38 +0000 (-0400) Subject: lttng: Delete suppl. files *after* the trace has been disposed in a test X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=95a0cba52cbc03716ef0b681b34223cd26d3246e;p=deliverable%2Ftracecompass.git lttng: Delete suppl. files *after* the trace has been disposed in a test That way the file handle won't be still opened when trying to delete the suppl. folder (Windows). Change-Id: I6e43442d715389fd3ba5265a96d9de534701f7d8 Signed-off-by: Marc-Andre Laperle Reviewed-on: https://git.eclipse.org/r/33255 Tested-by: Hudson CI Reviewed-by: Alexandre Montplaisir --- diff --git a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AbstractProviderTest.java b/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AbstractProviderTest.java index a7a00e95fc..68841f0f16 100644 --- a/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AbstractProviderTest.java +++ b/org.eclipse.linuxtools.lttng2.ust.core.tests/src/org/eclipse/linuxtools/lttng2/ust/core/tests/trace/callstack/AbstractProviderTest.java @@ -134,6 +134,7 @@ public abstract class AbstractProviderTest { @Test public void testOtherUstTrace() { /* Initialize the trace and analysis module */ + File suppDir; try (CtfTmfTrace ustTrace = otherUstTrace.getTrace();) { try (TestLttngCallStackModule module = new TestLttngCallStackModule();) { try { @@ -150,11 +151,10 @@ public abstract class AbstractProviderTest { assertTrue(ss.getStartTime() >= ustTrace.getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue()); assertEquals(0, ss.getNbAttributes()); } - /* Dispose the trace */ - File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(ustTrace)); - deleteDirectory(suppDir); - assertFalse(suppDir.exists()); + suppDir = new File(TmfTraceManager.getSupplementaryFileDir(ustTrace)); } + deleteDirectory(suppDir); + assertFalse(suppDir.exists()); } /**