Add utility method to close secondary shells after tests
[deliverable/tracecompass.git] / ctf / org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests / src / org / eclipse / tracecompass / tmf / ctf / ui / swtbot / tests / TestInvalidCtfTrace.java
index 025284c725b57895662b2f44ad75b4bd5a9347de..a6888ccc1adbf52a3fbaa5405090feb519b0bd2d 100644 (file)
@@ -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;
@@ -80,10 +81,10 @@ public class TestInvalidCtfTrace {
         ERRORS.put("integer-encoding-invalid", "Invalid value for encoding");
         ERRORS.put("integer-negative-bit-size", "Invalid value for size");
         ERRORS.put("integer-range", "Invalid integer format: 23452397856348975623897562893746589237465289374658923764598237645897234658723648579236");
-        ERRORS.put("integer-signed-as-string", "org.eclipse.tracecompass.internal.ctf.core.event.metadata.exceptions.ParseException");
+        ERRORS.put("integer-signed-as-string", "Invalid boolean value");
         ERRORS.put("integer-signed-invalid", "Invalid boolean value svp");
         ERRORS.put("integer-size-as-string", "Invalid value for size");
-        ERRORS.put("integer-size-missing", "org.eclipse.tracecompass.internal.ctf.core.event.metadata.exceptions.ParseException");
+        ERRORS.put("integer-size-missing", "Invalid boolean value");
         ERRORS.put("struct-align-enum", "Invalid value for alignment");
         ERRORS.put("struct-align-huge", "Invalid integer format: 0xFFFFFFFFU");
         ERRORS.put("struct-align-negative", "Invalid value for alignment : -8");
@@ -164,9 +165,9 @@ public class TestInvalidCtfTrace {
     /**
      * Initialization
      */
-    @Before
-    public void init() {
-        SWTBotUtils.failIfUIThread();
+    @BeforeClass
+    public static void beforeClass() {
+        SWTBotUtils.initialize();
         Thread.currentThread().setName("SWTBot Thread"); // for the debugger
         /* set up for swtbot */
         SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */
@@ -184,10 +185,19 @@ public class TestInvalidCtfTrace {
     }
 
     /**
-     * Delete file
+     * Delete traces
      */
     @After
-    public void cleanup() {
+    public void teardown() {
+        SWTBotUtils.clearTracesFolder(fBot, PROJET_NAME);
+        SWTBotUtils.closeSecondaryShells(fBot);
+    }
+
+    /**
+     * Delete project
+     */
+    @AfterClass
+    public static void afterClass() {
         SWTBotUtils.deleteProject(PROJET_NAME, fBot);
         fLogger.removeAllAppenders();
     }
@@ -198,7 +208,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();
This page took 0.02968 seconds and 5 git commands to generate.