From a0f5482638de2592c7ff5605d25a4c6588e6faa7 Mon Sep 17 00:00:00 2001 From: Marc-Andre Laperle Date: Thu, 21 Jan 2016 21:14:50 -0500 Subject: [PATCH 1/1] ctf: Speed up TestInvalidCtfTrace - Do not delete project every test - Do not delay when opening the editor Change-Id: I40032167cfec2ea8d99fc81974d142ab82befb3a Signed-off-by: Marc-Andre Laperle Reviewed-on: https://git.eclipse.org/r/64942 Reviewed-by: Hudson CI Reviewed-by: Matthew Khouzam Tested-by: Matthew Khouzam --- .../ui/swtbot/tests/TestInvalidCtfTrace.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ctf/ui/swtbot/tests/TestInvalidCtfTrace.java b/ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ctf/ui/swtbot/tests/TestInvalidCtfTrace.java index 5f4701b56c..b59b611a86 100644 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ctf/ui/swtbot/tests/TestInvalidCtfTrace.java +++ b/ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ctf/ui/swtbot/tests/TestInvalidCtfTrace.java @@ -39,7 +39,8 @@ import org.eclipse.swtbot.swt.finder.waits.Conditions; import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotUtils; import org.junit.After; -import org.junit.Before; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -164,8 +165,8 @@ public class TestInvalidCtfTrace { /** * Initialization */ - @Before - public void init() { + @BeforeClass + public static void beforeClass() { SWTBotUtils.initialize(); Thread.currentThread().setName("SWTBot Thread"); // for the debugger /* set up for swtbot */ @@ -184,10 +185,18 @@ public class TestInvalidCtfTrace { } /** - * Delete file + * Delete traces */ @After - public void cleanup() { + public void teardown() { + SWTBotUtils.clearTracesFolder(fBot, PROJET_NAME); + } + + /** + * Delete project + */ + @AfterClass + public static void afterClass() { SWTBotUtils.deleteProject(PROJET_NAME, fBot); fLogger.removeAllAppenders(); } @@ -198,7 +207,7 @@ public class TestInvalidCtfTrace { @Test public void testOpen() { SWTBotUtils.selectTracesFolder(fBot, PROJET_NAME); - SWTBotUtils.openTrace(PROJET_NAME, fLocation.getAbsolutePath(), "org.eclipse.linuxtools.tmf.ui.type.ctf"); + SWTBotUtils.openTrace(PROJET_NAME, fLocation.getAbsolutePath(), "org.eclipse.linuxtools.tmf.ui.type.ctf", false); fBot.waitUntil(Conditions.shellIsActive("Open Trace")); final SWTBotShell shell = fBot.activeShell(); final SWTBot dialogBot = shell.bot(); -- 2.34.1