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.eclipse.tracecompass.tmf.ui.tests.shared.WaitUtils;
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;
private static final Map<String, String> ERRORS = new HashMap<>();
static {
// metadata
- ERRORS.put("array-redefinition", "MismatchedTokenException(57!=72)");
+ ERRORS.put("array-redefinition", "MismatchedTokenException(56!=71)");
ERRORS.put("array-size-identifier", "Is not an integer: x");
- ERRORS.put("array-size-keyword", "NoViableAltException(75@[])");
+ ERRORS.put("array-size-keyword", "NoViableAltException(74@[])");
ERRORS.put("array-size-negative", "Array length is negative");
- ERRORS.put("array-size-not-present", "NoViableAltException(14@[])");
+ ERRORS.put("array-size-not-present", "NoViableAltException(13@[])");
ERRORS.put("array-size-string", "Is not an integer: x");
ERRORS.put("array-size-type-field", "Is not an integer: uint32_t");
ERRORS.put("array-size-type", "Is not an integer: uint32_t");
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");
ERRORS.put("struct-align-zero", "Invalid value for alignment : 0");
ERRORS.put("struct-duplicate-field-name", "Identifier has already been defined:xxx");
ERRORS.put("struct-duplicate-struct-name", "struct a already defined.");
- ERRORS.put("struct-field-name-keyword", "NoViableAltException(73@[])");
+ ERRORS.put("struct-field-name-keyword", "NoViableAltException(72@[])");
// streams
ERRORS.put("content-size-larger-than-packet-size", "UNKNOWN"); //FIXME
ERRORS.put("cross-packet-event-alignment-empty-struct", "UNKNOWN"); //FIXME
/**
* 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 */
SWTBotUtils.switchToTracingPerspective();
/* finish waiting for eclipse to load */
- SWTBotUtils.waitForJobs();
+ WaitUtils.waitForJobs();
SWTBotUtils.createProject(PROJET_NAME);
}
/**
- * 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();
}
@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();