tmf: move custom parser tests from tmf.ui.tests to tmf.core.tests
authorBernd Hufmann <Bernd.Hufmann@ericsson.com>
Wed, 18 Nov 2015 18:29:07 +0000 (13:29 -0500)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Thu, 19 Nov 2015 11:57:57 +0000 (06:57 -0500)
Change-Id: Ib1d54ad5ad91fe315a68d77ab41d68802fe98178
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/60737
Reviewed-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
48 files changed:
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/AllTmfCoreTests.java
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/AbstractCustomTraceIndexTest.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/AllTests.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomTxtIndexTest.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomXmlIndexTest.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomXmlTraceBadlyFormedTest.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomXmlTraceInvalidTest.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomXmlTraceTest.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomXmlTraceValidTest.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/txt/testTxtDefinition.xml [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/001.xml [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/002.xml [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/003.xml [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/004.xml [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/005.xml [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/006.xml [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/malformed/001.xml [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/malformed/002.xml [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/malformed/003.xml [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/testDefinition.xml [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/valid/001.xml [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/valid/002.xml [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/valid/003.xml [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/TestRefreshCustomTextTrace.java
tmf/org.eclipse.tracecompass.tmf.ui.tests/build.properties
tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/AllTmfUITests.java
tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/AbstractCustomTraceIndexTest.java [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/AllTests.java [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomTxtIndexTest.java [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomXmlIndexTest.java [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomXmlTraceBadlyFormedTest.java [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomXmlTraceInvalidTest.java [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomXmlTraceTest.java [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomXmlTraceValidTest.java [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/txt/testTxtDefinition.xml [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/001.xml [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/002.xml [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/003.xml [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/004.xml [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/005.xml [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/006.xml [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/malformed/001.xml [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/malformed/002.xml [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/malformed/003.xml [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/testDefinition.xml [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/valid/001.xml [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/valid/002.xml [deleted file]
tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/valid/003.xml [deleted file]

index e3a90fe3d30fdc54cba61fc67f8e8f13030d05e4..3de510b6c08f6da469725ac0c1d0c39f235b37f8 100644 (file)
@@ -29,6 +29,7 @@ import org.junit.runner.RunWith;
     org.eclipse.tracecompass.tmf.core.tests.event.lookup.AllTests.class,
     org.eclipse.tracecompass.tmf.core.tests.filter.AllTests.class,
     org.eclipse.tracecompass.tmf.core.tests.model.AllTests.class,
+    org.eclipse.tracecompass.tmf.core.tests.parsers.custom.AllTests.class,
     org.eclipse.tracecompass.tmf.core.tests.request.AllTests.class,
     org.eclipse.tracecompass.tmf.core.tests.signal.AllTests.class,
     org.eclipse.tracecompass.tmf.core.tests.statesystem.AllTests.class,
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/AbstractCustomTraceIndexTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/AbstractCustomTraceIndexTest.java
new file mode 100644 (file)
index 0000000..ed13fba
--- /dev/null
@@ -0,0 +1,193 @@
+/*******************************************************************************
+ * Copyright (c) 2013, 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Marc-Andre Laperle - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.tmf.core.tests.parsers.custom;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
+import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfEventParser;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.core.trace.TmfContext;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
+import org.eclipse.tracecompass.tmf.core.trace.indexer.TmfBTreeTraceIndexer;
+import org.eclipse.tracecompass.tmf.core.trace.indexer.checkpoint.ITmfCheckpoint;
+import org.eclipse.tracecompass.tmf.core.trace.indexer.checkpoint.ITmfCheckpointIndex;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Common test code for custom trace indexes
+ *
+ * @author Marc-Andre Laperle
+ */
+public abstract class AbstractCustomTraceIndexTest {
+
+    /**
+     * Time format use for event creation
+     */
+    protected static final String TIMESTAMP_FORMAT = "dd/MM/yyyy HH:mm:ss:SSS";
+    /**
+     * Block size used for the indexer
+     */
+    protected static final int BLOCK_SIZE = 100;
+    /**
+     * The total number of events in the generated trace
+     */
+    protected static final int NB_EVENTS = 10000;
+    private static final long MILLISECOND_TO_NANOSECOND = 1000000;
+    private TestTrace fTrace = null;
+
+    /**
+     * A common test indexer for custom trace index tests
+     */
+    protected static class TestIndexer extends TmfBTreeTraceIndexer {
+
+        /**
+         * Constructs a new test indexer
+         *
+         * @param trace the trace
+         * @param interval the checkpoint interval
+         */
+        public TestIndexer(ITmfTrace trace, int interval) {
+            super(trace, interval);
+        }
+
+        /**
+         * Get the index
+         *
+         * @return the index
+         */
+        public ITmfCheckpointIndex getCheckpoints() {
+            return getTraceIndex();
+        }
+    }
+
+    interface TestTrace extends ITmfTrace {
+        TestIndexer getIndexer();
+    }
+
+    /**
+     * Setup the test
+     *
+     * @throws Exception when error occurs
+     */
+    @Before
+    public void setUp() throws Exception {
+        setupTrace();
+    }
+
+    private synchronized void setupTrace() throws Exception {
+        File traceDirectory = new File(getTraceDirectory());
+        if (traceDirectory.exists()) {
+            traceDirectory.delete();
+        }
+        traceDirectory.mkdir();
+        if (fTrace == null) {
+            fTrace = createTrace();
+            fTrace.indexTrace(true);
+        }
+    }
+
+    /**
+     * Create a test trace, varies between tests
+     *
+     * @return the test trace
+     * @throws Exception when error occurs
+     */
+    abstract protected TestTrace createTrace() throws Exception;
+    /**
+     * Return the trace directory for the generated trace
+     *
+     * @return the trace directory for the generated trace
+     */
+    abstract protected String getTraceDirectory();
+
+    /**
+     * Tear down the test
+     */
+    @After
+    public void tearDown() {
+        String directory = TmfTraceManager.getSupplementaryFileDir(fTrace);
+        try {
+            fTrace.dispose();
+            fTrace = null;
+        } finally {
+            File dir = new File(directory);
+            if (dir.exists()) {
+                File[] files = dir.listFiles();
+                for (File file : files) {
+                    file.delete();
+                }
+                dir.delete();
+            }
+
+            File trace = new File(getTraceDirectory());
+            if (trace.exists()) {
+                trace.delete();
+            }
+        }
+
+    }
+
+    /**
+     * Test the content of the index after building the full index
+     */
+    @Test
+    public void testTmfTraceIndexing() {
+        verifyIndexContent();
+    }
+
+    private void verifyIndexContent() {
+        long endTime = (NB_EVENTS - 1) * MILLISECOND_TO_NANOSECOND;
+        assertEquals("getCacheSize", BLOCK_SIZE, fTrace.getCacheSize());
+        assertEquals("getTraceSize", NB_EVENTS, fTrace.getNbEvents());
+        assertEquals("getRange-start", 0, fTrace.getTimeRange().getStartTime().getValue());
+        assertEquals("getRange-end", endTime, fTrace.getTimeRange().getEndTime().getValue());
+        assertEquals("getStartTime", 0, fTrace.getStartTime().getValue());
+        assertEquals("getEndTime", endTime, fTrace.getEndTime().getValue());
+
+        ITmfCheckpointIndex checkpoints = fTrace.getIndexer().getCheckpoints();
+        int pageSize = fTrace.getCacheSize();
+        assertTrue("Checkpoints exist", checkpoints != null);
+        assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE, checkpoints.size());
+
+        // Validate that each checkpoint points to the right event
+        for (int i = 0; i < checkpoints.size(); i++) {
+            ITmfCheckpoint checkpoint = checkpoints.get(i);
+            TmfContext context = new TmfContext(checkpoint.getLocation(), i * pageSize);
+            ITmfEvent event = ((ITmfEventParser)fTrace).parseEvent(context);
+            assertTrue(context.getRank() == i * pageSize);
+            assertTrue((checkpoint.getTimestamp().compareTo(event.getTimestamp()) == 0));
+        }
+    }
+
+    /**
+     * Test that a fully built index has the same content when reloaded from disk
+     *
+     * @throws Exception when error occurs
+     */
+    @Test
+    public void testReopenIndex() throws Exception {
+        fTrace.dispose();
+        fTrace = createTrace();
+        assertFalse(fTrace.getIndexer().getCheckpoints().isCreatedFromScratch());
+        fTrace.indexTrace(true);
+
+        verifyIndexContent();
+    }
+}
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/AllTests.java
new file mode 100644 (file)
index 0000000..74d9b92
--- /dev/null
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2013, 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.tmf.core.tests.parsers.custom;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * Test suite for custom parsers
+ * @author Matthew Khouzam
+ *
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+        CustomXmlTraceInvalidTest.class,
+        CustomXmlTraceBadlyFormedTest.class,
+        CustomXmlTraceValidTest.class,
+        CustomXmlIndexTest.class,
+        CustomTxtIndexTest.class
+})
+public class AllTests {
+}
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomTxtIndexTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomTxtIndexTest.java
new file mode 100644 (file)
index 0000000..ae92428
--- /dev/null
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *   Francois Chouinard - Adapted for TMF Trace Model 1.0
+ *   Alexandre Montplaisir - Port to JUnit4
+ *   Marc-Andre Laperle - Adapted to CustomTxtTrace
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.tmf.core.tests.parsers.custom;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
+import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomTxtTrace;
+import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomTxtTraceDefinition;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
+import org.eclipse.tracecompass.tmf.core.trace.indexer.ITmfTraceIndexer;
+
+/**
+ * Test suite for indexing using a CustomTxtTrace.
+ *
+ * @author Marc-Andre Laperle
+ */
+public class CustomTxtIndexTest extends AbstractCustomTraceIndexTest {
+
+    private static final String TRACE_DIRECTORY = TmfTraceManager.getTemporaryDirPath() + File.separator + "dummyTxtTrace";
+    private static final String TRACE_PATH = TRACE_DIRECTORY + File.separator + "test.txt";
+    private static final String DEFINITION_PATH = "testfiles" + File.separator + "txt" + File.separator + "testTxtDefinition.xml";
+
+    private static CustomTxtTraceDefinition createDefinition() {
+        CustomTxtTraceDefinition[] definitions = CustomTxtTraceDefinition.loadAll(new File(DEFINITION_PATH).toString());
+        return definitions[0];
+    }
+
+    @Override
+    protected String getTraceDirectory() {
+        return TRACE_DIRECTORY;
+    }
+
+    @Override
+    protected TestTrace createTrace() throws Exception {
+        CustomTxtTraceDefinition definition = createDefinition();
+        final File file = new File(TRACE_PATH);
+        try (BufferedWriter writer = new BufferedWriter(new FileWriter(file));) {
+            for (int i = 0; i < NB_EVENTS; ++i) {
+                SimpleDateFormat f = new SimpleDateFormat(TIMESTAMP_FORMAT);
+                String eventStr = f.format(new Date(i)) + " hello world\n";
+                writer.write(eventStr);
+            }
+        }
+
+        return new TestTxtTrace(file.toString(), definition, BLOCK_SIZE);
+    }
+
+    private class TestTxtTrace extends CustomTxtTrace implements TestTrace {
+        public TestTxtTrace(String path, CustomTxtTraceDefinition createDefinition, int blockSize) throws TmfTraceException {
+            super(null, createDefinition, path, blockSize);
+        }
+
+        @Override
+        protected ITmfTraceIndexer createIndexer(int interval) {
+            return new TestIndexer(this, interval);
+        }
+
+        @Override
+        public TestIndexer getIndexer() {
+            return (TestIndexer) super.getIndexer();
+        }
+    }
+}
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomXmlIndexTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomXmlIndexTest.java
new file mode 100644 (file)
index 0000000..0304c90
--- /dev/null
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Francois Chouinard - Initial API and implementation
+ *   Francois Chouinard - Adapted for TMF Trace Model 1.0
+ *   Alexandre Montplaisir - Port to JUnit4
+ *   Marc-Andre Laperle - Adapted to CustomXmlTrace
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.tmf.core.tests.parsers.custom;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
+import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomXmlTrace;
+import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomXmlTraceDefinition;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
+import org.eclipse.tracecompass.tmf.core.trace.indexer.ITmfTraceIndexer;
+
+/**
+ * Test suite for indexing using a CustomXmlTrace.
+ *
+ * @author Marc-Andre Laperle
+ */
+public class CustomXmlIndexTest extends AbstractCustomTraceIndexTest {
+
+    private static final String TRACE_DIRECTORY = TmfTraceManager.getTemporaryDirPath() + File.separator + "dummyXmlTrace";
+    private static final String TRACE_PATH = TRACE_DIRECTORY + File.separator + "test.xml";
+    private static final String DEFINITION_PATH = "testfiles" + File.separator + "xml" + File.separator + "testDefinition.xml";
+
+    private static CustomXmlTraceDefinition createDefinition() {
+        CustomXmlTraceDefinition[] definitions = CustomXmlTraceDefinition.loadAll(new File(DEFINITION_PATH).toString());
+        return definitions[0];
+    }
+
+    @Override
+    protected String getTraceDirectory() {
+        return TRACE_DIRECTORY;
+    }
+
+    @Override
+    protected TestTrace createTrace() throws Exception {
+        CustomXmlTraceDefinition definition = createDefinition();
+        final File file = new File(TRACE_PATH);
+        try (BufferedWriter writer = new BufferedWriter(new FileWriter(file));) {
+            writer.write("<trace>");
+            for (int i = 0; i < NB_EVENTS; ++i) {
+                SimpleDateFormat f = new SimpleDateFormat(TIMESTAMP_FORMAT);
+                String eventStr = "<element time=\"" + f.format(new Date(i)) + "\">message</element>\n";
+                writer.write(eventStr);
+            }
+            writer.write("</trace>");
+        }
+
+        return new TestXmlTrace(file.toString(), definition, BLOCK_SIZE);
+    }
+
+    private class TestXmlTrace extends CustomXmlTrace implements TestTrace {
+        public TestXmlTrace(String path, CustomXmlTraceDefinition createDefinition, int blockSize) throws TmfTraceException {
+            super(null, createDefinition, path, blockSize);
+        }
+
+        @Override
+        protected ITmfTraceIndexer createIndexer(int interval) {
+            return new TestIndexer(this, interval);
+        }
+
+        @Override
+        public TestIndexer getIndexer() {
+            return (TestIndexer) super.getIndexer();
+        }
+    }
+}
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomXmlTraceBadlyFormedTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomXmlTraceBadlyFormedTest.java
new file mode 100644 (file)
index 0000000..f5a95e8
--- /dev/null
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2013, 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.tmf.core.tests.parsers.custom;
+
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.tracecompass.tmf.core.trace.TraceValidationStatus;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+/**
+ * Malformed xml test, dangerous errors
+ * @author Matthew Khouzam
+ *
+ */
+@RunWith(Parameterized.class)
+public class CustomXmlTraceBadlyFormedTest extends CustomXmlTraceTest {
+
+    private final static String pathname = "testfiles/xml/malformed";
+
+    /**
+     * This should create the parameters to launch the project
+     *
+     * @return the path of the parameters
+     */
+    @Parameters(name = "{index}: path {0}")
+    public static Collection<Object[]> getFiles() {
+        File[] malformedFiles = (new File(pathname)).listFiles();
+        Collection<Object[]> params = new ArrayList<>();
+        for (File f : malformedFiles) {
+            Object[] arr = new Object[] { f.getAbsolutePath() };
+            params.add(arr);
+        }
+        return params;
+    }
+
+    /**
+     * Test all the invalid xml files
+     */
+    @Test
+    public void testBadlyFormed() {
+        IStatus invalid = getTrace().validate(null, getPath());
+        // Validation doesn't check for syntax errors. It returns a confidence
+        // of  0 and status OK if it is a text file for malformed xml files.
+        if ((IStatus.ERROR == invalid.getSeverity() ||
+                ((IStatus.OK == invalid.getSeverity() && (invalid instanceof TraceValidationStatus) && ((TraceValidationStatus) invalid).getConfidence() == 0)))) {
+            return;
+        }
+        fail(getPath());
+    }
+
+    /**
+     * ctor
+     *
+     * @param filePath
+     *            the path
+     */
+    public CustomXmlTraceBadlyFormedTest(String filePath) {
+        this.setPath(filePath);
+    }
+
+}
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomXmlTraceInvalidTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomXmlTraceInvalidTest.java
new file mode 100644 (file)
index 0000000..5a704ab
--- /dev/null
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2013, 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.tmf.core.tests.parsers.custom;
+
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.tracecompass.tmf.core.trace.TraceValidationStatus;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+/**
+ * Invalid Xml files, random errors
+ *
+ * @author Matthew Khouzam
+ *
+ */
+@RunWith(Parameterized.class)
+public class CustomXmlTraceInvalidTest extends CustomXmlTraceTest{
+
+    private final static String pathname = "testfiles/xml/invalid";
+
+    /**
+     * This should create the parameters to launch the project
+     *
+     * @return the path of the parameters
+     */
+    @Parameters(name = "{index}: path {0}")
+    public static Collection<Object[]> getFiles() {
+        File[] invalidFiles = (new File(pathname)).listFiles();
+        Collection<Object[]> params = new ArrayList<>();
+        for (File f : invalidFiles) {
+            Object[] arr = new Object[] { f.getAbsolutePath() };
+            params.add(arr);
+        }
+        return params;
+    }
+
+    /**
+     * ctor
+     *
+     * @param filePath
+     *            the path
+     */
+    public CustomXmlTraceInvalidTest(String filePath) {
+        setPath(filePath);
+    }
+
+    /**
+     * Test all the invalid xml files
+     */
+    @Test
+    public void testInvalid() {
+        IStatus invalid = getTrace().validate(null, getPath());
+
+        // Validation doesn't check for syntax errors. It returns a confidence
+        // of  0 and status OK if it is a text file for invalid xml files.
+        if ((IStatus.ERROR == invalid.getSeverity() ||
+                ((IStatus.OK == invalid.getSeverity() && (invalid instanceof TraceValidationStatus) && ((TraceValidationStatus) invalid).getConfidence() == 0)))) {
+            return;
+        }
+
+        fail(getPath());
+    }
+
+}
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomXmlTraceTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomXmlTraceTest.java
new file mode 100644 (file)
index 0000000..9804651
--- /dev/null
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2013, 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.tmf.core.tests.parsers.custom;
+
+import java.io.File;
+
+import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomXmlTrace;
+import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomXmlTraceDefinition;
+import org.junit.Before;
+
+/**
+ * Abstract test parent
+ *
+ * @author Matthew Khouzam
+ *
+ */
+public abstract class CustomXmlTraceTest {
+
+    private static final String DEFINITION_PATH = "testfiles" + File.separator + "xml" + File.separator + "testDefinition.xml";
+
+    private CustomXmlTraceDefinition cxtd;
+    /**
+     * The trace to use to "validate" the xml files
+     */
+    private CustomXmlTrace t;
+    /**
+     * The path of the trace
+     */
+    private String path;
+
+
+    /**
+     * set up directories
+     */
+    @Before
+    public void init() {
+        cxtd = createDefinition();
+        t = new CustomXmlTrace(cxtd);
+    }
+
+
+    /**
+     * @return the trace
+     */
+    public CustomXmlTrace getTrace() {
+        return t;
+    }
+
+
+    /**
+     * @return the path
+     */
+    public String getPath() {
+        return path;
+    }
+
+
+    /**
+     * @param path the path to set
+     */
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+    private static CustomXmlTraceDefinition createDefinition() {
+        CustomXmlTraceDefinition[] definitions = CustomXmlTraceDefinition.loadAll(new File(DEFINITION_PATH).toString());
+        return definitions[0];
+    }
+}
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomXmlTraceValidTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/parsers/custom/CustomXmlTraceValidTest.java
new file mode 100644 (file)
index 0000000..2d36204
--- /dev/null
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2013, 2015 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.tmf.core.tests.parsers.custom;
+
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.core.runtime.IStatus;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+/**
+ * Well formed XML
+ * @author Matthew Khouzam
+ *
+ */
+@RunWith(Parameterized.class)
+public class CustomXmlTraceValidTest extends CustomXmlTraceTest {
+
+    private final static String pathname = "testfiles/xml/valid";
+
+
+    /**
+     * This should create the parameters to launch the project
+     *
+     * @return the path of the parameters
+     */
+    @Parameters(name = "{index}: path {0}")
+    public static Collection<Object[]> getFiles() {
+        File[] validFiles = (new File(pathname)).listFiles();
+        Collection<Object[]> params = new ArrayList<>();
+        for (File f : validFiles) {
+            Object[] arr = new Object[] { f.getAbsolutePath() };
+            params.add(arr);
+        }
+        return params;
+    }
+
+    /**
+     * Test all the invalid xml files
+     */
+    @Test
+    public void testValid() {
+        IStatus valid = getTrace().validate(null, getPath());
+        if (IStatus.OK != valid.getSeverity()) {
+            fail(valid.toString());
+        }
+    }
+
+    /**
+     * ctor
+     *
+     * @param filePath
+     *            the path
+     */
+    public CustomXmlTraceValidTest(String filePath) {
+        this.setPath(filePath);
+    }
+
+}
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/txt/testTxtDefinition.xml b/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/txt/testTxtDefinition.xml
new file mode 100644 (file)
index 0000000..ee2f9cb
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<CustomTxtTraceDefinitionList>
+<Definition name="testtxt">
+<TimeStampOutputFormat>dd/MM/yyyy HH:mm:ss:SSS</TimeStampOutputFormat>
+<InputLine>
+<Cardinality max="2147483647" min="0"/>
+<RegEx>(\S*\s\S*) (.*\S)</RegEx>
+<InputData action="0" format="dd/MM/yyyy HH:mm:ss:SSS" name="Time Stamp"/>
+<InputData action="0" format="" name="Message"/>
+</InputLine>
+<OutputColumn name="Time Stamp"/>
+<OutputColumn name="Message"/>
+</Definition>
+</CustomTxtTraceDefinitionList>
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/001.xml b/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/001.xml
new file mode 100644 (file)
index 0000000..25c39f9
--- /dev/null
@@ -0,0 +1 @@
+<doc>\r
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/002.xml b/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/002.xml
new file mode 100644 (file)
index 0000000..25c39f9
--- /dev/null
@@ -0,0 +1 @@
+<doc>\r
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/003.xml b/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/003.xml
new file mode 100644 (file)
index 0000000..48e4b52
--- /dev/null
@@ -0,0 +1,2 @@
+<doc>\r
+</doc\r
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/004.xml b/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/004.xml
new file mode 100644 (file)
index 0000000..881c4fe
--- /dev/null
@@ -0,0 +1 @@
+This is text\r
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/005.xml b/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/005.xml
new file mode 100644 (file)
index 0000000..8ba45c2
--- /dev/null
@@ -0,0 +1 @@
+<do/c></do/c>\r
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/006.xml b/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/invalid/006.xml
new file mode 100644 (file)
index 0000000..ad5bca0
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc name="goose">
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/malformed/001.xml b/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/malformed/001.xml
new file mode 100644 (file)
index 0000000..cb2af83
--- /dev/null
@@ -0,0 +1 @@
+<doc><doc2></doc></doc2>
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/malformed/002.xml b/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/malformed/002.xml
new file mode 100644 (file)
index 0000000..fb35d3d
--- /dev/null
@@ -0,0 +1 @@
+<doc><book>Harry Potter</livre></doc>
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/malformed/003.xml b/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/malformed/003.xml
new file mode 100644 (file)
index 0000000..ba63bb6
--- /dev/null
@@ -0,0 +1 @@
+<doc><book>Harry Potter</book>A wizard did it</author></doc2>
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/testDefinition.xml b/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/testDefinition.xml
new file mode 100644 (file)
index 0000000..858f9d4
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<CustomXMLTraceDefinitionList>
+<Definition name="myxml">
+<TimeStampOutputFormat>HH:mm:ss:SSS</TimeStampOutputFormat>
+<InputElement name="trace">
+<InputElement logentry="true" name="element">
+<InputData action="0" format="" name="Message"/>
+<Attribute name="time">
+<InputData action="0" format="dd/MM/yyyy HH:mm:ss:SSS" name="Time Stamp"/>
+</Attribute>
+</InputElement>
+</InputElement>
+<OutputColumn name="Time Stamp"/>
+<OutputColumn name="Message"/>
+</Definition>
+</CustomXMLTraceDefinitionList>
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/valid/001.xml b/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/valid/001.xml
new file mode 100644 (file)
index 0000000..afa807c
--- /dev/null
@@ -0,0 +1 @@
+<doc></doc>
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/valid/002.xml b/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/valid/002.xml
new file mode 100644 (file)
index 0000000..6cd7309
--- /dev/null
@@ -0,0 +1 @@
+<doc attrib=""></doc>
diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/valid/003.xml b/tmf/org.eclipse.tracecompass.tmf.core.tests/testfiles/xml/valid/003.xml
new file mode 100644 (file)
index 0000000..a0723ad
--- /dev/null
@@ -0,0 +1 @@
+<doc attrib=""><elem/></doc>
index 0939799ff4dcde3623a04ef38d4ff909fb7db5af..61d8ad2594598c1957fc357cd9883284268dd5c4 100644 (file)
@@ -21,8 +21,8 @@ import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
 import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomTxtTraceDefinition;
+import org.eclipse.tracecompass.tmf.core.tests.TmfCoreTestPlugin;
 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
-import org.eclipse.tracecompass.tmf.ui.tests.TmfUITestPlugin;
 import org.junit.runner.RunWith;
 import org.osgi.framework.Bundle;
 
@@ -33,7 +33,7 @@ import org.osgi.framework.Bundle;
 public class TestRefreshCustomTextTrace extends TestRefreshTextTrace {
 
     private static final String TRACE_LOCATION = TmfTraceManager.getTemporaryDirPath() + File.separator + "test.txt";
-    private static final String DEFINITION_PATH = "tracesets" + File.separator + "txt" + File.separator + "testTxtDefinition.xml";
+    private static final String DEFINITION_PATH = "testfiles" + File.separator + "txt" + File.separator + "testTxtDefinition.xml";
     private static final String TRACE_TYPE_CUSTOM_TEXT = "custom.txt.trace:Custom Text:testtxt";
     private static final String TIMESTAMP_FORMAT = "dd/MM/yyyy HH:mm:ss:SSS";
 
@@ -51,7 +51,7 @@ public class TestRefreshCustomTextTrace extends TestRefreshTextTrace {
     }
 
     private static void createDefinition() throws URISyntaxException, IOException {
-        File file = getBundleFile(TmfUITestPlugin.getDefault().getBundle(), new Path(DEFINITION_PATH));
+        File file = getBundleFile(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DEFINITION_PATH));
         CustomTxtTraceDefinition[] definitions = CustomTxtTraceDefinition.loadAll(file.toString());
         for (CustomTxtTraceDefinition text : definitions) {
             text.save();
index a546457d62f0f15b971c174ea43385367bc5d9f0..8411bc37480c24bfa0688ecb37f54bfb4b2d4874 100644 (file)
@@ -19,7 +19,7 @@ bin.includes = META-INF/,\
                plugin.properties,\
                plugin.xml,\
                about.html,\
-               tracesets/txt/testTxtDefinition.xml
+               tracesets/
 src.includes = about.html
 additional.bundles = org.eclipse.jdt.annotation
 jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation
index e22463404c54d37b2034bdb6655d330b317cfc77..13beee5cc1797d233722832f09a1f1d0fe98a954 100644 (file)
@@ -26,7 +26,6 @@ import org.junit.runner.RunWith;
         org.eclipse.tracecompass.tmf.ui.tests.histogram.AllTests.class,
         org.eclipse.tracecompass.tmf.ui.tests.project.model.AllTests.class,
         org.eclipse.tracecompass.tmf.ui.tests.statistics.AllTests.class,
-        org.eclipse.tracecompass.tmf.ui.tests.trace.AllTests.class,
         org.eclipse.tracecompass.tmf.ui.tests.views.uml2sd.dialogs.AllTests.class,
         org.eclipse.tracecompass.tmf.ui.tests.views.uml2sd.load.AllTests.class,
         org.eclipse.tracecompass.tmf.ui.tests.views.uml2sd.loader.AllTests.class
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/AbstractCustomTraceIndexTest.java b/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/AbstractCustomTraceIndexTest.java
deleted file mode 100644 (file)
index 9ddad1f..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Marc-Andre Laperle - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.tests.trace;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-
-import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfEventParser;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.core.trace.TmfContext;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
-import org.eclipse.tracecompass.tmf.core.trace.indexer.TmfBTreeTraceIndexer;
-import org.eclipse.tracecompass.tmf.core.trace.indexer.checkpoint.ITmfCheckpoint;
-import org.eclipse.tracecompass.tmf.core.trace.indexer.checkpoint.ITmfCheckpointIndex;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Common test code for custom trace indexes
- *
- * @author Marc-Andre Laperle
- */
-public abstract class AbstractCustomTraceIndexTest {
-
-    /**
-     * Time format use for event creation
-     */
-    protected static final String TIMESTAMP_FORMAT = "dd/MM/yyyy HH:mm:ss:SSS";
-    /**
-     * Block size used for the indexer
-     */
-    protected static final int BLOCK_SIZE = 100;
-    /**
-     * The total number of events in the generated trace
-     */
-    protected static final int NB_EVENTS = 10000;
-    private static final long MILLISECOND_TO_NANOSECOND = 1000000;
-    private TestTrace fTrace = null;
-
-    /**
-     * A common test indexer for custom trace index tests
-     */
-    protected static class TestIndexer extends TmfBTreeTraceIndexer {
-
-        /**
-         * Constructs a new test indexer
-         *
-         * @param trace the trace
-         * @param interval the checkpoint interval
-         */
-        public TestIndexer(ITmfTrace trace, int interval) {
-            super(trace, interval);
-        }
-
-        /**
-         * Get the index
-         *
-         * @return the index
-         */
-        public ITmfCheckpointIndex getCheckpoints() {
-            return getTraceIndex();
-        }
-    }
-
-    interface TestTrace extends ITmfTrace {
-        TestIndexer getIndexer();
-    }
-
-    /**
-     * Setup the test
-     *
-     * @throws Exception when error occurs
-     */
-    @Before
-    public void setUp() throws Exception {
-        setupTrace();
-    }
-
-    private synchronized void setupTrace() throws Exception {
-        File traceDirectory = new File(getTraceDirectory());
-        if (traceDirectory.exists()) {
-            traceDirectory.delete();
-        }
-        traceDirectory.mkdir();
-        if (fTrace == null) {
-            fTrace = createTrace();
-            fTrace.indexTrace(true);
-        }
-    }
-
-    /**
-     * Create a test trace, varies between tests
-     *
-     * @return the test trace
-     * @throws Exception when error occurs
-     */
-    abstract protected TestTrace createTrace() throws Exception;
-    /**
-     * Return the trace directory for the generated trace
-     *
-     * @return the trace directory for the generated trace
-     */
-    abstract protected String getTraceDirectory();
-
-    /**
-     * Tear down the test
-     */
-    @After
-    public void tearDown() {
-        String directory = TmfTraceManager.getSupplementaryFileDir(fTrace);
-        try {
-            fTrace.dispose();
-            fTrace = null;
-        } finally {
-            File dir = new File(directory);
-            if (dir.exists()) {
-                File[] files = dir.listFiles();
-                for (File file : files) {
-                    file.delete();
-                }
-                dir.delete();
-            }
-
-            File trace = new File(getTraceDirectory());
-            if (trace.exists()) {
-                trace.delete();
-            }
-        }
-
-    }
-
-    /**
-     * Test the content of the index after building the full index
-     */
-    @Test
-    public void testTmfTraceIndexing() {
-        verifyIndexContent();
-    }
-
-    private void verifyIndexContent() {
-        long endTime = (NB_EVENTS - 1) * MILLISECOND_TO_NANOSECOND;
-        assertEquals("getCacheSize", BLOCK_SIZE, fTrace.getCacheSize());
-        assertEquals("getTraceSize", NB_EVENTS, fTrace.getNbEvents());
-        assertEquals("getRange-start", 0, fTrace.getTimeRange().getStartTime().getValue());
-        assertEquals("getRange-end", endTime, fTrace.getTimeRange().getEndTime().getValue());
-        assertEquals("getStartTime", 0, fTrace.getStartTime().getValue());
-        assertEquals("getEndTime", endTime, fTrace.getEndTime().getValue());
-
-        ITmfCheckpointIndex checkpoints = fTrace.getIndexer().getCheckpoints();
-        int pageSize = fTrace.getCacheSize();
-        assertTrue("Checkpoints exist", checkpoints != null);
-        assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE, checkpoints.size());
-
-        // Validate that each checkpoint points to the right event
-        for (int i = 0; i < checkpoints.size(); i++) {
-            ITmfCheckpoint checkpoint = checkpoints.get(i);
-            TmfContext context = new TmfContext(checkpoint.getLocation(), i * pageSize);
-            ITmfEvent event = ((ITmfEventParser)fTrace).parseEvent(context);
-            assertTrue(context.getRank() == i * pageSize);
-            assertTrue((checkpoint.getTimestamp().compareTo(event.getTimestamp()) == 0));
-        }
-    }
-
-    /**
-     * Test that a fully built index has the same content when reloaded from disk
-     *
-     * @throws Exception when error occurs
-     */
-    @Test
-    public void testReopenIndex() throws Exception {
-        fTrace.dispose();
-        fTrace = createTrace();
-        assertFalse(fTrace.getIndexer().getCheckpoints().isCreatedFromScratch());
-        fTrace.indexTrace(true);
-
-        verifyIndexContent();
-    }
-}
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/AllTests.java
deleted file mode 100644 (file)
index 0e30b92..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013, 2014 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Matthew Khouzam - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.tests.trace;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for custom parsers
- * @author Matthew Khouzam
- *
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
-        CustomXmlTraceInvalidTest.class,
-        CustomXmlTraceBadlyFormedTest.class,
-        CustomXmlTraceValidTest.class,
-        CustomXmlIndexTest.class,
-        CustomTxtIndexTest.class
-})
-public class AllTests {
-}
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomTxtIndexTest.java b/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomTxtIndexTest.java
deleted file mode 100644 (file)
index 82a5419..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2014 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Francois Chouinard - Initial API and implementation
- *   Francois Chouinard - Adapted for TMF Trace Model 1.0
- *   Alexandre Montplaisir - Port to JUnit4
- *   Marc-Andre Laperle - Adapted to CustomTxtTrace
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.tests.trace;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
-import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomTxtTrace;
-import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomTxtTraceDefinition;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
-import org.eclipse.tracecompass.tmf.core.trace.indexer.ITmfTraceIndexer;
-
-/**
- * Test suite for indexing using a CustomTxtTrace.
- *
- * @author Marc-Andre Laperle
- */
-public class CustomTxtIndexTest extends AbstractCustomTraceIndexTest {
-
-    private static final String TRACE_DIRECTORY = TmfTraceManager.getTemporaryDirPath() + File.separator + "dummyTxtTrace";
-    private static final String TRACE_PATH = TRACE_DIRECTORY + File.separator + "test.txt";
-    private static final String DEFINITION_PATH = "tracesets" + File.separator + "txt" + File.separator + "testTxtDefinition.xml";
-
-    private static CustomTxtTraceDefinition createDefinition() {
-        CustomTxtTraceDefinition[] definitions = CustomTxtTraceDefinition.loadAll(new File(DEFINITION_PATH).toString());
-        return definitions[0];
-    }
-
-    @Override
-    protected String getTraceDirectory() {
-        return TRACE_DIRECTORY;
-    }
-
-    @Override
-    protected TestTrace createTrace() throws Exception {
-        CustomTxtTraceDefinition definition = createDefinition();
-        final File file = new File(TRACE_PATH);
-        try (BufferedWriter writer = new BufferedWriter(new FileWriter(file));) {
-            for (int i = 0; i < NB_EVENTS; ++i) {
-                SimpleDateFormat f = new SimpleDateFormat(TIMESTAMP_FORMAT);
-                String eventStr = f.format(new Date(i)) + " hello world\n";
-                writer.write(eventStr);
-            }
-        }
-
-        return new TestTxtTrace(file.toString(), definition, BLOCK_SIZE);
-    }
-
-    private class TestTxtTrace extends CustomTxtTrace implements TestTrace {
-        public TestTxtTrace(String path, CustomTxtTraceDefinition createDefinition, int blockSize) throws TmfTraceException {
-            super(null, createDefinition, path, blockSize);
-        }
-
-        @Override
-        protected ITmfTraceIndexer createIndexer(int interval) {
-            return new TestIndexer(this, interval);
-        }
-
-        @Override
-        public TestIndexer getIndexer() {
-            return (TestIndexer) super.getIndexer();
-        }
-    }
-}
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomXmlIndexTest.java b/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomXmlIndexTest.java
deleted file mode 100644 (file)
index b7f6c3b..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2014 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Francois Chouinard - Initial API and implementation
- *   Francois Chouinard - Adapted for TMF Trace Model 1.0
- *   Alexandre Montplaisir - Port to JUnit4
- *   Marc-Andre Laperle - Adapted to CustomXmlTrace
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.tests.trace;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
-import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomXmlTrace;
-import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomXmlTraceDefinition;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
-import org.eclipse.tracecompass.tmf.core.trace.indexer.ITmfTraceIndexer;
-
-/**
- * Test suite for indexing using a CustomXmlTrace.
- *
- * @author Marc-Andre Laperle
- */
-public class CustomXmlIndexTest extends AbstractCustomTraceIndexTest {
-
-    private static final String TRACE_DIRECTORY = TmfTraceManager.getTemporaryDirPath() + File.separator + "dummyXmlTrace";
-    private static final String TRACE_PATH = TRACE_DIRECTORY + File.separator + "test.xml";
-    private static final String DEFINITION_PATH = "tracesets" + File.separator + "xml" + File.separator + "testDefinition.xml";
-
-    private static CustomXmlTraceDefinition createDefinition() {
-        CustomXmlTraceDefinition[] definitions = CustomXmlTraceDefinition.loadAll(new File(DEFINITION_PATH).toString());
-        return definitions[0];
-    }
-
-    @Override
-    protected String getTraceDirectory() {
-        return TRACE_DIRECTORY;
-    }
-
-    @Override
-    protected TestTrace createTrace() throws Exception {
-        CustomXmlTraceDefinition definition = createDefinition();
-        final File file = new File(TRACE_PATH);
-        try (BufferedWriter writer = new BufferedWriter(new FileWriter(file));) {
-            writer.write("<trace>");
-            for (int i = 0; i < NB_EVENTS; ++i) {
-                SimpleDateFormat f = new SimpleDateFormat(TIMESTAMP_FORMAT);
-                String eventStr = "<element time=\"" + f.format(new Date(i)) + "\">message</element>\n";
-                writer.write(eventStr);
-            }
-            writer.write("</trace>");
-        }
-
-        return new TestXmlTrace(file.toString(), definition, BLOCK_SIZE);
-    }
-
-    private class TestXmlTrace extends CustomXmlTrace implements TestTrace {
-        public TestXmlTrace(String path, CustomXmlTraceDefinition createDefinition, int blockSize) throws TmfTraceException {
-            super(null, createDefinition, path, blockSize);
-        }
-
-        @Override
-        protected ITmfTraceIndexer createIndexer(int interval) {
-            return new TestIndexer(this, interval);
-        }
-
-        @Override
-        public TestIndexer getIndexer() {
-            return (TestIndexer) super.getIndexer();
-        }
-    }
-}
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomXmlTraceBadlyFormedTest.java b/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomXmlTraceBadlyFormedTest.java
deleted file mode 100644 (file)
index 4ea6b6f..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Matthew Khouzam - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.tests.trace;
-
-import static org.junit.Assert.fail;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.tracecompass.tmf.core.trace.TraceValidationStatus;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-/**
- * Malformed xml test, dangerous errors
- * @author Matthew Khouzam
- *
- */
-@RunWith(Parameterized.class)
-public class CustomXmlTraceBadlyFormedTest extends CustomXmlTraceTest {
-
-    private final static String pathname = "tracesets/xml/malformed";
-
-    /**
-     * This should create the parameters to launch the project
-     *
-     * @return the path of the parameters
-     */
-    @Parameters(name = "{index}: path {0}")
-    public static Collection<Object[]> getFiles() {
-        File[] malformedFiles = (new File(pathname)).listFiles();
-        Collection<Object[]> params = new ArrayList<>();
-        for (File f : malformedFiles) {
-            Object[] arr = new Object[] { f.getAbsolutePath() };
-            params.add(arr);
-        }
-        return params;
-    }
-
-    /**
-     * Test all the invalid xml files
-     */
-    @Test
-    public void testBadlyFormed() {
-        IStatus invalid = getTrace().validate(null, getPath());
-        // Validation doesn't check for syntax errors. It returns a confidence
-        // of  0 and status OK if it is a text file for malformed xml files.
-        if ((IStatus.ERROR == invalid.getSeverity() ||
-                ((IStatus.OK == invalid.getSeverity() && (invalid instanceof TraceValidationStatus) && ((TraceValidationStatus) invalid).getConfidence() == 0)))) {
-            return;
-        }
-        fail(getPath());
-    }
-
-    /**
-     * ctor
-     *
-     * @param filePath
-     *            the path
-     */
-    public CustomXmlTraceBadlyFormedTest(String filePath) {
-        this.setPath(filePath);
-    }
-
-}
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomXmlTraceInvalidTest.java b/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomXmlTraceInvalidTest.java
deleted file mode 100644 (file)
index 9fe9e62..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Matthew Khouzam - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.tests.trace;
-
-import static org.junit.Assert.fail;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.tracecompass.tmf.core.trace.TraceValidationStatus;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-/**
- * Invalid Xml files, random errors
- *
- * @author Matthew Khouzam
- *
- */
-@RunWith(Parameterized.class)
-public class CustomXmlTraceInvalidTest extends CustomXmlTraceTest{
-
-    private final static String pathname = "tracesets/xml/invalid";
-
-    /**
-     * This should create the parameters to launch the project
-     *
-     * @return the path of the parameters
-     */
-    @Parameters(name = "{index}: path {0}")
-    public static Collection<Object[]> getFiles() {
-        File[] invalidFiles = (new File(pathname)).listFiles();
-        Collection<Object[]> params = new ArrayList<>();
-        for (File f : invalidFiles) {
-            Object[] arr = new Object[] { f.getAbsolutePath() };
-            params.add(arr);
-        }
-        return params;
-    }
-
-    /**
-     * ctor
-     *
-     * @param filePath
-     *            the path
-     */
-    public CustomXmlTraceInvalidTest(String filePath) {
-        setPath(filePath);
-    }
-
-    /**
-     * Test all the invalid xml files
-     */
-    @Test
-    public void testInvalid() {
-        IStatus invalid = getTrace().validate(null, getPath());
-
-        // Validation doesn't check for syntax errors. It returns a confidence
-        // of  0 and status OK if it is a text file for invalid xml files.
-        if ((IStatus.ERROR == invalid.getSeverity() ||
-                ((IStatus.OK == invalid.getSeverity() && (invalid instanceof TraceValidationStatus) && ((TraceValidationStatus) invalid).getConfidence() == 0)))) {
-            return;
-        }
-
-        fail(getPath());
-    }
-
-}
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomXmlTraceTest.java b/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomXmlTraceTest.java
deleted file mode 100644 (file)
index b483b6c..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013, 2015 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Matthew Khouzam - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.tests.trace;
-
-import java.io.File;
-
-import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomXmlTrace;
-import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomXmlTraceDefinition;
-import org.junit.Before;
-
-/**
- * Abstract test parent
- *
- * @author Matthew Khouzam
- *
- */
-public abstract class CustomXmlTraceTest {
-
-    private static final String DEFINITION_PATH = "tracesets" + File.separator + "xml" + File.separator + "testDefinition.xml";
-
-    private CustomXmlTraceDefinition cxtd;
-    /**
-     * The trace to use to "validate" the xml files
-     */
-    private CustomXmlTrace t;
-    /**
-     * The path of the trace
-     */
-    private String path;
-
-
-    /**
-     * set up directories
-     */
-    @Before
-    public void init() {
-        cxtd = createDefinition();
-        t = new CustomXmlTrace(cxtd);
-    }
-
-
-    /**
-     * @return the trace
-     */
-    public CustomXmlTrace getTrace() {
-        return t;
-    }
-
-
-    /**
-     * @return the path
-     */
-    public String getPath() {
-        return path;
-    }
-
-
-    /**
-     * @param path the path to set
-     */
-    public void setPath(String path) {
-        this.path = path;
-    }
-
-    private static CustomXmlTraceDefinition createDefinition() {
-        CustomXmlTraceDefinition[] definitions = CustomXmlTraceDefinition.loadAll(new File(DEFINITION_PATH).toString());
-        return definitions[0];
-    }
-}
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomXmlTraceValidTest.java b/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/trace/CustomXmlTraceValidTest.java
deleted file mode 100644 (file)
index 4c75e80..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013, 2014 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Matthew Khouzam - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.tests.trace;
-
-import static org.junit.Assert.fail;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.core.runtime.IStatus;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-/**
- * Well formed XML
- * @author Matthew Khouzam
- *
- */
-@RunWith(Parameterized.class)
-public class CustomXmlTraceValidTest extends CustomXmlTraceTest {
-
-    private final static String pathname = "tracesets/xml/valid";
-
-
-    /**
-     * This should create the parameters to launch the project
-     *
-     * @return the path of the parameters
-     */
-    @Parameters(name = "{index}: path {0}")
-    public static Collection<Object[]> getFiles() {
-        File[] validFiles = (new File(pathname)).listFiles();
-        Collection<Object[]> params = new ArrayList<>();
-        for (File f : validFiles) {
-            Object[] arr = new Object[] { f.getAbsolutePath() };
-            params.add(arr);
-        }
-        return params;
-    }
-
-    /**
-     * Test all the invalid xml files
-     */
-    @Test
-    public void testValid() {
-        IStatus valid = getTrace().validate(null, getPath());
-        if (IStatus.OK != valid.getSeverity()) {
-            fail(valid.toString());
-        }
-    }
-
-    /**
-     * ctor
-     *
-     * @param filePath
-     *            the path
-     */
-    public CustomXmlTraceValidTest(String filePath) {
-        this.setPath(filePath);
-    }
-
-}
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/txt/testTxtDefinition.xml b/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/txt/testTxtDefinition.xml
deleted file mode 100644 (file)
index ee2f9cb..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<CustomTxtTraceDefinitionList>
-<Definition name="testtxt">
-<TimeStampOutputFormat>dd/MM/yyyy HH:mm:ss:SSS</TimeStampOutputFormat>
-<InputLine>
-<Cardinality max="2147483647" min="0"/>
-<RegEx>(\S*\s\S*) (.*\S)</RegEx>
-<InputData action="0" format="dd/MM/yyyy HH:mm:ss:SSS" name="Time Stamp"/>
-<InputData action="0" format="" name="Message"/>
-</InputLine>
-<OutputColumn name="Time Stamp"/>
-<OutputColumn name="Message"/>
-</Definition>
-</CustomTxtTraceDefinitionList>
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/001.xml b/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/001.xml
deleted file mode 100644 (file)
index 25c39f9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<doc>\r
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/002.xml b/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/002.xml
deleted file mode 100644 (file)
index 25c39f9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<doc>\r
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/003.xml b/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/003.xml
deleted file mode 100644 (file)
index 48e4b52..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-<doc>\r
-</doc\r
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/004.xml b/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/004.xml
deleted file mode 100644 (file)
index 881c4fe..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This is text\r
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/005.xml b/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/005.xml
deleted file mode 100644 (file)
index 8ba45c2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<do/c></do/c>\r
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/006.xml b/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/invalid/006.xml
deleted file mode 100644 (file)
index ad5bca0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<doc></doc name="goose">
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/malformed/001.xml b/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/malformed/001.xml
deleted file mode 100644 (file)
index cb2af83..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<doc><doc2></doc></doc2>
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/malformed/002.xml b/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/malformed/002.xml
deleted file mode 100644 (file)
index fb35d3d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<doc><book>Harry Potter</livre></doc>
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/malformed/003.xml b/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/malformed/003.xml
deleted file mode 100644 (file)
index ba63bb6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<doc><book>Harry Potter</book>A wizard did it</author></doc2>
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/testDefinition.xml b/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/testDefinition.xml
deleted file mode 100644 (file)
index 858f9d4..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<CustomXMLTraceDefinitionList>
-<Definition name="myxml">
-<TimeStampOutputFormat>HH:mm:ss:SSS</TimeStampOutputFormat>
-<InputElement name="trace">
-<InputElement logentry="true" name="element">
-<InputData action="0" format="" name="Message"/>
-<Attribute name="time">
-<InputData action="0" format="dd/MM/yyyy HH:mm:ss:SSS" name="Time Stamp"/>
-</Attribute>
-</InputElement>
-</InputElement>
-<OutputColumn name="Time Stamp"/>
-<OutputColumn name="Message"/>
-</Definition>
-</CustomXMLTraceDefinitionList>
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/valid/001.xml b/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/valid/001.xml
deleted file mode 100644 (file)
index afa807c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<doc></doc>
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/valid/002.xml b/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/valid/002.xml
deleted file mode 100644 (file)
index 6cd7309..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<doc attrib=""></doc>
diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/valid/003.xml b/tmf/org.eclipse.tracecompass.tmf.ui.tests/tracesets/xml/valid/003.xml
deleted file mode 100644 (file)
index a0723ad..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<doc attrib=""><elem/></doc>
This page took 0.051553 seconds and 5 git commands to generate.