Runs a test suite present in `releng/org.eclipse.tracecompass.alltests`. The
test suite to run has to be defined by `-DcustomTestSuite=[name]`, for example
- `-DcustomTestSuite=RunAllCoreTests`.
+ `-DcustomTestSuite=RunAllPerfTests`.
* `-Pdeploy-rcp`
<name>Trace Compass Graph Analysis Core Test plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <version>${tycho-version}</version>
- <configuration>
- <testSuite>org.eclipse.tracecompass.analysis.graph.core.tests</testSuite>
- <testClass>org.eclipse.tracecompass.analysis.graph.core.tests.AllAnalysisGraphCoreTests</testClass>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.sdk.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2015 École Polytechnique de Montréal
- *
- * 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
- *******************************************************************************/
-
-package org.eclipse.tracecompass.analysis.graph.core.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Master test suite for this plugin
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- org.eclipse.tracecompass.analysis.graph.core.tests.analysis.criticalpath.AllTests.class,
- org.eclipse.tracecompass.analysis.graph.core.tests.graph.AllTests.class
-})
-public class AllAnalysisGraphCoreTests {
-
-}
-
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2015 École Polytechnique de Montréal
- *
- * 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
- *******************************************************************************/
-
-package org.eclipse.tracecompass.analysis.graph.core.tests.analysis.criticalpath;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for the critical path package
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfCriticalPathAlgoBoundedTest.class,
-})
-public class AllTests {
-
-}
-
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2015 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.analysis.graph.core.tests.graph;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for graph package
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfGraphTest.class,
- TmfGraphBuilderModuleTest.class
-})
-public class AllTests {
-
-}
<name>Trace Compass Linux Kernel Analysis Core Tests Plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>prepare</id>
- <phase>validate</phase>
- <configuration>
- <target>
- <echo message="prepare phase" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <includes>
- <include>**/AllTests.*</include>
- </includes>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 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
- *******************************************************************************/
-
-package org.eclipse.tracecompass.analysis.os.linux.core.tests;
-
-import org.eclipse.tracecompass.tmf.core.tests.shared.DebugSuite;
-import org.junit.runner.RunWith;
-
-/**
- * Runner for the unit tests of this plugin
- */
-@RunWith(DebugSuite.class)
-@DebugSuite.SuiteClasses({
- org.eclipse.tracecompass.analysis.os.linux.core.tests.cpuusage.AllTests.class,
- org.eclipse.tracecompass.analysis.os.linux.core.tests.kernelanalysis.AllTests.class,
- org.eclipse.tracecompass.analysis.os.linux.core.tests.latency.AllTests.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014, 2015 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.analysis.os.linux.core.tests.cpuusage;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for the CPU usage package
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CpuUsageStateProviderTest.class
-})
-public class AllTests {
-
-}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.analysis.os.linux.core.tests.kernelanalysis;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- KernelStateProviderTest.class,
- KernelThreadInformationProviderTest.class,
- KernelTidAspectTest.class
-})
-public class AllTests {
-
-}
\ No newline at end of file
<name>Best Trace Format Tests Plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <testSuite>org.eclipse.tracecompass.btf.core.tests</testSuite>
- <testClass>org.eclipse.tracecompass.btf.core.tests.AllTests</testClass>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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.btf.core.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Master test suite for BTF.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- org.eclipse.tracecompass.btf.core.tests.trace.BtfTraceTest.class
-})
-public class AllTests {
-
-}
<name>Trace Compass Common Utilities Core Tests Plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <testSuite>org.eclipse.tracecompass.common.core.tests</testSuite>
- <testClass>org.eclipse.tracecompass.common.core.tests.AllCommonCoreTests</testClass>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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.common.core.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Master test suite for Common Core.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- NonNullUtilsTest.class,
- org.eclipse.tracecompass.common.core.tests.ObjectUtilsTest.class,
- org.eclipse.tracecompass.common.core.tests.collect.AllTests.class
-})
-public class AllCommonCoreTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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.common.core.tests.collect;
-
-import org.eclipse.tracecompass.common.core.tests.collect.BufferedBlockingQueueTest;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Master test suite for Common Core.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- BufferedBlockingQueueTest.class,
- StreamFlattenerTest.class
-})
-public class AllTests {
-
-}
org.eclipse.tracecompass.ctf.core.tests.ctftestsuite;x-internal:=true,
org.eclipse.tracecompass.ctf.core.tests.event;x-internal:=true,
org.eclipse.tracecompass.ctf.core.tests.io;x-internal:=true,
- org.eclipse.tracecompass.ctf.core.tests.perf,
- org.eclipse.tracecompass.ctf.core.tests.perf.trace;x-internal:=true,
+ org.eclipse.tracecompass.ctf.core.tests.perf.trace,
org.eclipse.tracecompass.ctf.core.tests.scope,
org.eclipse.tracecompass.ctf.core.tests.shared,
org.eclipse.tracecompass.ctf.core.tests.trace;x-internal:=true,
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Alexandre Montplaisir - Initial implementation and API
- *******************************************************************************/
-
-package org.eclipse.tracecompass.ctf.core.tests.perf;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Run all performance test suites.
- *
- * @author Alexandre Montplaisir
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- org.eclipse.tracecompass.ctf.core.tests.perf.trace.AllPerfTests.class
-})
-public class AllPerfTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.ctf.core.tests.perf.trace;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TraceReadBenchmark.class,
- TraceSeekBenchmark.class
-})
-public class AllPerfTests {
-}
<build>
<plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <includes>
- <include>**/AllCtfCoreTests.*</include>
- </includes>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
-
<!-- We don't use the ant file to clean because of http://jira.codehaus.org/browse/MANTRUN-78 -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
+++ /dev/null
-/*******************************************************************************
- * 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.ctf.core.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * The class <code>TestAll</code> builds a suite that can be used to run all of
- * the tests within its package as well as within any subpackages of its
- * package.
- *
- * @author ematkho
- * @version 1.0
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CtfCorePluginTest.class,
- org.eclipse.tracecompass.ctf.core.tests.ctftestsuite.TestAll.class,
- org.eclipse.tracecompass.ctf.core.tests.event.TestAll.class,
- org.eclipse.tracecompass.ctf.core.tests.io.TestAll.class,
- org.eclipse.tracecompass.ctf.core.tests.scope.TestAll.class,
- org.eclipse.tracecompass.ctf.core.tests.trace.TestAll.class,
- org.eclipse.tracecompass.ctf.core.tests.types.TestAll.class
-})
-public class AllCtfCoreTests {
-}
--- /dev/null
+/*******************************************************************************
+ * 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:
+ * Alexandre Montplaisir - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.ctf.core.tests.ctftestsuite;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import org.eclipse.tracecompass.ctf.core.CTFException;
+import org.eclipse.tracecompass.ctf.core.trace.CTFTrace;
+import org.eclipse.tracecompass.ctf.core.trace.CTFTraceReader;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestRule;
+import org.junit.rules.Timeout;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+/**
+ * Parameterized test class running the CTF Test Suite
+ *
+ * (from https://github.com/efficios/ctf-testsuite).
+ *
+ * @author Alexandre Montplaisir
+ */
+@RunWith(Parameterized.class)
+public class CtfTestSuiteTest {
+
+ /** Time-out tests after 10 seconds. */
+ @Rule
+ public TestRule globalTimeout = new Timeout(10, TimeUnit.SECONDS);
+
+ private static final Path BASE_PATH = Paths.get("traces", "ctf-testsuite", "tests", "1.8");
+
+ /**
+ * Test we know are currently failing. Ignore them so we can at least run
+ * the others.
+ *
+ * TODO Actually fix them!
+ */
+ private static final Path[] IGNORED_TESTS = {
+ BASE_PATH.resolve(Paths.get("regression", "metadata", "pass", "sequence-typedef-length")),
+ BASE_PATH.resolve(Paths.get("regression", "metadata", "pass", "array-of-struct")),
+ BASE_PATH.resolve(Paths.get("regression", "stream", "pass", "integer-large-size")),
+ };
+
+ private final String fTracePath;
+ private final boolean fExpectSuccess;
+
+ // ------------------------------------------------------------------------
+ // Methods for the Parametrized runner
+ // ------------------------------------------------------------------------
+
+ /**
+ * Get the existing trace paths in the CTF-Testsuite git tree.
+ *
+ * @return The list of CTF traces (directories) to test
+ */
+ @Parameters(name = "{index}: {0}")
+ public static Iterable<Object[]> getTracePaths() {
+ final List<Object[]> dirs = new LinkedList<>();
+
+ addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("fuzzing", "metadata", "fail")), false);
+ addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("fuzzing", "metadata", "pass")), true);
+ addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("fuzzing", "stream", "fail")), false);
+ addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("fuzzing", "stream", "pass")), true);
+
+ addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("regression", "metadata", "fail")), false);
+ addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("regression", "metadata", "pass")), true);
+ addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("regression", "stream", "fail")), false);
+ addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("regression", "stream", "pass")), true);
+
+ addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("stress", "metadata", "fail")), false);
+ addDirsOneLevelDeepFrom(dirs, BASE_PATH.resolve(Paths.get("stress", "metadata", "pass")), true);
+ addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("stress", "stream", "fail")), false);
+ addDirsOneLevelDeepFrom(dirs, BASE_PATH.resolve(Paths.get("stress", "stream", "pass")), true);
+
+ return dirs;
+ }
+
+ private static void addDirsFrom(List<Object[]> dirs, Path path, boolean expectSuccess) {
+ if (!Files.exists(path)) {
+ /* Some planned directories may not exist yet in the test suite */
+ return;
+ }
+ try (DirectoryStream<Path> ds = Files.newDirectoryStream(path, DIR_FILTER);) {
+ for (Path p : ds) {
+ /* Add this test case to the list of tests to run */
+ Object array[] = new Object[] { p.toString(), expectSuccess };
+ dirs.add(array);
+ }
+ } catch (IOException e) {
+ /* Something is wrong with the layout of the test suite? */
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Some test traces are not in pass/trace1, pass/trace2, etc. but rather
+ * pass/test1/trace1, pass/test1/trace2, etc.
+ *
+ * This methods adds the directories one level "down" instead of the very
+ * next level.
+ */
+ private static void addDirsOneLevelDeepFrom(List<Object[]> dirs, Path path,
+ boolean expectSuccess) {
+ if (!Files.exists(path)) {
+ return;
+ }
+ try (DirectoryStream<Path> ds = Files.newDirectoryStream(path, DIR_FILTER);) {
+ for (Path p : ds) {
+ addDirsFrom(dirs, p, expectSuccess);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private static final DirectoryStream.Filter<Path> DIR_FILTER =
+ new DirectoryStream.Filter<Path>() {
+ @Override
+ public boolean accept(Path entry) {
+ /* Only accept directories and non-blacklisted tests */
+ if (!Files.isDirectory(entry)) {
+ return false;
+ }
+ for (Path ignoredTestPath : IGNORED_TESTS) {
+ if (entry.equals(ignoredTestPath)) {
+ System.err.println("Skipping test " + entry.toString() + " as requested.");
+ return false;
+ }
+ }
+ return true;
+ }
+ };
+
+ // ------------------------------------------------------------------------
+ // Test constructor
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructor for the parametrized tests
+ *
+ * @param tracePath
+ * The complete path to the trace to test
+ * @param expectSuccess
+ * Should this trace parse successfully, or not.
+ */
+ public CtfTestSuiteTest(String tracePath, boolean expectSuccess) {
+ fTracePath = tracePath;
+ fExpectSuccess = expectSuccess;
+ }
+
+ // ------------------------------------------------------------------------
+ // Test methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Test opening and reading the trace
+ */
+ @Test
+ public void testTrace() {
+ try {
+ /* Instantiate the trace (which implies parsing the metadata) */
+ CTFTrace trace = new CTFTrace(fTracePath);
+ /* Read the trace until the end */
+ try (CTFTraceReader reader = new CTFTraceReader(trace);) {
+
+ reader.getCurrentEventDef();
+ while (reader.advance()) {
+ assertNotNull(reader.getCurrentEventDef());
+ }
+
+ checkIfWeShoudlSucceed();
+ }
+ } catch (CTFException e) {
+ checkIfWeShouldFail(e);
+ } catch (OutOfMemoryError e) {
+ checkIfWeShouldFail(e);
+ }
+ }
+
+ private void checkIfWeShoudlSucceed() {
+ if (!fExpectSuccess) {
+ fail("Trace was expected to fail parsing: " + fTracePath);
+ }
+ }
+
+ private void checkIfWeShouldFail(Throwable e) {
+ if (fExpectSuccess) {
+ fail("Trace was expected to succeed, but failed parsing: " +
+ fTracePath + " (" + e.getMessage() + ")");
+ }
+ }
+}
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.ctf.core.tests.ctftestsuite;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-import java.nio.file.DirectoryStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-import org.eclipse.tracecompass.ctf.core.CTFException;
-import org.eclipse.tracecompass.ctf.core.trace.CTFTrace;
-import org.eclipse.tracecompass.ctf.core.trace.CTFTraceReader;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TestRule;
-import org.junit.rules.Timeout;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-/**
- * Parameterized test class running the CTF Test Suite
- *
- * (from https://github.com/efficios/ctf-testsuite).
- *
- * @author Alexandre Montplaisir
- */
-@RunWith(Parameterized.class)
-public class CtfTestSuiteTests {
-
- /** Time-out tests after 10 seconds. */
- @Rule
- public TestRule globalTimeout = new Timeout(10, TimeUnit.SECONDS);
-
- private static final Path BASE_PATH = Paths.get("traces", "ctf-testsuite", "tests", "1.8");
-
- /**
- * Test we know are currently failing. Ignore them so we can at least run
- * the others.
- *
- * TODO Actually fix them!
- */
- private static final Path[] IGNORED_TESTS = {
- BASE_PATH.resolve(Paths.get("regression", "metadata", "pass", "sequence-typedef-length")),
- BASE_PATH.resolve(Paths.get("regression", "metadata", "pass", "array-of-struct")),
- BASE_PATH.resolve(Paths.get("regression", "stream", "pass", "integer-large-size")),
- };
-
- private final String fTracePath;
- private final boolean fExpectSuccess;
-
- // ------------------------------------------------------------------------
- // Methods for the Parametrized runner
- // ------------------------------------------------------------------------
-
- /**
- * Get the existing trace paths in the CTF-Testsuite git tree.
- *
- * @return The list of CTF traces (directories) to test
- */
- @Parameters(name = "{index}: {0}")
- public static Iterable<Object[]> getTracePaths() {
- final List<Object[]> dirs = new LinkedList<>();
-
- addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("fuzzing", "metadata", "fail")), false);
- addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("fuzzing", "metadata", "pass")), true);
- addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("fuzzing", "stream", "fail")), false);
- addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("fuzzing", "stream", "pass")), true);
-
- addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("regression", "metadata", "fail")), false);
- addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("regression", "metadata", "pass")), true);
- addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("regression", "stream", "fail")), false);
- addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("regression", "stream", "pass")), true);
-
- addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("stress", "metadata", "fail")), false);
- addDirsOneLevelDeepFrom(dirs, BASE_PATH.resolve(Paths.get("stress", "metadata", "pass")), true);
- addDirsFrom(dirs, BASE_PATH.resolve(Paths.get("stress", "stream", "fail")), false);
- addDirsOneLevelDeepFrom(dirs, BASE_PATH.resolve(Paths.get("stress", "stream", "pass")), true);
-
- return dirs;
- }
-
- private static void addDirsFrom(List<Object[]> dirs, Path path, boolean expectSuccess) {
- if (!Files.exists(path)) {
- /* Some planned directories may not exist yet in the test suite */
- return;
- }
- try (DirectoryStream<Path> ds = Files.newDirectoryStream(path, DIR_FILTER);) {
- for (Path p : ds) {
- /* Add this test case to the list of tests to run */
- Object array[] = new Object[] { p.toString(), expectSuccess };
- dirs.add(array);
- }
- } catch (IOException e) {
- /* Something is wrong with the layout of the test suite? */
- e.printStackTrace();
- }
- }
-
- /**
- * Some test traces are not in pass/trace1, pass/trace2, etc. but rather
- * pass/test1/trace1, pass/test1/trace2, etc.
- *
- * This methods adds the directories one level "down" instead of the very
- * next level.
- */
- private static void addDirsOneLevelDeepFrom(List<Object[]> dirs, Path path,
- boolean expectSuccess) {
- if (!Files.exists(path)) {
- return;
- }
- try (DirectoryStream<Path> ds = Files.newDirectoryStream(path, DIR_FILTER);) {
- for (Path p : ds) {
- addDirsFrom(dirs, p, expectSuccess);
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- private static final DirectoryStream.Filter<Path> DIR_FILTER =
- new DirectoryStream.Filter<Path>() {
- @Override
- public boolean accept(Path entry) {
- /* Only accept directories and non-blacklisted tests */
- if (!Files.isDirectory(entry)) {
- return false;
- }
- for (Path ignoredTestPath : IGNORED_TESTS) {
- if (entry.equals(ignoredTestPath)) {
- System.err.println("Skipping test " + entry.toString() + " as requested.");
- return false;
- }
- }
- return true;
- }
- };
-
- // ------------------------------------------------------------------------
- // Test constructor
- // ------------------------------------------------------------------------
-
- /**
- * Constructor for the parametrized tests
- *
- * @param tracePath
- * The complete path to the trace to test
- * @param expectSuccess
- * Should this trace parse successfully, or not.
- */
- public CtfTestSuiteTests(String tracePath, boolean expectSuccess) {
- fTracePath = tracePath;
- fExpectSuccess = expectSuccess;
- }
-
- // ------------------------------------------------------------------------
- // Test methods
- // ------------------------------------------------------------------------
-
- /**
- * Test opening and reading the trace
- */
- @Test
- public void testTrace() {
- try {
- /* Instantiate the trace (which implies parsing the metadata) */
- CTFTrace trace = new CTFTrace(fTracePath);
- /* Read the trace until the end */
- try (CTFTraceReader reader = new CTFTraceReader(trace);) {
-
- reader.getCurrentEventDef();
- while (reader.advance()) {
- assertNotNull(reader.getCurrentEventDef());
- }
-
- checkIfWeShoudlSucceed();
- }
- } catch (CTFException e) {
- checkIfWeShouldFail(e);
- } catch (OutOfMemoryError e) {
- checkIfWeShouldFail(e);
- }
- }
-
- private void checkIfWeShoudlSucceed() {
- if (!fExpectSuccess) {
- fail("Trace was expected to fail parsing: " + fTracePath);
- }
- }
-
- private void checkIfWeShouldFail(Throwable e) {
- if (fExpectSuccess) {
- fail("Trace was expected to succeed, but failed parsing: " +
- fTracePath + " (" + e.getMessage() + ")");
- }
- }
-}
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.ctf.core.tests.ctftestsuite;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * The class <code>TestAll</code> builds a suite that can be used to run all of
- * the tests within its package as well as within any subpackages of its
- * package.
- *
- * @author ematkho
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CtfTestSuiteTests.class
-})
-public class TestAll {
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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.ctf.core.tests.event;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * The class <code>TestAll</code> builds a suite that can be used to run all of
- * the tests within its package as well as within any subpackages of its
- * package.
- *
- * @author ematkho
- * @version $Revision: 1.0 $
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CTFEventDefinitionTest.class,
- CTFEventFieldTest.class
-})
-public class TestAll {
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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.ctf.core.tests.io;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * The class <code>TestAll</code> builds a suite that can be used to run all of
- * the tests within its package as well as within any subpackages of its
- * package.
- *
- * @author ematkho
- * @version $Revision: 1.0 $
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- BitBufferIntTest.class,
- BitBufferTest.class
-})
-public class TestAll {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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.ctf.core.tests.scope;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * The class <code>TestAll</code> builds a suite that can be used to run all of
- * the tests within its package as well as within any subpackages of its
- * package.
- *
- * @author Matthew Khouzam
- * @version $Revision: 1.0 $
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- LexicalScopeTest.class
-})
-public class TestAll {
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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.ctf.core.tests.trace;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * The class <code>TestAll</code> builds a suite that can be used to run all of
- * the tests within its package as well as within any subpackages of its
- * package.
- *
- * @author Matthew Khouzam
- * @version $Revision: 1.0 $
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CTFPacketReaderTest.class,
- CTFTraceReaderTest.class,
- CTFTraceTest.class,
- CTFTraceGrowingTest.class,
- IOstructgenTest.class,
- MetadataTest.class,
- MetadataPrevalidationTests.class,
- CTFStreamInputPacketIndexEntryTest.class,
- CTFStreamInputPacketIndexTest.class,
- CTFStreamInputReaderTest.class,
- CTFStreamInputReaderTimestampComparatorTest.class,
- CTFStreamInputTest.class,
- CTFStreamTest.class,
- CTFTraceWriterTest.class,
- TraceReadAllTracesTest.class,
- UtilsTest.class
-})
-public class TestAll {
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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.ctf.core.tests.types;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * The class <code>TestAll</code> builds a suite that can be used to run all of
- * the tests within its package as well as within any subpackages of its
- * package.
- *
- * @author ematkho
- * @version $Revision: 1.0 $
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- ArrayDeclaration2Test.class,
- ArrayDefinition2Test.class,
- DefinitionTest.class,
- EnumDeclarationTest.class,
- EnumDefinitionTest.class,
- EventDeclarationTest.class,
- EventHeaderDeclarationTest.class,
- FloatDeclarationTest.class,
- FloatDefinitionTest.class,
- IntegerDeclarationTest.class,
- IntegerDefinitionTest.class,
- IntegerEndiannessTest.class,
- SequenceDeclaration2Test.class,
- SequenceDefinition2Test.class,
- StringDeclarationTest.class,
- StringDefinitionTest.class,
- StructDeclarationTest.class,
- StructDefinitionTest.class,
- VariantDeclarationTest.class,
- VariantDefinitionTest.class,
-})
-public class TestAll {
-
-}
<name>Trace Compass CTF Parser Tests Plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <testSuite>org.eclipse.tracecompass.ctf.parser.tests</testSuite>
- <testClass>org.eclipse.tracecompass.ctf.parser.tests.AllCtfParserTests</testClass>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Etienne Bergeron - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.ctf.parser.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Master test suite for CTF parser.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CtfLexerTest.class,
- CtfParserTest.class
-})
-
-public class AllCtfParserTests {
-
-}
org.eclipse.tracecompass.tmf.ctf.core,
org.eclipse.tracecompass.ctf.core,
org.eclipse.tracecompass.ctf.core.tests
-Export-Package: org.eclipse.tracecompass.tmf.ctf.core.tests,
- org.eclipse.tracecompass.tmf.ctf.core.tests.perf,
- org.eclipse.tracecompass.tmf.ctf.core.tests.perf.experiment;x-internal:=true,
+Export-Package: org.eclipse.tracecompass.tmf.ctf.core.tests.perf.experiment,
org.eclipse.tracecompass.tmf.ctf.core.tests.shared,
org.eclipse.tracecompass.tmf.ctf.core.tests.stubs,
org.eclipse.tracecompass.tmf.ctf.core.tests.temp.headless;x-internal:=true,
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial implementation and API
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ctf.core.tests.perf;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * The class <code>AllPerformanceTests</code> builds a suite that can be used to
- * run all of the performance tests within its package as well as within any
- * subpackages of its package.
- *
- * @author Geneviève Bastien
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- org.eclipse.tracecompass.tmf.ctf.core.tests.perf.experiment.AllPerfTests.class
-})
-public class AllPerfTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ctf.core.tests.perf.experiment;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- ExperimentBenchmark.class
-})
-public class AllPerfTests {
-}
\ No newline at end of file
<name>CTF Support for TMF Core Tests Plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>prepare</id>
- <phase>validate</phase>
- <configuration>
- <target>
- <echo message="prepare phase" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <includes>
- <include>**/AllTests.*</include>
- </includes>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 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 generation with CodePro tools
- * Alexandre Montplaisir - Clean up, consolidate redundant tests
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ctf.core.tests;
-
-import org.eclipse.tracecompass.tmf.core.tests.shared.DebugSuite;
-import org.junit.runner.RunWith;
-
-/**
- * The class <code>TestAll</code> builds a suite that can be used to run all of
- * the tests within its package as well as within any subpackages of its
- * package.
- *
- * @author ematkho
- */
-@RunWith(DebugSuite.class)
-@DebugSuite.SuiteClasses({
- org.eclipse.tracecompass.tmf.ctf.core.tests.context.AllTests.class,
- org.eclipse.tracecompass.tmf.ctf.core.tests.event.AllTests.class,
- org.eclipse.tracecompass.tmf.ctf.core.tests.iterator.AllTests.class,
- org.eclipse.tracecompass.tmf.ctf.core.tests.trace.AllTests.class,
- org.eclipse.tracecompass.tmf.ctf.core.tests.trace.indexer.AllTests.class,
-
- /* Tests in other packages (that are there because of CTF) */
- org.eclipse.tracecompass.tmf.ctf.core.tests.temp.request.AllTests.class,
- org.eclipse.tracecompass.tmf.ctf.core.tests.temp.statistics.AllTests.class,
- org.eclipse.tracecompass.tmf.ctf.core.tests.temp.tracemanager.AllTests.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ctf.core.tests.context;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CtfLocationDataTest.class,
- CtfLocationTest.class,
- CtfTmfContextTest.class
-})
-public class AllTests {
-
-}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ctf.core.tests.event;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CtfTmfEventFieldTest.class,
- CtfTmfEventTest.class,
- CtfTmfEventTypeTest.class,
- CtfTmfLostEventStatisticsTest.class,
- CtfTmfLostEventsTest.class,
- EventContextTest.class
-})
-public class AllTests {
-
-}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ctf.core.tests.iterator;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CtfIteratorTest.class
-})
-public class AllTests {
-
-}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ctf.core.tests.temp.request;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfSchedulerTest.class
-})
-public class AllTests {}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 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:
- * Alexandre Montplaisir - Initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ctf.core.tests.temp.statistics;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfEventsStatisticsTest.class,
- TmfStateStatisticsTest.class
-})
-public class AllTests {}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ctf.core.tests.temp.tracemanager;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfTraceManagerTest.class
-})
-public class AllTests {}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ctf.core.tests.trace;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CtfTmfTraceTest.class,
- CtfTmfTraceValidateTest.class,
- FunkyTraceTest.class
-})
-public class AllTests {
-
-}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ctf.core.tests.trace.indexer;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CtfExperimentCheckpointIndexTest.class,
-})
-public class AllTests {
-
-}
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
- <testSuite>org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests</testSuite>
- <testClass>org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests.AllTests</testClass>
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
- <argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
- <product>org.eclipse.platform.ide</product>
<environmentVariables>
<SWT_GTK3>${SWT_GTK3}</SWT_GTK3>
<LIBOVERLAY_SCROLLBAR>0</LIBOVERLAY_SCROLLBAR>
+++ /dev/null
-/*******************************************************************************
- * 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.ctf.ui.swtbot.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * SWTBot test suite for tmf.ui
- *
- * @author Matthew Khouzam
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- StandardImportAndReadSmokeTest.class,
- TestInvalidCtfTrace.class
-})
-public class AllTests {
-}
<name>Trace Compass GDB Tracepoint Analysis Core Tests Plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <testSuite>org.eclipse.tracecompass.gdbtrace.core.tests</testSuite>
- <testClass>org.eclipse.tracecompass.gdbtrace.core.tests.AllGdbTraceCoreTests</testClass>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Patrick Tasse - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.gdbtrace.core.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Master test suite for GDB Tracepoint Analysis Core.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- GdbTraceCorePluginTest.class
-})
-
-public class AllGdbTraceCoreTests {
-
-}
<name>Trace Compass GDB Tracepoint Analysis UI Tests Plug-in</name>
- <build>
+ <build>
<plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <testSuite>org.eclipse.tracecompass.gdbtrace.ui.tests</testSuite>
- <testClass>org.eclipse.tracecompass.gdbtrace.ui.tests.AllGdbTraceUITests</testClass>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <configuration>
+ <useUIHarness>true</useUIHarness>
+ <useUIThread>true</useUIThread>
+ </configuration>
+ </plugin>
</plugins>
</build>
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Patrick Tasse - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.gdbtrace.ui.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Master test suite for GDB Tracepoint Analysis UI.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- GdbTraceUIPluginTest.class
-})
-
-public class AllGdbTraceUITests {
-
-}
<name>Trace Compass LTTng Control Core Tests Plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <testSuite>org.eclipse.tracecompass.lttng2.control.core.tests</testSuite>
- <testClass>org.eclipse.tracecompass.lttng2.control.core.tests.AllTests</testClass>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 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
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.control.core.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Run all the tests in the test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- ActivatorTest.class,
- org.eclipse.tracecompass.lttng2.control.core.tests.model.impl.AllTests.class,
- org.eclipse.tracecompass.lttng2.control.core.tests.session.AllTests.class,
- org.eclipse.tracecompass.lttng2.control.core.tests.model.impl.AllTests.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2011, 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:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.control.core.tests.model.impl;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Runner for the test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- BaseEventInfoTest.class,
- ChannelInfoTest.class,
- DomainInfoTest.class,
- EventInfoTest.class,
- FieldInfoTest.class,
- ProbeEventInfoTest.class,
- SessionInfoTest.class,
- TraceInfoTest.class,
- UstProviderInfoTest.class,
- SnapshotInfoTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * 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:
- * Guilliano Molaire - Initial API and implementation
- *********************************************************************/
-package org.eclipse.tracecompass.lttng2.control.core.tests.session;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Run all the tests in the lttng2.core.session plugin.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- SessionConfigGeneratorTest.class
-})
-public class AllTests {
-
-}
<name>Trace Compass LTTng Control UI Tests Plug-in</name>
- <build>
- <plugins>
+ <build>
+ <plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
- <testSuite>org.eclipse.tracecompass.lttng2.control.ui.tests</testSuite>
- <testClass>org.eclipse.tracecompass.lttng2.control.ui.tests.AllTests</testClass>
<useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
- <argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
- <product>org.eclipse.platform.ide</product>
</configuration>
</plugin>
</plugins>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 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
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.control.ui.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Runner for the test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- ActivatorTest.class,
- org.eclipse.tracecompass.lttng2.control.ui.tests.model.component.AllTests.class,
- org.eclipse.tracecompass.lttng2.control.ui.tests.service.AllTests.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2011, 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:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Runner for the model.component unit tests.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TraceControlComponentTest.class,
- TraceControlCreateSessionTests.class,
- TraceControlCreateSessionMiTests.class,
- TraceControlKernelProviderTests.class,
- TraceControlKernelSessionTests.class,
- TraceControlPropertiesTest.class,
- TraceControlTreeModelNoProvidersTest.class,
- TraceControlTreeModelTest.class,
- TraceControlUstProviderTests.class,
- TraceControlUstSessionTests.class,
- TraceControlUstSessionTests2.class,
- TraceControlSnapshotSessionTests.class
-})
-public class AllTests {
-
-}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 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:
+ * Jonathan Rajotte - Support for machine interface LTTng 2.6
+ **********************************************************************/
+
+package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
+
+/**
+ * Machine interface Kernel session manipulation handling test cases.
+ * LTTng 2.6
+ */
+public class TraceControlCreateSessionMiTest extends TraceControlCreateSessionTest {
+
+ private static final String TEST_STREAM = "CreateSessionTestMi.cfg";
+
+ @Override
+ protected String getTestStream() {
+ return TEST_STREAM;
+ }
+}
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 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:
- * Jonathan Rajotte - Support for machine interface LTTng 2.6
- **********************************************************************/
-
-package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
-
-/**
- * Machine interface Kernel session manipulation handling test cases.
- * LTTng 2.6
- */
-public class TraceControlCreateSessionMiTests extends TraceControlCreateSessionTests {
-
- private static final String TEST_STREAM = "CreateSessionTestMi.cfg";
-
- @Override
- protected String getTestStream() {
- return TEST_STREAM;
- }
-}
--- /dev/null
+/**********************************************************************
+ * 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:
+ * Bernd Hufmann - Initial API and implementation
+ * Jonathan Rajotte - Support for LTTng 2.6
+ * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
+ **********************************************************************/
+
+package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.remote.core.IRemoteConnection;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.service.TestRemoteSystemProxy;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.ILttngControlService;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.FrameworkUtil;
+
+/**
+ * The class {@link TraceControlKernelSessionTest} contains Kernel
+ * session/channel/event handling test cases.
+ */
+public class TraceControlCreateSessionTest {
+
+ // ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+ private static final String TEST_STREAM = "CreateSessionTest.cfg";
+ private static final String SCEN_SCENARIO_FILE_PROTO_TEST = "CreateSessionFileProto";
+ private static final String SCEN_SCENARIO_CONTROL_DATA_TEST = "CreateSessionControlData";
+ private static final String SCEN_SCENARIO_NETWORK_TEST = "CreateSessionNetwork";
+ private static final String SCEN_SCENARIO_NETWORK2_TEST = "CreateSessionNetwork2";
+
+ private static final String SESSION = "mysession";
+
+ // ------------------------------------------------------------------------
+ // Test data
+ // ------------------------------------------------------------------------
+ private TraceControlTestFacility fFacility;
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
+ private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
+ private String fTestFile;
+
+ // ------------------------------------------------------------------------
+ // Housekeeping
+ // ------------------------------------------------------------------------
+
+ /**
+ * Perform pre-test initialization.
+ *
+ * @throws Exception
+ * if the initialization fails for some reason
+ */
+ @Before
+ public void setUp() throws Exception {
+ fFacility = TraceControlTestFacility.getInstance();
+ fFacility.init();
+ URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + getTestStream()), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ fTestFile = testfile.getAbsolutePath();
+ }
+
+ /**
+ * Get the test stream file name to use for the test suite
+ *
+ * @return the name of the test stream file
+ */
+ protected String getTestStream() {
+ return TEST_STREAM;
+ }
+
+ /**
+ * Perform post-test clean-up.
+ */
+ @After
+ public void tearDown() {
+ fFacility.dispose();
+ }
+
+ /**
+ * Run the TraceControlComponent.
+ *
+ * @throws Exception
+ * on internal error
+ */
+ @Test
+ public void testTraceSessionTree() throws Exception {
+
+ fProxy.setTestFile(fTestFile);
+ fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
+
+ ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot();
+
+ TargetNodeComponent node = new TargetNodeComponent("myNode", root, fProxy);
+
+ root.addChild(node);
+ fFacility.waitForJobs();
+
+ fFacility.executeCommand(node, "connect");
+ int i = 0;
+ while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) {
+ i++;
+ fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
+ }
+
+ // Verify that node is connected
+ assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState());
+
+ ILttngControlService controleService = node.getControlService();
+
+ // Get provider groups
+ ITraceControlComponent[] groups = node.getChildren();
+ assertNotNull(groups);
+ assertEquals(2, groups.length);
+
+ // Initialize dialog implementations for command execution
+ CreateSessionDialogStub sessionDialogStub = new CreateSessionDialogStub();
+ TraceControlDialogFactory.getInstance().setCreateSessionDialog(sessionDialogStub);
+ TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
+
+ // ------------------------------------------------------------------------
+ // Create session (--U file://...) and destroy
+ // ------------------------------------------------------------------------
+ // Initialize session handling scenario
+ fProxy.setScenario(SCEN_SCENARIO_FILE_PROTO_TEST);
+
+ sessionDialogStub.setNetworkUrl("file:///tmp");
+ sessionDialogStub.setStreamedTrace(true);
+ TraceSessionComponent session = fFacility.createSession(groups[1]);
+
+ // Verify that session was created
+ assertNotNull(session);
+ assertEquals(getSessionName(), session.getName());
+ if (controleService.isVersionSupported("2.6.0")) {
+ assertEquals("/tmp", session.getSessionPath());
+ } else {
+ assertEquals("file:///tmp", session.getSessionPath());
+ }
+
+ assertTrue(!session.isStreamedTrace());
+ assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
+ sessionDialogStub.setNetworkUrl(null);
+ sessionDialogStub.setStreamedTrace(false);
+
+ fFacility.destroySession(session);
+
+ // Verify that no more session components exist
+ assertEquals(0, groups[1].getChildren().length);
+
+ // ------------------------------------------------------------------------
+ // Create session (--U file://,,, and destroy
+ // ------------------------------------------------------------------------
+ // Initialize session handling scenario
+ fProxy.setScenario(SCEN_SCENARIO_CONTROL_DATA_TEST);
+
+ sessionDialogStub.setControlUrl("tcp://172.0.0.1");
+ sessionDialogStub.setDataUrl("tcp://172.0.0.1:5343");
+ sessionDialogStub.setStreamedTrace(true);
+
+ session = fFacility.createSession(groups[1]);
+
+ // Verify that session was created
+ assertNotNull(session);
+ assertEquals(getSessionName(), session.getName());
+ if (controleService.isVersionSupported("2.6.0")) {
+ assertEquals("tcp4://172.0.0.1:5342/ [data: 5343]", session.getSessionPath());
+ } else {
+ assertEquals("tcp://172.0.0.1:5342 [data: 5343]", session.getSessionPath());
+ }
+ assertTrue(session.isStreamedTrace());
+ assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
+ sessionDialogStub.setControlUrl(null);
+ sessionDialogStub.setDataUrl(null);
+ sessionDialogStub.setStreamedTrace(false);
+
+ fFacility.destroySession(session);
+
+ // Verify that no more session components exist
+ assertEquals(0, groups[1].getChildren().length);
+
+ // ------------------------------------------------------------------------
+ // Create session (--U file://... and destroy
+ // ------------------------------------------------------------------------
+ // Initialize session handling scenario
+ fProxy.setScenario(SCEN_SCENARIO_NETWORK_TEST);
+
+ sessionDialogStub.setNetworkUrl("net://172.0.0.1:1234:2345");
+ sessionDialogStub.setStreamedTrace(true);
+
+ session = fFacility.createSession(groups[1]);
+
+ // Verify that session was created
+ assertNotNull(session);
+ assertEquals(getSessionName(), session.getName());
+ if (controleService.isVersionSupported("2.6.0")) {
+ assertEquals("tcp4://172.0.0.1:1234/mysession-20140820-153527 [data: 2345]", session.getSessionPath());
+ } else {
+ assertEquals("net://172.0.0.1:1234 [data: 2345]", session.getSessionPath());
+ }
+ assertTrue(session.isStreamedTrace());
+ assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
+ sessionDialogStub.setNetworkUrl(null);
+
+ fFacility.destroySession(session);
+
+ // Verify that no more session components exist
+ assertEquals(0, groups[1].getChildren().length);
+
+ // ------------------------------------------------------------------------
+ // Create session (--U net6://[...] and destroy
+ // ------------------------------------------------------------------------
+ // Initialize session handling scenario
+ fProxy.setScenario(SCEN_SCENARIO_NETWORK2_TEST);
+
+ sessionDialogStub.setNetworkUrl("net6://[ffff::eeee:dddd:cccc:0]");
+ sessionDialogStub.setStreamedTrace(true);
+
+ session = fFacility.createSession(groups[1]);
+
+ // Verify that session was created
+ assertNotNull(session);
+ assertEquals(getSessionName(), session.getName());
+ if (controleService.isVersionSupported("2.6.0")) {
+ assertEquals("tcp6://[ffff::eeee:dddd:cccc:0]:5342/mysession-20140820-153801 [data: 5343]", session.getSessionPath());
+ } else {
+ assertEquals("net://[ffff::eeee:dddd:cccc:0]:5342/mysession-20130221-144451 [data: 5343]", session.getSessionPath());
+ }
+ assertTrue(session.isStreamedTrace());
+ assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
+ sessionDialogStub.setNetworkUrl(null);
+
+ fFacility.destroySession(session);
+
+ // Verify that no more session components exist
+ assertEquals(0, groups[1].getChildren().length);
+
+ // -------------------------------------------------------------------------
+ // Disconnect node
+ // -------------------------------------------------------------------------
+ fFacility.executeCommand(node, "disconnect");
+ assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
+
+ // -------------------------------------------------------------------------
+ // Delete node
+ // -------------------------------------------------------------------------
+
+ fFacility.executeCommand(node, "delete");
+ assertEquals(0, fFacility.getControlView().getTraceControlRoot().getChildren().length);
+ }
+
+ private static String getSessionName() {
+ return SESSION;
+ }
+
+}
+++ /dev/null
-/**********************************************************************
- * 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:
- * Bernd Hufmann - Initial API and implementation
- * Jonathan Rajotte - Support for LTTng 2.6
- * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
- **********************************************************************/
-
-package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.net.URL;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.remote.core.IRemoteConnection;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.ILttngControlService;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.FrameworkUtil;
-
-/**
- * The class {@link TraceControlKernelSessionTests} contains Kernel
- * session/channel/event handling test cases.
- */
-public class TraceControlCreateSessionTests {
-
- // ------------------------------------------------------------------------
- // Constants
- // ------------------------------------------------------------------------
- private static final String TEST_STREAM = "CreateSessionTest.cfg";
- private static final String SCEN_SCENARIO_FILE_PROTO_TEST = "CreateSessionFileProto";
- private static final String SCEN_SCENARIO_CONTROL_DATA_TEST = "CreateSessionControlData";
- private static final String SCEN_SCENARIO_NETWORK_TEST = "CreateSessionNetwork";
- private static final String SCEN_SCENARIO_NETWORK2_TEST = "CreateSessionNetwork2";
-
- private static final String SESSION = "mysession";
-
- // ------------------------------------------------------------------------
- // Test data
- // ------------------------------------------------------------------------
- private TraceControlTestFacility fFacility;
- private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
- private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
- private String fTestFile;
-
- // ------------------------------------------------------------------------
- // Housekeeping
- // ------------------------------------------------------------------------
-
- /**
- * Perform pre-test initialization.
- *
- * @throws Exception
- * if the initialization fails for some reason
- */
- @Before
- public void setUp() throws Exception {
- fFacility = TraceControlTestFacility.getInstance();
- fFacility.init();
- URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + getTestStream()), null);
- File testfile = new File(FileLocator.toFileURL(location).toURI());
- fTestFile = testfile.getAbsolutePath();
- }
-
- /**
- * Get the test stream file name to use for the test suite
- *
- * @return the name of the test stream file
- */
- protected String getTestStream() {
- return TEST_STREAM;
- }
-
- /**
- * Perform post-test clean-up.
- */
- @After
- public void tearDown() {
- fFacility.dispose();
- }
-
- /**
- * Run the TraceControlComponent.
- *
- * @throws Exception
- * on internal error
- */
- @Test
- public void testTraceSessionTree() throws Exception {
-
- fProxy.setTestFile(fTestFile);
- fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
-
- ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot();
-
- TargetNodeComponent node = new TargetNodeComponent("myNode", root, fProxy);
-
- root.addChild(node);
- fFacility.waitForJobs();
-
- fFacility.executeCommand(node, "connect");
- int i = 0;
- while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) {
- i++;
- fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
- }
-
- // Verify that node is connected
- assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState());
-
- ILttngControlService controleService = node.getControlService();
-
- // Get provider groups
- ITraceControlComponent[] groups = node.getChildren();
- assertNotNull(groups);
- assertEquals(2, groups.length);
-
- // Initialize dialog implementations for command execution
- CreateSessionDialogStub sessionDialogStub = new CreateSessionDialogStub();
- TraceControlDialogFactory.getInstance().setCreateSessionDialog(sessionDialogStub);
- TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
-
- // ------------------------------------------------------------------------
- // Create session (--U file://...) and destroy
- // ------------------------------------------------------------------------
- // Initialize session handling scenario
- fProxy.setScenario(SCEN_SCENARIO_FILE_PROTO_TEST);
-
- sessionDialogStub.setNetworkUrl("file:///tmp");
- sessionDialogStub.setStreamedTrace(true);
- TraceSessionComponent session = fFacility.createSession(groups[1]);
-
- // Verify that session was created
- assertNotNull(session);
- assertEquals(getSessionName(), session.getName());
- if (controleService.isVersionSupported("2.6.0")) {
- assertEquals("/tmp", session.getSessionPath());
- } else {
- assertEquals("file:///tmp", session.getSessionPath());
- }
-
- assertTrue(!session.isStreamedTrace());
- assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
- sessionDialogStub.setNetworkUrl(null);
- sessionDialogStub.setStreamedTrace(false);
-
- fFacility.destroySession(session);
-
- // Verify that no more session components exist
- assertEquals(0, groups[1].getChildren().length);
-
- // ------------------------------------------------------------------------
- // Create session (--U file://,,, and destroy
- // ------------------------------------------------------------------------
- // Initialize session handling scenario
- fProxy.setScenario(SCEN_SCENARIO_CONTROL_DATA_TEST);
-
- sessionDialogStub.setControlUrl("tcp://172.0.0.1");
- sessionDialogStub.setDataUrl("tcp://172.0.0.1:5343");
- sessionDialogStub.setStreamedTrace(true);
-
- session = fFacility.createSession(groups[1]);
-
- // Verify that session was created
- assertNotNull(session);
- assertEquals(getSessionName(), session.getName());
- if (controleService.isVersionSupported("2.6.0")) {
- assertEquals("tcp4://172.0.0.1:5342/ [data: 5343]", session.getSessionPath());
- } else {
- assertEquals("tcp://172.0.0.1:5342 [data: 5343]", session.getSessionPath());
- }
- assertTrue(session.isStreamedTrace());
- assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
- sessionDialogStub.setControlUrl(null);
- sessionDialogStub.setDataUrl(null);
- sessionDialogStub.setStreamedTrace(false);
-
- fFacility.destroySession(session);
-
- // Verify that no more session components exist
- assertEquals(0, groups[1].getChildren().length);
-
- // ------------------------------------------------------------------------
- // Create session (--U file://... and destroy
- // ------------------------------------------------------------------------
- // Initialize session handling scenario
- fProxy.setScenario(SCEN_SCENARIO_NETWORK_TEST);
-
- sessionDialogStub.setNetworkUrl("net://172.0.0.1:1234:2345");
- sessionDialogStub.setStreamedTrace(true);
-
- session = fFacility.createSession(groups[1]);
-
- // Verify that session was created
- assertNotNull(session);
- assertEquals(getSessionName(), session.getName());
- if (controleService.isVersionSupported("2.6.0")) {
- assertEquals("tcp4://172.0.0.1:1234/mysession-20140820-153527 [data: 2345]", session.getSessionPath());
- } else {
- assertEquals("net://172.0.0.1:1234 [data: 2345]", session.getSessionPath());
- }
- assertTrue(session.isStreamedTrace());
- assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
- sessionDialogStub.setNetworkUrl(null);
-
- fFacility.destroySession(session);
-
- // Verify that no more session components exist
- assertEquals(0, groups[1].getChildren().length);
-
- // ------------------------------------------------------------------------
- // Create session (--U net6://[...] and destroy
- // ------------------------------------------------------------------------
- // Initialize session handling scenario
- fProxy.setScenario(SCEN_SCENARIO_NETWORK2_TEST);
-
- sessionDialogStub.setNetworkUrl("net6://[ffff::eeee:dddd:cccc:0]");
- sessionDialogStub.setStreamedTrace(true);
-
- session = fFacility.createSession(groups[1]);
-
- // Verify that session was created
- assertNotNull(session);
- assertEquals(getSessionName(), session.getName());
- if (controleService.isVersionSupported("2.6.0")) {
- assertEquals("tcp6://[ffff::eeee:dddd:cccc:0]:5342/mysession-20140820-153801 [data: 5343]", session.getSessionPath());
- } else {
- assertEquals("net://[ffff::eeee:dddd:cccc:0]:5342/mysession-20130221-144451 [data: 5343]", session.getSessionPath());
- }
- assertTrue(session.isStreamedTrace());
- assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
- sessionDialogStub.setNetworkUrl(null);
-
- fFacility.destroySession(session);
-
- // Verify that no more session components exist
- assertEquals(0, groups[1].getChildren().length);
-
- // -------------------------------------------------------------------------
- // Disconnect node
- // -------------------------------------------------------------------------
- fFacility.executeCommand(node, "disconnect");
- assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
-
- // -------------------------------------------------------------------------
- // Delete node
- // -------------------------------------------------------------------------
-
- fFacility.executeCommand(node, "delete");
- assertEquals(0, fFacility.getControlView().getTraceControlRoot().getChildren().length);
- }
-
- private static String getSessionName() {
- return SESSION;
- }
-
-}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 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:
+ * Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
+ * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
+ **********************************************************************/
+
+package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.remote.core.IRemoteConnection;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceChannelOutputType;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEventType;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.service.TestRemoteSystemProxy;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.BaseEventComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceEventComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.FrameworkUtil;
+
+/**
+ * The class {@link TraceControlKernelProviderTest} contains UST provider
+ * handling test cases.
+ */
+public class TraceControlKernelProviderTest {
+
+ // ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+
+ private static final String TEST_STREAM = "CreateTreeTest.cfg";
+ private static final String SCEN_SCENARIO1_TEST = "Scenario1";
+
+ // ------------------------------------------------------------------------
+ // Test data
+ // ------------------------------------------------------------------------
+
+ private TraceControlTestFacility fFacility;
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
+ private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
+ private String fTestFile;
+
+ // ------------------------------------------------------------------------
+ // Housekeeping
+ // ------------------------------------------------------------------------
+
+ /**
+ * Perform pre-test initialization.
+ *
+ * @throws Exception
+ * if the initialization fails for some reason
+ */
+ @Before
+ public void setUp() throws Exception {
+ fFacility = TraceControlTestFacility.getInstance();
+ fFacility.init();
+ URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ fTestFile = testfile.getAbsolutePath();
+ }
+
+ /**
+ * Perform post-test clean-up.
+ */
+ @After
+ public void tearDown() {
+ fFacility.dispose();
+ }
+
+ /**
+ * Run the TraceControlComponent.
+ *
+ * @throws Exception
+ * Would fail the test
+ */
+ @Test
+ public void testKernelProviderTree() throws Exception {
+
+ fProxy.setTestFile(fTestFile);
+ fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
+
+ ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot();
+
+ TargetNodeComponent node = new TargetNodeComponent("myNode", root, fProxy);
+
+ root.addChild(node);
+
+ fFacility.waitForJobs();
+
+ fFacility.executeCommand(node, "connect");
+ int i = 0;
+ while ((i < 20) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) {
+ i++;
+ fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
+ }
+
+ // Verify that node is connected
+ assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState());
+
+ // Get provider and session group
+ ITraceControlComponent[] groups = node.getChildren();
+ assertNotNull(groups);
+ assertEquals(2, groups.length);
+
+ // Check for kernel provider
+ TraceProviderGroup providerGroup = (TraceProviderGroup) groups[0];
+ assertTrue(providerGroup.hasKernelProvider());
+
+ // Get kernel provider
+ ITraceControlComponent[] providers = providerGroup.getChildren();
+ KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0];
+
+ // Get kernel provider events and select 2 events
+ ITraceControlComponent[] events = kernelProvider.getChildren();
+ assertNotNull(events);
+ assertEquals(3, events.length);
+
+ BaseEventComponent baseEventInfo0 = (BaseEventComponent) events[0];
+ BaseEventComponent baseEventInfo1 = (BaseEventComponent) events[1];
+
+ // Initialize dialog implementations for command execution
+ TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub());
+ TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());
+ TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
+
+ // Initialize session handling scenario
+ fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
+
+ // ------------------------------------------------------------------------
+ // Create session
+ // ------------------------------------------------------------------------
+ TraceSessionComponent session = fFacility.createSession(groups[1]);
+
+ // Verify that session was created
+ assertNotNull(session);
+ assertEquals("mysession", session.getName());
+ assertEquals("/home/user/lttng-traces/mysession-20120314-132824", session.getSessionPath());
+ assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
+
+ // ------------------------------------------------------------------------
+ // Enable event on default channel on created session above
+ // ------------------------------------------------------------------------
+ // Initialize scenario
+ fProxy.setScenario(SCEN_SCENARIO1_TEST);
+
+ ITraceControlComponent[] components = { baseEventInfo0, baseEventInfo1 };
+
+ fFacility.executeCommand(components, "assign.event");
+
+ // Verify that kernel domain was created
+ ITraceControlComponent[] domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ assertEquals("Kernel", domains[0].getName());
+
+ // Verify that channel0 was created with default values
+ ITraceControlComponent[] channels = domains[0].getChildren();
+ assertNotNull(channels);
+ assertEquals(1, channels.length);
+
+ assertTrue(channels[0] instanceof TraceChannelComponent);
+ TraceChannelComponent channel = (TraceChannelComponent) channels[0];
+ assertEquals("channel0", channel.getName());
+ assertEquals(4, channel.getNumberOfSubBuffers());
+ assertEquals("splice()", channel.getOutputType().getInName());
+ assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType());
+ assertEquals(false, channel.isOverwriteMode());
+ assertEquals(200, channel.getReadTimer());
+ assertEquals(TraceEnablement.ENABLED, channel.getState());
+ assertEquals(262144, channel.getSubBufferSize());
+ assertEquals(0, channel.getSwitchTimer());
+
+ // Verify that event components were created
+ ITraceControlComponent[] channel0Events = channel.getChildren();
+ assertNotNull(channel0Events);
+ assertEquals(2, channel0Events.length);
+ assertTrue(channel0Events[0] instanceof TraceEventComponent);
+ assertTrue(channel0Events[1] instanceof TraceEventComponent);
+
+ TraceEventComponent event = (TraceEventComponent) channel0Events[0];
+ assertEquals("sched_kthread_stop_ret", event.getName());
+ assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ TraceEventComponent event1 = (TraceEventComponent) channel0Events[1];
+ assertEquals("sched_kthread_stop", event1.getName());
+ assertEquals(TraceLogLevel.TRACE_EMERG, event1.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event1.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event1.getState());
+
+ // ------------------------------------------------------------------------
+ // Disable event components
+ // ------------------------------------------------------------------------
+ ITraceControlComponent[] selection = { event, event1 };
+ fFacility.executeCommand(selection, "disableEvent");
+
+ assertEquals(TraceEnablement.DISABLED, event.getState());
+ assertEquals(TraceEnablement.DISABLED, event1.getState());
+
+ // ------------------------------------------------------------------------
+ // Enable event component
+ // ------------------------------------------------------------------------
+ fFacility.executeCommand(event1, "enableEvent");
+
+ // Verify event state
+ assertEquals(TraceEnablement.ENABLED, event1.getState());
+
+ // ------------------------------------------------------------------------
+ // Destroy session
+ // ------------------------------------------------------------------------
+ // Initialize session handling scenario
+ fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
+
+ fFacility.destroySession(session);
+
+ // Verify that no more session components exist
+ assertEquals(0, groups[1].getChildren().length);
+
+ //-------------------------------------------------------------------------
+ // Disconnect node
+ //-------------------------------------------------------------------------
+ fFacility.executeCommand(node, "disconnect");
+ assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
+
+ //-------------------------------------------------------------------------
+ // Delete node
+ //-------------------------------------------------------------------------
+ fFacility.executeCommand(node, "delete");
+ assertEquals(0, fFacility.getControlView().getTraceControlRoot().getChildren().length);
+
+ }
+}
\ No newline at end of file
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 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:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
- **********************************************************************/
-
-package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.net.URL;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.remote.core.IRemoteConnection;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceChannelOutputType;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEventType;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.BaseEventComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceEventComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.FrameworkUtil;
-
-/**
- * The class <code>TraceControlKernelProviderTests</code> contains UST provider
- * handling test cases.
- */
-public class TraceControlKernelProviderTests {
-
- // ------------------------------------------------------------------------
- // Constants
- // ------------------------------------------------------------------------
-
- private static final String TEST_STREAM = "CreateTreeTest.cfg";
- private static final String SCEN_SCENARIO1_TEST = "Scenario1";
-
- // ------------------------------------------------------------------------
- // Test data
- // ------------------------------------------------------------------------
-
- private TraceControlTestFacility fFacility;
- private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
- private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
- private String fTestFile;
-
- // ------------------------------------------------------------------------
- // Housekeeping
- // ------------------------------------------------------------------------
-
- /**
- * Perform pre-test initialization.
- *
- * @throws Exception
- * if the initialization fails for some reason
- */
- @Before
- public void setUp() throws Exception {
- fFacility = TraceControlTestFacility.getInstance();
- fFacility.init();
- URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null);
- File testfile = new File(FileLocator.toFileURL(location).toURI());
- fTestFile = testfile.getAbsolutePath();
- }
-
- /**
- * Perform post-test clean-up.
- */
- @After
- public void tearDown() {
- fFacility.dispose();
- }
-
- /**
- * Run the TraceControlComponent.
- *
- * @throws Exception
- * Would fail the test
- */
- @Test
- public void testKernelProviderTree() throws Exception {
-
- fProxy.setTestFile(fTestFile);
- fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
-
- ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot();
-
- TargetNodeComponent node = new TargetNodeComponent("myNode", root, fProxy);
-
- root.addChild(node);
-
- fFacility.waitForJobs();
-
- fFacility.executeCommand(node, "connect");
- int i = 0;
- while ((i < 20) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) {
- i++;
- fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
- }
-
- // Verify that node is connected
- assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState());
-
- // Get provider and session group
- ITraceControlComponent[] groups = node.getChildren();
- assertNotNull(groups);
- assertEquals(2, groups.length);
-
- // Check for kernel provider
- TraceProviderGroup providerGroup = (TraceProviderGroup) groups[0];
- assertTrue(providerGroup.hasKernelProvider());
-
- // Get kernel provider
- ITraceControlComponent[] providers = providerGroup.getChildren();
- KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0];
-
- // Get kernel provider events and select 2 events
- ITraceControlComponent[] events = kernelProvider.getChildren();
- assertNotNull(events);
- assertEquals(3, events.length);
-
- BaseEventComponent baseEventInfo0 = (BaseEventComponent) events[0];
- BaseEventComponent baseEventInfo1 = (BaseEventComponent) events[1];
-
- // Initialize dialog implementations for command execution
- TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub());
- TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());
- TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
-
- // Initialize session handling scenario
- fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
-
- // ------------------------------------------------------------------------
- // Create session
- // ------------------------------------------------------------------------
- TraceSessionComponent session = fFacility.createSession(groups[1]);
-
- // Verify that session was created
- assertNotNull(session);
- assertEquals("mysession", session.getName());
- assertEquals("/home/user/lttng-traces/mysession-20120314-132824", session.getSessionPath());
- assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
-
- // ------------------------------------------------------------------------
- // Enable event on default channel on created session above
- // ------------------------------------------------------------------------
- // Initialize scenario
- fProxy.setScenario(SCEN_SCENARIO1_TEST);
-
- ITraceControlComponent[] components = { baseEventInfo0, baseEventInfo1 };
-
- fFacility.executeCommand(components, "assign.event");
-
- // Verify that kernel domain was created
- ITraceControlComponent[] domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- assertEquals("Kernel", domains[0].getName());
-
- // Verify that channel0 was created with default values
- ITraceControlComponent[] channels = domains[0].getChildren();
- assertNotNull(channels);
- assertEquals(1, channels.length);
-
- assertTrue(channels[0] instanceof TraceChannelComponent);
- TraceChannelComponent channel = (TraceChannelComponent) channels[0];
- assertEquals("channel0", channel.getName());
- assertEquals(4, channel.getNumberOfSubBuffers());
- assertEquals("splice()", channel.getOutputType().getInName());
- assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType());
- assertEquals(false, channel.isOverwriteMode());
- assertEquals(200, channel.getReadTimer());
- assertEquals(TraceEnablement.ENABLED, channel.getState());
- assertEquals(262144, channel.getSubBufferSize());
- assertEquals(0, channel.getSwitchTimer());
-
- // Verify that event components were created
- ITraceControlComponent[] channel0Events = channel.getChildren();
- assertNotNull(channel0Events);
- assertEquals(2, channel0Events.length);
- assertTrue(channel0Events[0] instanceof TraceEventComponent);
- assertTrue(channel0Events[1] instanceof TraceEventComponent);
-
- TraceEventComponent event = (TraceEventComponent) channel0Events[0];
- assertEquals("sched_kthread_stop_ret", event.getName());
- assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- TraceEventComponent event1 = (TraceEventComponent) channel0Events[1];
- assertEquals("sched_kthread_stop", event1.getName());
- assertEquals(TraceLogLevel.TRACE_EMERG, event1.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event1.getEventType());
- assertEquals(TraceEnablement.ENABLED, event1.getState());
-
- // ------------------------------------------------------------------------
- // Disable event components
- // ------------------------------------------------------------------------
- ITraceControlComponent[] selection = { event, event1 };
- fFacility.executeCommand(selection, "disableEvent");
-
- assertEquals(TraceEnablement.DISABLED, event.getState());
- assertEquals(TraceEnablement.DISABLED, event1.getState());
-
- // ------------------------------------------------------------------------
- // Enable event component
- // ------------------------------------------------------------------------
- fFacility.executeCommand(event1, "enableEvent");
-
- // Verify event state
- assertEquals(TraceEnablement.ENABLED, event1.getState());
-
- // ------------------------------------------------------------------------
- // Destroy session
- // ------------------------------------------------------------------------
- // Initialize session handling scenario
- fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
-
- fFacility.destroySession(session);
-
- // Verify that no more session components exist
- assertEquals(0, groups[1].getChildren().length);
-
- //-------------------------------------------------------------------------
- // Disconnect node
- //-------------------------------------------------------------------------
- fFacility.executeCommand(node, "disconnect");
- assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
-
- //-------------------------------------------------------------------------
- // Delete node
- //-------------------------------------------------------------------------
- fFacility.executeCommand(node, "delete");
- assertEquals(0, fFacility.getControlView().getTraceControlRoot().getChildren().length);
-
- }
-}
\ No newline at end of file
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 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:
+ * Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
+ * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
+ **********************************************************************/
+
+package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.remote.core.IRemoteConnection;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceChannelOutputType;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEventType;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.ChannelInfo;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.AddContextDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.EnableEventsDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.service.TestRemoteSystemProxy;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceEventComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceProbeEventComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.FrameworkUtil;
+
+/**
+ * The class {@link TraceControlKernelSessionTest} contains Kernel
+ * session/channel/event handling test cases.
+ */
+public class TraceControlKernelSessionTest {
+
+ // ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+
+ private static final String TEST_STREAM = "CreateTreeTest.cfg";
+ private static final String SCEN_SCENARIO3_TEST = "Scenario3";
+
+ // ------------------------------------------------------------------------
+ // Test data
+ // ------------------------------------------------------------------------
+
+ private TraceControlTestFacility fFacility;
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
+ private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
+ private String fTestFile;
+
+ // ------------------------------------------------------------------------
+ // Housekeeping
+ // ------------------------------------------------------------------------
+
+ /**
+ * Perform pre-test initialization.
+ *
+ * @throws Exception
+ * if the initialization fails for some reason
+ */
+ @Before
+ public void setUp() throws Exception {
+ fFacility = TraceControlTestFacility.getInstance();
+ fFacility.init();
+ URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ fTestFile = testfile.getAbsolutePath();
+ }
+
+ /**
+ * Perform post-test clean-up.
+ */
+ @After
+ public void tearDown() {
+ fFacility.dispose();
+ }
+
+ /**
+ * Run the TraceControlComponent.
+ *
+ * @throws Exception
+ * Would fail the test
+ */
+ @Test
+ public void testTraceSessionTree() throws Exception {
+
+ fProxy.setTestFile(fTestFile);
+ fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
+
+ ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot();
+
+ TargetNodeComponent node = new TargetNodeComponent("myNode", root, fProxy);
+
+ root.addChild(node);
+ fFacility.waitForJobs();
+
+ fFacility.executeCommand(node, "connect");
+ int i = 0;
+ while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) {
+ i++;
+ fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
+ }
+
+ // Verify that node is connected
+ assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState());
+
+ // Get provider groups
+ ITraceControlComponent[] groups = node.getChildren();
+ assertNotNull(groups);
+ assertEquals(2, groups.length);
+
+ // Initialize dialog implementations for command execution
+ TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub());
+ TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());
+ TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
+
+ // Initialize session handling scenario
+ fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
+
+ // ------------------------------------------------------------------------
+ // Create session
+ // ------------------------------------------------------------------------
+ TraceSessionComponent session = fFacility.createSession(groups[1]);
+
+ // Verify that session was created
+ assertNotNull(session);
+ assertEquals("mysession", session.getName());
+ assertEquals("/home/user/lttng-traces/mysession-20120314-132824", session.getSessionPath());
+ assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
+
+ // Initialize scenario
+ fProxy.setScenario(SCEN_SCENARIO3_TEST);
+
+ // ------------------------------------------------------------------------
+ // Enable channel on session
+ // ------------------------------------------------------------------------
+ EnableChannelDialogStub channelStub = new EnableChannelDialogStub();
+ channelStub.setIsKernel(true);
+ TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub);
+
+ fFacility.executeCommand(session, "enableChannelOnSession");
+
+ // Verify that Kernel domain was created
+ ITraceControlComponent[] domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ assertEquals("Kernel", domains[0].getName());
+
+ // Verify that channel was created with correct data
+ ITraceControlComponent[] channels = domains[0].getChildren();
+ assertNotNull(channels);
+ assertEquals(1, channels.length);
+
+ assertTrue(channels[0] instanceof TraceChannelComponent);
+ TraceChannelComponent channel = (TraceChannelComponent) channels[0];
+ assertEquals("mychannel", channel.getName());
+ assertEquals(4, channel.getNumberOfSubBuffers());
+ assertEquals("splice()", channel.getOutputType().getInName());
+ assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType());
+ assertEquals(true, channel.isOverwriteMode());
+ assertEquals(200, channel.getReadTimer());
+ assertEquals(TraceEnablement.ENABLED, channel.getState());
+ assertEquals(16384, channel.getSubBufferSize());
+ assertEquals(100, channel.getSwitchTimer());
+
+ // ------------------------------------------------------------------------
+ // Create channel on domain
+ // ------------------------------------------------------------------------
+ ChannelInfo info = (ChannelInfo)channelStub.getChannelInfo();
+ info.setName("mychannel2");
+ info.setOverwriteMode(false);
+ info.setSubBufferSize(32768);
+ info.setNumberOfSubBuffers(2);
+ info.setSwitchTimer(100);
+ info.setReadTimer(200);
+ channelStub.setChannelInfo(info);
+
+ fFacility.executeCommand(domains[0], "enableChannelOnDomain");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ assertNotNull(channels);
+ assertEquals(2, channels.length);
+
+ assertTrue(channels[1] instanceof TraceChannelComponent);
+ channel = (TraceChannelComponent) channels[1];
+ assertEquals("mychannel2", channel.getName());
+ assertEquals(2, channel.getNumberOfSubBuffers());
+ assertEquals("splice()", channel.getOutputType().getInName());
+ assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType());
+ assertEquals(false, channel.isOverwriteMode());
+ assertEquals(200, channel.getReadTimer());
+ assertEquals(TraceEnablement.ENABLED, channel.getState());
+ assertEquals(32768, channel.getSubBufferSize());
+ assertEquals(100, channel.getSwitchTimer());
+
+ EnableEventsDialogStub eventsDialogStub = new EnableEventsDialogStub();
+ eventsDialogStub.setIsTracePoints(true);
+ List<String> events = new ArrayList<>();
+ events.add("sched_kthread_stop");
+ events.add("sched_kthread_stop_ret");
+ eventsDialogStub.setNames(events);
+ eventsDialogStub.setIsKernel(true);
+ TraceControlDialogFactory.getInstance().setEnableEventsDialog(eventsDialogStub);
+
+ // ------------------------------------------------------------------------
+ // disable channels
+ // ------------------------------------------------------------------------
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ assertNotNull(channels);
+ assertEquals(2, channels.length);
+
+ fFacility.executeCommand(channels, "disableChannel");
+
+ assertEquals(TraceEnablement.DISABLED, ((TraceChannelComponent)channels[0]).getState());
+ assertEquals(TraceEnablement.DISABLED, ((TraceChannelComponent)channels[1]).getState());
+
+ // ------------------------------------------------------------------------
+ // enable channels
+ // ------------------------------------------------------------------------
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ assertNotNull(channels);
+ assertEquals(2, channels.length);
+
+ fFacility.executeCommand(channels, "enableChannel");
+
+ assertEquals(TraceEnablement.ENABLED, ((TraceChannelComponent)channels[0]).getState());
+ assertEquals(TraceEnablement.ENABLED, ((TraceChannelComponent)channels[1]).getState());
+
+ // ------------------------------------------------------------------------
+ // enable event (tracepoints) on session
+ // ------------------------------------------------------------------------
+ fFacility.executeCommand(session, "enableEventOnSession");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ assertNotNull(channels);
+ assertEquals(3, channels.length);
+
+ assertTrue(channels[2] instanceof TraceChannelComponent);
+ channel = (TraceChannelComponent) channels[2];
+ assertEquals("channel0", channel.getName());
+ // No need to check parameters of default channel because that has been done in other tests
+
+ ITraceControlComponent[] channel0Events = channel.getChildren();
+ assertEquals(2, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceEventComponent);
+ assertTrue(channel0Events[1] instanceof TraceEventComponent);
+
+ TraceEventComponent event = (TraceEventComponent) channel0Events[0];
+ assertEquals("sched_kthread_stop_ret", event.getName());
+ assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ event = (TraceEventComponent) channel0Events[1];
+ assertEquals("sched_kthread_stop", event.getName());
+ assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // enable event (tracepoints) on domain
+ // ------------------------------------------------------------------------
+ events.clear();
+ events.add("sched_wakeup_new");
+ eventsDialogStub.setNames(events);
+
+ fFacility.executeCommand(domains[0], "enableEventOnDomain");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[2];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel = (TraceChannelComponent) channels[2];
+
+ channel0Events = channel.getChildren();
+ assertEquals(3, channel0Events.length);
+
+ assertTrue(channel0Events[2] instanceof TraceEventComponent);
+
+ event = (TraceEventComponent) channel0Events[2];
+ assertEquals("sched_wakeup_new", event.getName());
+ assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // enable event (tracepoints) on channel
+ // ------------------------------------------------------------------------
+ events.clear();
+ eventsDialogStub.setNames(events);
+ eventsDialogStub.setIsAllTracePoints(true);
+
+ fFacility.executeCommand(channels[1], "enableEventOnChannel");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ // No need to check parameters of default channel because that has been done in other tests
+ channel = (TraceChannelComponent) channels[1];
+
+ channel0Events = channel.getChildren();
+ assertEquals(3, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceEventComponent);
+ assertTrue(channel0Events[1] instanceof TraceEventComponent);
+ assertTrue(channel0Events[2] instanceof TraceEventComponent);
+
+ event = (TraceEventComponent) channel0Events[0];
+ assertEquals("sched_kthread_stop_ret", event.getName());
+ assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ event = (TraceEventComponent) channel0Events[1];
+ assertEquals("sched_kthread_stop", event.getName());
+ assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ event = (TraceEventComponent) channel0Events[2];
+ assertEquals("sched_wakeup_new", event.getName());
+ assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // enable event (syscall) on channel
+ // ------------------------------------------------------------------------
+ events.clear();
+ eventsDialogStub.setIsTracePoints(false);
+ eventsDialogStub.setIsAllTracePoints(false);
+ eventsDialogStub.setIsSysCalls(true);
+
+ fFacility.executeCommand(channels[0], "enableEventOnChannel");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[0];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel = (TraceChannelComponent) channels[0];
+
+ channel0Events = channel.getChildren();
+ assertEquals(1, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceEventComponent);
+
+ event = (TraceEventComponent) channel0Events[0];
+ assertEquals("syscalls", event.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
+ assertEquals(TraceEventType.SYSCALL, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // enable event (syscall) on domain
+ // ------------------------------------------------------------------------
+ fFacility.executeCommand(domains[0], "enableEventOnDomain");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[0];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel = (TraceChannelComponent) channels[2];
+
+ channel0Events = channel.getChildren();
+ assertEquals(4, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceEventComponent);
+
+ event = (TraceEventComponent) channel0Events[0];
+ assertEquals("syscalls", event.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
+ assertEquals(TraceEventType.SYSCALL, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // enable event (syscall) on session
+ // ------------------------------------------------------------------------
+ fFacility.executeCommand(session, "enableEventOnSession");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[0];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel = (TraceChannelComponent) channels[2];
+
+ channel0Events = channel.getChildren();
+ assertEquals(4, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceEventComponent);
+
+ event = (TraceEventComponent) channel0Events[0];
+ assertEquals("syscalls", event.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
+ assertEquals(TraceEventType.SYSCALL, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+
+ // ------------------------------------------------------------------------
+ // enable event (dynamic probe) on domain
+ // ------------------------------------------------------------------------
+ events.clear();
+ eventsDialogStub.setIsSysCalls(false);
+ eventsDialogStub.setIsDynamicProbe(true);
+ eventsDialogStub.setDynamicProbe("0xc0101280");
+ eventsDialogStub.setProbeEventName("myevent1");
+
+ fFacility.executeCommand(domains[0], "enableEventOnDomain");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[2];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel0Events = channel.getChildren();
+ assertEquals(5, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceProbeEventComponent);
+
+ TraceProbeEventComponent probeEvent = (TraceProbeEventComponent) channel0Events[0];
+ assertEquals("myevent1", probeEvent.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel());
+ assertEquals(TraceEventType.PROBE, probeEvent.getEventType());
+ assertEquals(TraceEnablement.ENABLED, probeEvent.getState());
+ assertNull(probeEvent.getOffset());
+ assertEquals("0xc0101280", probeEvent.getAddress());
+ assertNull(probeEvent.getSymbol());
+
+ // ------------------------------------------------------------------------
+ // enable event (dynamic probe) on channel
+ // ------------------------------------------------------------------------
+ eventsDialogStub.setIsDynamicProbe(true);
+ eventsDialogStub.setDynamicProbe("init_post");
+ eventsDialogStub.setProbeEventName("myevent2");
+
+ fFacility.executeCommand(channels[2], "enableEventOnChannel");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[2];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel0Events = channel.getChildren();
+ assertEquals(6, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceProbeEventComponent);
+
+ probeEvent = (TraceProbeEventComponent) channel0Events[0];
+ assertEquals("myevent2", probeEvent.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel());
+ assertEquals(TraceEventType.PROBE, probeEvent.getEventType());
+ assertEquals(TraceEnablement.ENABLED, probeEvent.getState());
+ assertEquals("0x0", probeEvent.getOffset());
+ assertNull(null, probeEvent.getAddress());
+ assertEquals("init_post", probeEvent.getSymbol());
+
+ // ------------------------------------------------------------------------
+ // enable event (dynamic probe) on session
+ // ------------------------------------------------------------------------
+ eventsDialogStub.setIsDynamicProbe(true);
+ eventsDialogStub.setDynamicProbe("init_post:0x1000");
+ eventsDialogStub.setProbeEventName("myevent3");
+
+ fFacility.executeCommand(session, "enableEventOnSession");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[2];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel0Events = channel.getChildren();
+ assertEquals(7, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceProbeEventComponent);
+
+ probeEvent = (TraceProbeEventComponent) channel0Events[0];
+ assertEquals("myevent3", probeEvent.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel());
+ assertEquals(TraceEventType.PROBE, probeEvent.getEventType());
+ assertEquals(TraceEnablement.ENABLED, probeEvent.getState());
+ assertEquals("0x1000", probeEvent.getOffset());
+ assertNull(null, probeEvent.getAddress());
+ assertEquals("init_post", probeEvent.getSymbol());
+
+ // ------------------------------------------------------------------------
+ // enable event (dynamic function probe) on session
+ // ------------------------------------------------------------------------
+ eventsDialogStub.setIsDynamicProbe(false);
+ eventsDialogStub.setDynamicProbe(null);
+ eventsDialogStub.setProbeEventName(null);
+ eventsDialogStub.setIsFunctionProbe(true);
+ eventsDialogStub.setFunctionEventName("myevent4");
+ eventsDialogStub.setFunctionProbe("create_dev");
+
+ fFacility.executeCommand(session, "enableEventOnSession");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[2];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel0Events = channel.getChildren();
+ assertEquals(8, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceProbeEventComponent);
+
+ probeEvent = (TraceProbeEventComponent) channel0Events[0];
+ assertEquals("myevent4", probeEvent.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel());
+ // Changed for Bug fix 419454 to function event which was introduced by LTTng 2.2
+ assertEquals(TraceEventType.FUNCTION, probeEvent.getEventType());
+ assertEquals(TraceEnablement.ENABLED, probeEvent.getState());
+ assertEquals("0x0", probeEvent.getOffset());
+ assertNull(null, probeEvent.getAddress());
+ assertEquals("create_dev", probeEvent.getSymbol());
+
+ // ------------------------------------------------------------------------
+ // enable event (dynamic function probe) on domain
+ // ------------------------------------------------------------------------
+ eventsDialogStub.setIsFunctionProbe(true);
+ eventsDialogStub.setFunctionEventName("myevent5");
+ eventsDialogStub.setFunctionProbe("create_dev:0x2000");
+
+ fFacility.executeCommand(domains[0], "enableEventOnDomain");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[2];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel0Events = channel.getChildren();
+ assertEquals(9, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceProbeEventComponent);
+
+ probeEvent = (TraceProbeEventComponent) channel0Events[0];
+ assertEquals("myevent5", probeEvent.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel());
+ assertEquals(TraceEventType.PROBE, probeEvent.getEventType());
+ assertEquals(TraceEnablement.ENABLED, probeEvent.getState());
+ assertEquals("0x2000", probeEvent.getOffset());
+ assertNull(null, probeEvent.getAddress());
+ assertEquals("create_dev", probeEvent.getSymbol());
+
+ // ------------------------------------------------------------------------
+ // enable event (dynamic function probe) on channel
+ // ------------------------------------------------------------------------
+ eventsDialogStub.setIsFunctionProbe(true);
+ eventsDialogStub.setFunctionEventName("myevent");
+ eventsDialogStub.setFunctionProbe("create_dev:0x2000");
+
+ fFacility.executeCommand(channels[0], "enableEventOnChannel");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[0];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel0Events = channel.getChildren();
+ assertEquals(2, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceProbeEventComponent);
+
+ probeEvent = (TraceProbeEventComponent) channel0Events[0];
+ assertEquals("myevent", probeEvent.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel());
+ assertEquals(TraceEventType.PROBE, probeEvent.getEventType());
+ assertEquals(TraceEnablement.ENABLED, probeEvent.getState());
+ assertEquals("0x2000", probeEvent.getOffset());
+ assertNull(null, probeEvent.getAddress());
+ assertEquals("create_dev", probeEvent.getSymbol());
+
+ // ------------------------------------------------------------------------
+ // Add Context on domain
+ // ------------------------------------------------------------------------
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ AddContextDialogStub addContextStub = new AddContextDialogStub();
+ List<String> contexts = new ArrayList<>();
+ contexts.add("prio");
+ contexts.add("perf:branch-misses");
+ contexts.add("perf:cache-misses");
+ addContextStub.setContexts(contexts);
+ TraceControlDialogFactory.getInstance().setAddContextDialog(addContextStub);
+
+ fFacility.executeCommand(domains[0], "addContextOnDomain");
+ // Currently there is nothing to verify because the list commands don't show any context information
+ // However, the execution of the command make sure that the correct service command line is build and executed.
+
+ // ------------------------------------------------------------------------
+ // Add Context on channel
+ // ------------------------------------------------------------------------
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ //Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[0];
+
+ try {
+ // The setContext() verifies that the contexts set are part of the available contexts
+ // The available contexts are set by the command handler addContextOnDomain above.
+ // So we indirectly test here that the parsing and setting of available contexts were
+ // done correctly above.
+ addContextStub.setContexts(contexts);
+ } catch (IllegalArgumentException e) {
+ fail("Exception caught - unknown context");
+ }
+
+ fFacility.executeCommand(channel, "addContextOnChannel");
+ // Currently there is nothing to verify because the list commands don't show any context information
+ // However, the execution of the command make sure that the correct service command line is build and executed.
+
+ // ------------------------------------------------------------------------
+ // Add Context on event
+ // ------------------------------------------------------------------------
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ //Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[2];
+
+ channel0Events = channel.getChildren();
+
+ event = (TraceEventComponent) channel0Events[6];
+
+ fFacility.executeCommand(event, "addContextOnEvent");
+ // Currently there is nothing to verify because the list commands don't show any context information
+ // However, the execution of the command make sure that the correct service command line is build and executed.
+
+ // ------------------------------------------------------------------------
+ // Calibrate
+ // ------------------------------------------------------------------------
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ fFacility.executeCommand(domains[0], "calibrate");
+ // There is nothing to verify here.
+ // However, the execution of the command make sure that the correct service command line is build and executed.
+
+ // ------------------------------------------------------------------------
+ // refresh
+ // ------------------------------------------------------------------------
+ fFacility.executeCommand(node, "refresh");
+ groups = node.getChildren();
+ assertNotNull(groups);
+ assertEquals(2, groups.length);
+ assertEquals(3, groups[0].getChildren().length); // provider
+ assertEquals(1, groups[1].getChildren().length); // sessions
+ assertEquals(1, groups[1].getChildren()[0].getChildren().length); // domains
+ assertEquals(3, groups[1].getChildren()[0].getChildren()[0].getChildren().length); // channels
+ assertEquals(2, groups[1].getChildren()[0].getChildren()[0].getChildren()[0].getChildren().length); // events (of channel[0])
+
+ // Initialize session handling scenario
+ fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
+
+ session = (TraceSessionComponent)groups[1].getChildren()[0];
+
+ // ------------------------------------------------------------------------
+ // start session
+ // ------------------------------------------------------------------------
+ fFacility.startSession(session);
+ assertEquals(TraceSessionState.ACTIVE, session.getSessionState());
+
+ // ------------------------------------------------------------------------
+ // stop session
+ // ------------------------------------------------------------------------
+ fFacility.stopSession(session);
+ assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
+
+ // ------------------------------------------------------------------------
+ // Destroy session
+ // ------------------------------------------------------------------------
+
+ fFacility.destroySession(session);
+
+ // Verify that no more session components exist
+ assertEquals(0, groups[1].getChildren().length);
+
+ //-------------------------------------------------------------------------
+ // Disconnect node
+ //-------------------------------------------------------------------------
+ fFacility.executeCommand(node, "disconnect");
+ assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
+
+ //-------------------------------------------------------------------------
+ // Delete node
+ //-------------------------------------------------------------------------
+
+ fFacility.executeCommand(node, "delete");
+ assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length);
+ }
+
+}
\ No newline at end of file
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 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:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
- **********************************************************************/
-
-package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.remote.core.IRemoteConnection;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceChannelOutputType;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEventType;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.ChannelInfo;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.AddContextDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.EnableEventsDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceEventComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceProbeEventComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.FrameworkUtil;
-
-/**
- * The class <code>TraceControlKernelSessionTests</code> contains Kernel
- * session/channel/event handling test cases.
- */
-public class TraceControlKernelSessionTests {
-
- // ------------------------------------------------------------------------
- // Constants
- // ------------------------------------------------------------------------
-
- private static final String TEST_STREAM = "CreateTreeTest.cfg";
- private static final String SCEN_SCENARIO3_TEST = "Scenario3";
-
- // ------------------------------------------------------------------------
- // Test data
- // ------------------------------------------------------------------------
-
- private TraceControlTestFacility fFacility;
- private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
- private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
- private String fTestFile;
-
- // ------------------------------------------------------------------------
- // Housekeeping
- // ------------------------------------------------------------------------
-
- /**
- * Perform pre-test initialization.
- *
- * @throws Exception
- * if the initialization fails for some reason
- */
- @Before
- public void setUp() throws Exception {
- fFacility = TraceControlTestFacility.getInstance();
- fFacility.init();
- URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null);
- File testfile = new File(FileLocator.toFileURL(location).toURI());
- fTestFile = testfile.getAbsolutePath();
- }
-
- /**
- * Perform post-test clean-up.
- */
- @After
- public void tearDown() {
- fFacility.dispose();
- }
-
- /**
- * Run the TraceControlComponent.
- *
- * @throws Exception
- * Would fail the test
- */
- @Test
- public void testTraceSessionTree() throws Exception {
-
- fProxy.setTestFile(fTestFile);
- fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
-
- ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot();
-
- TargetNodeComponent node = new TargetNodeComponent("myNode", root, fProxy);
-
- root.addChild(node);
- fFacility.waitForJobs();
-
- fFacility.executeCommand(node, "connect");
- int i = 0;
- while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) {
- i++;
- fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
- }
-
- // Verify that node is connected
- assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState());
-
- // Get provider groups
- ITraceControlComponent[] groups = node.getChildren();
- assertNotNull(groups);
- assertEquals(2, groups.length);
-
- // Initialize dialog implementations for command execution
- TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub());
- TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());
- TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
-
- // Initialize session handling scenario
- fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
-
- // ------------------------------------------------------------------------
- // Create session
- // ------------------------------------------------------------------------
- TraceSessionComponent session = fFacility.createSession(groups[1]);
-
- // Verify that session was created
- assertNotNull(session);
- assertEquals("mysession", session.getName());
- assertEquals("/home/user/lttng-traces/mysession-20120314-132824", session.getSessionPath());
- assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
-
- // Initialize scenario
- fProxy.setScenario(SCEN_SCENARIO3_TEST);
-
- // ------------------------------------------------------------------------
- // Enable channel on session
- // ------------------------------------------------------------------------
- EnableChannelDialogStub channelStub = new EnableChannelDialogStub();
- channelStub.setIsKernel(true);
- TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub);
-
- fFacility.executeCommand(session, "enableChannelOnSession");
-
- // Verify that Kernel domain was created
- ITraceControlComponent[] domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- assertEquals("Kernel", domains[0].getName());
-
- // Verify that channel was created with correct data
- ITraceControlComponent[] channels = domains[0].getChildren();
- assertNotNull(channels);
- assertEquals(1, channels.length);
-
- assertTrue(channels[0] instanceof TraceChannelComponent);
- TraceChannelComponent channel = (TraceChannelComponent) channels[0];
- assertEquals("mychannel", channel.getName());
- assertEquals(4, channel.getNumberOfSubBuffers());
- assertEquals("splice()", channel.getOutputType().getInName());
- assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType());
- assertEquals(true, channel.isOverwriteMode());
- assertEquals(200, channel.getReadTimer());
- assertEquals(TraceEnablement.ENABLED, channel.getState());
- assertEquals(16384, channel.getSubBufferSize());
- assertEquals(100, channel.getSwitchTimer());
-
- // ------------------------------------------------------------------------
- // Create channel on domain
- // ------------------------------------------------------------------------
- ChannelInfo info = (ChannelInfo)channelStub.getChannelInfo();
- info.setName("mychannel2");
- info.setOverwriteMode(false);
- info.setSubBufferSize(32768);
- info.setNumberOfSubBuffers(2);
- info.setSwitchTimer(100);
- info.setReadTimer(200);
- channelStub.setChannelInfo(info);
-
- fFacility.executeCommand(domains[0], "enableChannelOnDomain");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- assertNotNull(channels);
- assertEquals(2, channels.length);
-
- assertTrue(channels[1] instanceof TraceChannelComponent);
- channel = (TraceChannelComponent) channels[1];
- assertEquals("mychannel2", channel.getName());
- assertEquals(2, channel.getNumberOfSubBuffers());
- assertEquals("splice()", channel.getOutputType().getInName());
- assertEquals(TraceChannelOutputType.SPLICE, channel.getOutputType());
- assertEquals(false, channel.isOverwriteMode());
- assertEquals(200, channel.getReadTimer());
- assertEquals(TraceEnablement.ENABLED, channel.getState());
- assertEquals(32768, channel.getSubBufferSize());
- assertEquals(100, channel.getSwitchTimer());
-
- EnableEventsDialogStub eventsDialogStub = new EnableEventsDialogStub();
- eventsDialogStub.setIsTracePoints(true);
- List<String> events = new ArrayList<>();
- events.add("sched_kthread_stop");
- events.add("sched_kthread_stop_ret");
- eventsDialogStub.setNames(events);
- eventsDialogStub.setIsKernel(true);
- TraceControlDialogFactory.getInstance().setEnableEventsDialog(eventsDialogStub);
-
- // ------------------------------------------------------------------------
- // disable channels
- // ------------------------------------------------------------------------
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- assertNotNull(channels);
- assertEquals(2, channels.length);
-
- fFacility.executeCommand(channels, "disableChannel");
-
- assertEquals(TraceEnablement.DISABLED, ((TraceChannelComponent)channels[0]).getState());
- assertEquals(TraceEnablement.DISABLED, ((TraceChannelComponent)channels[1]).getState());
-
- // ------------------------------------------------------------------------
- // enable channels
- // ------------------------------------------------------------------------
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- assertNotNull(channels);
- assertEquals(2, channels.length);
-
- fFacility.executeCommand(channels, "enableChannel");
-
- assertEquals(TraceEnablement.ENABLED, ((TraceChannelComponent)channels[0]).getState());
- assertEquals(TraceEnablement.ENABLED, ((TraceChannelComponent)channels[1]).getState());
-
- // ------------------------------------------------------------------------
- // enable event (tracepoints) on session
- // ------------------------------------------------------------------------
- fFacility.executeCommand(session, "enableEventOnSession");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- assertNotNull(channels);
- assertEquals(3, channels.length);
-
- assertTrue(channels[2] instanceof TraceChannelComponent);
- channel = (TraceChannelComponent) channels[2];
- assertEquals("channel0", channel.getName());
- // No need to check parameters of default channel because that has been done in other tests
-
- ITraceControlComponent[] channel0Events = channel.getChildren();
- assertEquals(2, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceEventComponent);
- assertTrue(channel0Events[1] instanceof TraceEventComponent);
-
- TraceEventComponent event = (TraceEventComponent) channel0Events[0];
- assertEquals("sched_kthread_stop_ret", event.getName());
- assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- event = (TraceEventComponent) channel0Events[1];
- assertEquals("sched_kthread_stop", event.getName());
- assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // enable event (tracepoints) on domain
- // ------------------------------------------------------------------------
- events.clear();
- events.add("sched_wakeup_new");
- eventsDialogStub.setNames(events);
-
- fFacility.executeCommand(domains[0], "enableEventOnDomain");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[2];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel = (TraceChannelComponent) channels[2];
-
- channel0Events = channel.getChildren();
- assertEquals(3, channel0Events.length);
-
- assertTrue(channel0Events[2] instanceof TraceEventComponent);
-
- event = (TraceEventComponent) channel0Events[2];
- assertEquals("sched_wakeup_new", event.getName());
- assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // enable event (tracepoints) on channel
- // ------------------------------------------------------------------------
- events.clear();
- eventsDialogStub.setNames(events);
- eventsDialogStub.setIsAllTracePoints(true);
-
- fFacility.executeCommand(channels[1], "enableEventOnChannel");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- // No need to check parameters of default channel because that has been done in other tests
- channel = (TraceChannelComponent) channels[1];
-
- channel0Events = channel.getChildren();
- assertEquals(3, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceEventComponent);
- assertTrue(channel0Events[1] instanceof TraceEventComponent);
- assertTrue(channel0Events[2] instanceof TraceEventComponent);
-
- event = (TraceEventComponent) channel0Events[0];
- assertEquals("sched_kthread_stop_ret", event.getName());
- assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- event = (TraceEventComponent) channel0Events[1];
- assertEquals("sched_kthread_stop", event.getName());
- assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- event = (TraceEventComponent) channel0Events[2];
- assertEquals("sched_wakeup_new", event.getName());
- assertEquals(TraceLogLevel.TRACE_EMERG, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // enable event (syscall) on channel
- // ------------------------------------------------------------------------
- events.clear();
- eventsDialogStub.setIsTracePoints(false);
- eventsDialogStub.setIsAllTracePoints(false);
- eventsDialogStub.setIsSysCalls(true);
-
- fFacility.executeCommand(channels[0], "enableEventOnChannel");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[0];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel = (TraceChannelComponent) channels[0];
-
- channel0Events = channel.getChildren();
- assertEquals(1, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceEventComponent);
-
- event = (TraceEventComponent) channel0Events[0];
- assertEquals("syscalls", event.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
- assertEquals(TraceEventType.SYSCALL, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // enable event (syscall) on domain
- // ------------------------------------------------------------------------
- fFacility.executeCommand(domains[0], "enableEventOnDomain");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[0];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel = (TraceChannelComponent) channels[2];
-
- channel0Events = channel.getChildren();
- assertEquals(4, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceEventComponent);
-
- event = (TraceEventComponent) channel0Events[0];
- assertEquals("syscalls", event.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
- assertEquals(TraceEventType.SYSCALL, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // enable event (syscall) on session
- // ------------------------------------------------------------------------
- fFacility.executeCommand(session, "enableEventOnSession");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[0];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel = (TraceChannelComponent) channels[2];
-
- channel0Events = channel.getChildren();
- assertEquals(4, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceEventComponent);
-
- event = (TraceEventComponent) channel0Events[0];
- assertEquals("syscalls", event.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
- assertEquals(TraceEventType.SYSCALL, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
-
- // ------------------------------------------------------------------------
- // enable event (dynamic probe) on domain
- // ------------------------------------------------------------------------
- events.clear();
- eventsDialogStub.setIsSysCalls(false);
- eventsDialogStub.setIsDynamicProbe(true);
- eventsDialogStub.setDynamicProbe("0xc0101280");
- eventsDialogStub.setProbeEventName("myevent1");
-
- fFacility.executeCommand(domains[0], "enableEventOnDomain");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[2];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel0Events = channel.getChildren();
- assertEquals(5, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceProbeEventComponent);
-
- TraceProbeEventComponent probeEvent = (TraceProbeEventComponent) channel0Events[0];
- assertEquals("myevent1", probeEvent.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel());
- assertEquals(TraceEventType.PROBE, probeEvent.getEventType());
- assertEquals(TraceEnablement.ENABLED, probeEvent.getState());
- assertNull(probeEvent.getOffset());
- assertEquals("0xc0101280", probeEvent.getAddress());
- assertNull(probeEvent.getSymbol());
-
- // ------------------------------------------------------------------------
- // enable event (dynamic probe) on channel
- // ------------------------------------------------------------------------
- eventsDialogStub.setIsDynamicProbe(true);
- eventsDialogStub.setDynamicProbe("init_post");
- eventsDialogStub.setProbeEventName("myevent2");
-
- fFacility.executeCommand(channels[2], "enableEventOnChannel");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[2];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel0Events = channel.getChildren();
- assertEquals(6, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceProbeEventComponent);
-
- probeEvent = (TraceProbeEventComponent) channel0Events[0];
- assertEquals("myevent2", probeEvent.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel());
- assertEquals(TraceEventType.PROBE, probeEvent.getEventType());
- assertEquals(TraceEnablement.ENABLED, probeEvent.getState());
- assertEquals("0x0", probeEvent.getOffset());
- assertNull(null, probeEvent.getAddress());
- assertEquals("init_post", probeEvent.getSymbol());
-
- // ------------------------------------------------------------------------
- // enable event (dynamic probe) on session
- // ------------------------------------------------------------------------
- eventsDialogStub.setIsDynamicProbe(true);
- eventsDialogStub.setDynamicProbe("init_post:0x1000");
- eventsDialogStub.setProbeEventName("myevent3");
-
- fFacility.executeCommand(session, "enableEventOnSession");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[2];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel0Events = channel.getChildren();
- assertEquals(7, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceProbeEventComponent);
-
- probeEvent = (TraceProbeEventComponent) channel0Events[0];
- assertEquals("myevent3", probeEvent.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel());
- assertEquals(TraceEventType.PROBE, probeEvent.getEventType());
- assertEquals(TraceEnablement.ENABLED, probeEvent.getState());
- assertEquals("0x1000", probeEvent.getOffset());
- assertNull(null, probeEvent.getAddress());
- assertEquals("init_post", probeEvent.getSymbol());
-
- // ------------------------------------------------------------------------
- // enable event (dynamic function probe) on session
- // ------------------------------------------------------------------------
- eventsDialogStub.setIsDynamicProbe(false);
- eventsDialogStub.setDynamicProbe(null);
- eventsDialogStub.setProbeEventName(null);
- eventsDialogStub.setIsFunctionProbe(true);
- eventsDialogStub.setFunctionEventName("myevent4");
- eventsDialogStub.setFunctionProbe("create_dev");
-
- fFacility.executeCommand(session, "enableEventOnSession");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[2];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel0Events = channel.getChildren();
- assertEquals(8, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceProbeEventComponent);
-
- probeEvent = (TraceProbeEventComponent) channel0Events[0];
- assertEquals("myevent4", probeEvent.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel());
- // Changed for Bug fix 419454 to function event which was introduced by LTTng 2.2
- assertEquals(TraceEventType.FUNCTION, probeEvent.getEventType());
- assertEquals(TraceEnablement.ENABLED, probeEvent.getState());
- assertEquals("0x0", probeEvent.getOffset());
- assertNull(null, probeEvent.getAddress());
- assertEquals("create_dev", probeEvent.getSymbol());
-
- // ------------------------------------------------------------------------
- // enable event (dynamic function probe) on domain
- // ------------------------------------------------------------------------
- eventsDialogStub.setIsFunctionProbe(true);
- eventsDialogStub.setFunctionEventName("myevent5");
- eventsDialogStub.setFunctionProbe("create_dev:0x2000");
-
- fFacility.executeCommand(domains[0], "enableEventOnDomain");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[2];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel0Events = channel.getChildren();
- assertEquals(9, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceProbeEventComponent);
-
- probeEvent = (TraceProbeEventComponent) channel0Events[0];
- assertEquals("myevent5", probeEvent.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel());
- assertEquals(TraceEventType.PROBE, probeEvent.getEventType());
- assertEquals(TraceEnablement.ENABLED, probeEvent.getState());
- assertEquals("0x2000", probeEvent.getOffset());
- assertNull(null, probeEvent.getAddress());
- assertEquals("create_dev", probeEvent.getSymbol());
-
- // ------------------------------------------------------------------------
- // enable event (dynamic function probe) on channel
- // ------------------------------------------------------------------------
- eventsDialogStub.setIsFunctionProbe(true);
- eventsDialogStub.setFunctionEventName("myevent");
- eventsDialogStub.setFunctionProbe("create_dev:0x2000");
-
- fFacility.executeCommand(channels[0], "enableEventOnChannel");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[0];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel0Events = channel.getChildren();
- assertEquals(2, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceProbeEventComponent);
-
- probeEvent = (TraceProbeEventComponent) channel0Events[0];
- assertEquals("myevent", probeEvent.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, probeEvent.getLogLevel());
- assertEquals(TraceEventType.PROBE, probeEvent.getEventType());
- assertEquals(TraceEnablement.ENABLED, probeEvent.getState());
- assertEquals("0x2000", probeEvent.getOffset());
- assertNull(null, probeEvent.getAddress());
- assertEquals("create_dev", probeEvent.getSymbol());
-
- // ------------------------------------------------------------------------
- // Add Context on domain
- // ------------------------------------------------------------------------
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- AddContextDialogStub addContextStub = new AddContextDialogStub();
- List<String> contexts = new ArrayList<>();
- contexts.add("prio");
- contexts.add("perf:branch-misses");
- contexts.add("perf:cache-misses");
- addContextStub.setContexts(contexts);
- TraceControlDialogFactory.getInstance().setAddContextDialog(addContextStub);
-
- fFacility.executeCommand(domains[0], "addContextOnDomain");
- // Currently there is nothing to verify because the list commands don't show any context information
- // However, the execution of the command make sure that the correct service command line is build and executed.
-
- // ------------------------------------------------------------------------
- // Add Context on channel
- // ------------------------------------------------------------------------
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- //Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[0];
-
- try {
- // The setContext() verifies that the contexts set are part of the available contexts
- // The available contexts are set by the command handler addContextOnDomain above.
- // So we indirectly test here that the parsing and setting of available contexts were
- // done correctly above.
- addContextStub.setContexts(contexts);
- } catch (IllegalArgumentException e) {
- fail("Exception caught - unknown context");
- }
-
- fFacility.executeCommand(channel, "addContextOnChannel");
- // Currently there is nothing to verify because the list commands don't show any context information
- // However, the execution of the command make sure that the correct service command line is build and executed.
-
- // ------------------------------------------------------------------------
- // Add Context on event
- // ------------------------------------------------------------------------
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- //Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[2];
-
- channel0Events = channel.getChildren();
-
- event = (TraceEventComponent) channel0Events[6];
-
- fFacility.executeCommand(event, "addContextOnEvent");
- // Currently there is nothing to verify because the list commands don't show any context information
- // However, the execution of the command make sure that the correct service command line is build and executed.
-
- // ------------------------------------------------------------------------
- // Calibrate
- // ------------------------------------------------------------------------
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- fFacility.executeCommand(domains[0], "calibrate");
- // There is nothing to verify here.
- // However, the execution of the command make sure that the correct service command line is build and executed.
-
- // ------------------------------------------------------------------------
- // refresh
- // ------------------------------------------------------------------------
- fFacility.executeCommand(node, "refresh");
- groups = node.getChildren();
- assertNotNull(groups);
- assertEquals(2, groups.length);
- assertEquals(3, groups[0].getChildren().length); // provider
- assertEquals(1, groups[1].getChildren().length); // sessions
- assertEquals(1, groups[1].getChildren()[0].getChildren().length); // domains
- assertEquals(3, groups[1].getChildren()[0].getChildren()[0].getChildren().length); // channels
- assertEquals(2, groups[1].getChildren()[0].getChildren()[0].getChildren()[0].getChildren().length); // events (of channel[0])
-
- // Initialize session handling scenario
- fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
-
- session = (TraceSessionComponent)groups[1].getChildren()[0];
-
- // ------------------------------------------------------------------------
- // start session
- // ------------------------------------------------------------------------
- fFacility.startSession(session);
- assertEquals(TraceSessionState.ACTIVE, session.getSessionState());
-
- // ------------------------------------------------------------------------
- // stop session
- // ------------------------------------------------------------------------
- fFacility.stopSession(session);
- assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
-
- // ------------------------------------------------------------------------
- // Destroy session
- // ------------------------------------------------------------------------
-
- fFacility.destroySession(session);
-
- // Verify that no more session components exist
- assertEquals(0, groups[1].getChildren().length);
-
- //-------------------------------------------------------------------------
- // Disconnect node
- //-------------------------------------------------------------------------
- fFacility.executeCommand(node, "disconnect");
- assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
-
- //-------------------------------------------------------------------------
- // Delete node
- //-------------------------------------------------------------------------
-
- fFacility.executeCommand(node, "delete");
- assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length);
- }
-
-}
\ No newline at end of file
--- /dev/null
+/**********************************************************************
+ * 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:
+ * Bernd Hufmann - Initial API and implementation
+ * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
+ **********************************************************************/
+
+package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.remote.core.IRemoteConnection;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.service.TestRemoteSystemProxy;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.property.TraceSessionPropertySource;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.FrameworkUtil;
+
+/**
+ * The class {@link TraceControlSnapshotSessionTest} contains Snapshot
+ * session test cases for support of LTTng Tools 2.3.
+ */
+public class TraceControlSnapshotSessionTest {
+
+ // ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+
+ private static final String TEST_STREAM = "CreateSessionTest2.cfg";
+ private static final String SCEN_CREATE_SESSION = "ScenCreateSession";
+
+ // ------------------------------------------------------------------------
+ // Test data
+ // ------------------------------------------------------------------------
+
+ private TraceControlTestFacility fFacility;
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
+ private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
+ private String fTestFile;
+
+ // ------------------------------------------------------------------------
+ // Housekeeping
+ // ------------------------------------------------------------------------
+
+ /**
+ * Perform pre-test initialization.
+ *
+ * @throws Exception
+ * if the initialization fails for some reason
+ */
+ @Before
+ public void setUp() throws Exception {
+ fFacility = TraceControlTestFacility.getInstance();
+ fFacility.init();
+ fProxy = new TestRemoteSystemProxy(fHost);
+ URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ fTestFile = testfile.getAbsolutePath();
+ }
+
+ /**
+ * Perform post-test clean-up.
+ */
+ @After
+ public void tearDown() {
+ fFacility.dispose();
+ }
+
+ /**
+ * Run the TraceControlComponent.
+ *
+ * @throws Exception
+ * This will fail the test
+ */
+ @Test
+ public void testTraceSessionTree() throws Exception {
+
+ fProxy.setTestFile(fTestFile);
+ fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
+
+ ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot();
+
+ TargetNodeComponent node = new TargetNodeComponent("myNode", root, fProxy);
+
+ root.addChild(node);
+ fFacility.waitForJobs();
+
+ fFacility.executeCommand(node, "connect");
+ int i = 0;
+ while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) {
+ i++;
+ fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
+ }
+
+ // Get provider groups
+ ITraceControlComponent[] groups = node.getChildren();
+ assertNotNull(groups);
+ assertEquals(2, groups.length);
+
+ // Initialize dialog implementations for command execution
+ // --- snapshot session ---
+ CreateSessionDialogStub sessionDialog = new CreateSessionDialogStub();
+ sessionDialog.setSnapshot(true);
+
+ TraceControlDialogFactory.getInstance().setCreateSessionDialog(sessionDialog);
+ TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());
+ TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
+
+ // Initialize scenario
+ fProxy.setScenario(SCEN_CREATE_SESSION);
+
+ // ------------------------------------------------------------------------
+ // Create session
+ // ------------------------------------------------------------------------
+ TraceSessionComponent session = fFacility.createSession(groups[1]);
+
+ // Verify that session was created
+ assertNotNull(session);
+ assertEquals("mysession", session.getName());
+ assertTrue(session.isSnapshotSession());
+ assertNotNull(session.getSnapshotInfo());
+ assertEquals("snapshot-1", session.getSnapshotInfo().getName());
+ assertEquals("/home/user/lttng-traces/mysession-20130913-141651", session.getSnapshotInfo().getSnapshotPath());
+ assertEquals(1, session.getSnapshotInfo().getId());
+
+ // ------------------------------------------------------------------------
+ // Start session
+ // ------------------------------------------------------------------------
+ fFacility.startSession(session);
+ assertEquals(TraceSessionState.ACTIVE, session.getSessionState());
+
+ // verify properties
+ Object adapter = session.getAdapter(IPropertySource.class);
+ assertNotNull(adapter);
+ assertTrue(adapter instanceof TraceSessionPropertySource);
+
+ TraceSessionPropertySource sessionSource = (TraceSessionPropertySource)adapter;
+ IPropertyDescriptor[] descriptors = sessionSource.getPropertyDescriptors();
+ assertNotNull(descriptors);
+
+ Map<String,String> map = new HashMap<>();
+ map.put(TraceSessionPropertySource.TRACE_SESSION_NAME_PROPERTY_ID, "mysession");
+ map.put(TraceSessionPropertySource.TRACE_SNAPSHOT_NAME_PROPERTY_ID, "snapshot-1");
+ map.put(TraceSessionPropertySource.TRACE_SNAPSHOT_PATH_PROPERTY_ID, "/home/user/lttng-traces/mysession-20130913-141651");
+ map.put(TraceSessionPropertySource.TRACE_SNAPSHOT_ID_PROPERTY_ID, "1");
+ map.put(TraceSessionPropertySource.TRACE_SESSION_STATE_PROPERTY_ID, TraceSessionState.ACTIVE.name());
+
+ for (int j = 0; j < descriptors.length; j++) {
+ String expected = map.get(descriptors[j].getId());
+ assertNotNull(expected);
+ assertEquals(expected, sessionSource.getPropertyValue(descriptors[j].getId()).toString());
+ }
+
+ // ------------------------------------------------------------------------
+ // Record snapshot
+ // ------------------------------------------------------------------------
+ fFacility.executeCommand(session, "snapshot");
+
+ // ------------------------------------------------------------------------
+ // Stop snapshot
+ // ------------------------------------------------------------------------
+ fFacility.stopSession(session);
+ assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
+
+ // ------------------------------------------------------------------------
+ // Destroy session
+ // ------------------------------------------------------------------------
+ fFacility.destroySession(session);
+
+ // Verify that no more session components exist
+ assertEquals(0, groups[1].getChildren().length);
+
+ //-------------------------------------------------------------------------
+ // Disconnect node
+ //-------------------------------------------------------------------------
+ fFacility.executeCommand(node, "disconnect");
+ assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
+
+ //-------------------------------------------------------------------------
+ // Delete node
+ //-------------------------------------------------------------------------
+
+ fFacility.executeCommand(node, "delete");
+ }
+}
\ No newline at end of file
+++ /dev/null
-/**********************************************************************
- * 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:
- * Bernd Hufmann - Initial API and implementation
- * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
- **********************************************************************/
-
-package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.remote.core.IRemoteConnection;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.property.TraceSessionPropertySource;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.FrameworkUtil;
-
-/**
- * The class <code>TraceControlSnapshotSessionTests</code> contains Snapshot
- * session test cases for support of LTTng Tools 2.3.
- */
-public class TraceControlSnapshotSessionTests {
-
- // ------------------------------------------------------------------------
- // Constants
- // ------------------------------------------------------------------------
-
- private static final String TEST_STREAM = "CreateSessionTest2.cfg";
- private static final String SCEN_CREATE_SESSION = "ScenCreateSession";
-
- // ------------------------------------------------------------------------
- // Test data
- // ------------------------------------------------------------------------
-
- private TraceControlTestFacility fFacility;
- private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
- private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
- private String fTestFile;
-
- // ------------------------------------------------------------------------
- // Housekeeping
- // ------------------------------------------------------------------------
-
- /**
- * Perform pre-test initialization.
- *
- * @throws Exception
- * if the initialization fails for some reason
- */
- @Before
- public void setUp() throws Exception {
- fFacility = TraceControlTestFacility.getInstance();
- fFacility.init();
- fProxy = new TestRemoteSystemProxy(fHost);
- URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null);
- File testfile = new File(FileLocator.toFileURL(location).toURI());
- fTestFile = testfile.getAbsolutePath();
- }
-
- /**
- * Perform post-test clean-up.
- */
- @After
- public void tearDown() {
- fFacility.dispose();
- }
-
- /**
- * Run the TraceControlComponent.
- *
- * @throws Exception
- * This will fail the test
- */
- @Test
- public void testTraceSessionTree() throws Exception {
-
- fProxy.setTestFile(fTestFile);
- fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
-
- ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot();
-
- TargetNodeComponent node = new TargetNodeComponent("myNode", root, fProxy);
-
- root.addChild(node);
- fFacility.waitForJobs();
-
- fFacility.executeCommand(node, "connect");
- int i = 0;
- while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) {
- i++;
- fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
- }
-
- // Get provider groups
- ITraceControlComponent[] groups = node.getChildren();
- assertNotNull(groups);
- assertEquals(2, groups.length);
-
- // Initialize dialog implementations for command execution
- // --- snapshot session ---
- CreateSessionDialogStub sessionDialog = new CreateSessionDialogStub();
- sessionDialog.setSnapshot(true);
-
- TraceControlDialogFactory.getInstance().setCreateSessionDialog(sessionDialog);
- TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());
- TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
-
- // Initialize scenario
- fProxy.setScenario(SCEN_CREATE_SESSION);
-
- // ------------------------------------------------------------------------
- // Create session
- // ------------------------------------------------------------------------
- TraceSessionComponent session = fFacility.createSession(groups[1]);
-
- // Verify that session was created
- assertNotNull(session);
- assertEquals("mysession", session.getName());
- assertTrue(session.isSnapshotSession());
- assertNotNull(session.getSnapshotInfo());
- assertEquals("snapshot-1", session.getSnapshotInfo().getName());
- assertEquals("/home/user/lttng-traces/mysession-20130913-141651", session.getSnapshotInfo().getSnapshotPath());
- assertEquals(1, session.getSnapshotInfo().getId());
-
- // ------------------------------------------------------------------------
- // Start session
- // ------------------------------------------------------------------------
- fFacility.startSession(session);
- assertEquals(TraceSessionState.ACTIVE, session.getSessionState());
-
- // verify properties
- Object adapter = session.getAdapter(IPropertySource.class);
- assertNotNull(adapter);
- assertTrue(adapter instanceof TraceSessionPropertySource);
-
- TraceSessionPropertySource sessionSource = (TraceSessionPropertySource)adapter;
- IPropertyDescriptor[] descriptors = sessionSource.getPropertyDescriptors();
- assertNotNull(descriptors);
-
- Map<String,String> map = new HashMap<>();
- map.put(TraceSessionPropertySource.TRACE_SESSION_NAME_PROPERTY_ID, "mysession");
- map.put(TraceSessionPropertySource.TRACE_SNAPSHOT_NAME_PROPERTY_ID, "snapshot-1");
- map.put(TraceSessionPropertySource.TRACE_SNAPSHOT_PATH_PROPERTY_ID, "/home/user/lttng-traces/mysession-20130913-141651");
- map.put(TraceSessionPropertySource.TRACE_SNAPSHOT_ID_PROPERTY_ID, "1");
- map.put(TraceSessionPropertySource.TRACE_SESSION_STATE_PROPERTY_ID, TraceSessionState.ACTIVE.name());
-
- for (int j = 0; j < descriptors.length; j++) {
- String expected = map.get(descriptors[j].getId());
- assertNotNull(expected);
- assertEquals(expected, sessionSource.getPropertyValue(descriptors[j].getId()).toString());
- }
-
- // ------------------------------------------------------------------------
- // Record snapshot
- // ------------------------------------------------------------------------
- fFacility.executeCommand(session, "snapshot");
-
- // ------------------------------------------------------------------------
- // Stop snapshot
- // ------------------------------------------------------------------------
- fFacility.stopSession(session);
- assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
-
- // ------------------------------------------------------------------------
- // Destroy session
- // ------------------------------------------------------------------------
- fFacility.destroySession(session);
-
- // Verify that no more session components exist
- assertEquals(0, groups[1].getChildren().length);
-
- //-------------------------------------------------------------------------
- // Disconnect node
- //-------------------------------------------------------------------------
- fFacility.executeCommand(node, "disconnect");
- assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
-
- //-------------------------------------------------------------------------
- // Delete node
- //-------------------------------------------------------------------------
-
- fFacility.executeCommand(node, "delete");
- }
-}
\ No newline at end of file
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 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:
+ * Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
+ * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
+ **********************************************************************/
+
+package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.remote.core.IRemoteConnection;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceChannelOutputType;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEventType;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.service.TestRemoteSystemProxy;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.BaseEventComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceEventComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.UstProviderComponent;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.FrameworkUtil;
+
+/**
+ * The class {@link TraceControlUstProviderTest} contains UST provider
+ * handling test cases.
+ */
+public class TraceControlUstProviderTest {
+
+ // ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+
+ private static final String TEST_STREAM = "CreateTreeTest.cfg";
+ private static final String SCEN_SCENARIO2_TEST = "Scenario2";
+
+ // ------------------------------------------------------------------------
+ // Test data
+ // ------------------------------------------------------------------------
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
+ private TraceControlTestFacility fFacility;
+ private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
+ private String fTestFile;
+
+ // ------------------------------------------------------------------------
+ // Housekeeping
+ // ------------------------------------------------------------------------
+
+ /**
+ * Perform pre-test initialization.
+ *
+ * @throws Exception
+ * if the initialization fails for some reason
+ */
+ @Before
+ public void setUp() throws Exception {
+ fFacility = TraceControlTestFacility.getInstance();
+ fFacility.init();
+ fProxy = new TestRemoteSystemProxy(fHost);
+ URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ fTestFile = testfile.getAbsolutePath();
+ }
+
+ /**
+ * Perform post-test clean-up.
+ */
+ @After
+ public void tearDown() {
+ fFacility.dispose();
+ }
+
+ /**
+ * Run the TraceControlComponent.
+ *
+ * @throws Exception
+ * This will fail the test
+ */
+ @Test
+ public void testUstProviderTree() throws Exception {
+
+ fProxy.setTestFile(fTestFile);
+ fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
+
+ ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot();
+
+ TargetNodeComponent node = new TargetNodeComponent("myNode", root, fProxy);
+ root.addChild(node);
+
+ fFacility.waitForJobs();
+
+ fFacility.executeCommand(node, "connect");
+
+ int i = 0;
+ while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) {
+ i++;
+ fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
+ }
+
+ // Verify that node is connected
+ assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState());
+
+ // Get provider groups
+ ITraceControlComponent[] groups = node.getChildren();
+ assertNotNull(groups);
+ assertEquals(2, groups.length);
+
+ // Get kernel provider
+ ITraceControlComponent[] providers = groups[0].getChildren();
+ KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0];
+
+ // Get kernel provider events and select 2 events
+ ITraceControlComponent[] events = kernelProvider.getChildren();
+ assertNotNull(events);
+ assertEquals(3, events.length);
+
+ BaseEventComponent baseEventInfo0 = (BaseEventComponent) events[0];
+ BaseEventComponent baseEventInfo1 = (BaseEventComponent) events[1];
+
+ // Initialize dialog implementations for command execution
+ TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub());
+ TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());
+ TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
+
+ // ------------------------------------------------------------------------
+ // Create session
+ // ------------------------------------------------------------------------
+ // Initialize session handling scenario
+ fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING_WITH_PATH);
+
+ CreateSessionDialogStub sessionDialogStub = new CreateSessionDialogStub();
+ sessionDialogStub.setSessionPath("/home/user/temp");
+ TraceControlDialogFactory.getInstance().setCreateSessionDialog(sessionDialogStub);
+
+ TraceSessionComponent session = fFacility.createSession(groups[1]);
+
+ // Verify that session was created
+ assertNotNull(session);
+ assertEquals("mysession", session.getName());
+ assertEquals("/home/user/temp", session.getSessionPath());
+ assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
+
+ // ------------------------------------------------------------------------
+ // Enable Channel on UST global domain
+ // ------------------------------------------------------------------------
+ fProxy.setScenario(SCEN_SCENARIO2_TEST);
+ EnableChannelDialogStub channelDialogStub = new EnableChannelDialogStub();
+ channelDialogStub.setIsKernel(false);
+ channelDialogStub.getChannelInfo().setOverwriteMode(false);
+ channelDialogStub.getChannelInfo().setSwitchTimer(200);
+ channelDialogStub.getChannelInfo().setReadTimer(100);
+ channelDialogStub.getChannelInfo().setNumberOfSubBuffers(2);
+ TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelDialogStub);
+
+ fFacility.executeCommand(session, "enableChannelOnSession");
+
+ // Verify that UST domain was created
+ ITraceControlComponent[] domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ assertEquals("UST global", domains[0].getName());
+
+ // Verify that channel was created with correct data
+ ITraceControlComponent[]channels = domains[0].getChildren();
+ assertNotNull(channels);
+ assertEquals(1, channels.length);
+
+ assertTrue(channels[0] instanceof TraceChannelComponent);
+ TraceChannelComponent channel = (TraceChannelComponent) channels[0];
+ assertEquals("mychannel", channel.getName());
+ assertEquals(2, channel.getNumberOfSubBuffers());
+ assertEquals("mmap()", channel.getOutputType().getInName());
+ assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType());
+ assertEquals(false, channel.isOverwriteMode());
+ assertEquals(100, channel.getReadTimer());
+ assertEquals(TraceEnablement.ENABLED, channel.getState());
+ assertEquals(16384, channel.getSubBufferSize());
+ assertEquals(200, channel.getSwitchTimer());
+
+ // ------------------------------------------------------------------------
+ // Enable event on default channel on created session above
+ // ------------------------------------------------------------------------
+ // Get first UST provider
+ UstProviderComponent ustProvider = (UstProviderComponent) providers[1];
+ assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello [PID=9379]", ustProvider.getName());
+ assertEquals(9379, ustProvider.getPid());
+
+ // Get events
+ events = ustProvider.getChildren();
+ assertNotNull(events);
+ assertEquals(2, events.length);
+
+ baseEventInfo0 = (BaseEventComponent) events[0];
+ baseEventInfo1 = (BaseEventComponent) events[1];
+
+ ITraceControlComponent[] ustSelection = { baseEventInfo0, baseEventInfo1 };
+
+ fFacility.executeCommand(ustSelection, "assign.event");
+
+ // verify that events were created under the channel
+ // Note that domain and channel has to be re-read because the tree is re-created
+
+ domains = session.getChildren();
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+
+ ITraceControlComponent[] ustEvents = channels[0].getChildren();
+ assertEquals(2, ustEvents.length);
+
+ TraceEventComponent event = (TraceEventComponent) ustEvents[0];
+ assertEquals("ust_tests_hello:tptest_sighandler", event.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ event = (TraceEventComponent) ustEvents[1];
+ assertEquals("ust_tests_hello:tptest", ustEvents[1].getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // Disable event components
+ // ------------------------------------------------------------------------
+ fFacility.executeCommand(event, "disableEvent");
+
+ assertEquals(TraceEnablement.DISABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // Enable event component
+ // ------------------------------------------------------------------------
+ fFacility.executeCommand(event, "enableEvent");
+
+ // Verify event state
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // Destroy session
+ // ------------------------------------------------------------------------
+
+ // Initialize session handling scenario
+ fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
+
+ fFacility.destroySession(session);
+
+ // Verify that no more session components exist
+ assertEquals(0, groups[1].getChildren().length);
+
+ //-------------------------------------------------------------------------
+ // Disconnect node
+ //-------------------------------------------------------------------------
+ fFacility.executeCommand(node, "disconnect");
+ assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
+
+ //-------------------------------------------------------------------------
+ // Delete node
+ //-------------------------------------------------------------------------
+ fFacility.executeCommand(node, "delete");
+ assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length);
+ }
+}
\ No newline at end of file
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 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:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
- **********************************************************************/
-
-package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.net.URL;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.remote.core.IRemoteConnection;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceChannelOutputType;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEventType;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.BaseEventComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.KernelProviderComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceEventComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.UstProviderComponent;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.FrameworkUtil;
-
-/**
- * The class <code>TraceControlUstProviderTests</code> contains UST provider
- * handling test cases.
- */
-public class TraceControlUstProviderTests {
-
- // ------------------------------------------------------------------------
- // Constants
- // ------------------------------------------------------------------------
-
- private static final String TEST_STREAM = "CreateTreeTest.cfg";
- private static final String SCEN_SCENARIO2_TEST = "Scenario2";
-
- // ------------------------------------------------------------------------
- // Test data
- // ------------------------------------------------------------------------
- private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
- private TraceControlTestFacility fFacility;
- private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
- private String fTestFile;
-
- // ------------------------------------------------------------------------
- // Housekeeping
- // ------------------------------------------------------------------------
-
- /**
- * Perform pre-test initialization.
- *
- * @throws Exception
- * if the initialization fails for some reason
- */
- @Before
- public void setUp() throws Exception {
- fFacility = TraceControlTestFacility.getInstance();
- fFacility.init();
- fProxy = new TestRemoteSystemProxy(fHost);
- URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null);
- File testfile = new File(FileLocator.toFileURL(location).toURI());
- fTestFile = testfile.getAbsolutePath();
- }
-
- /**
- * Perform post-test clean-up.
- */
- @After
- public void tearDown() {
- fFacility.dispose();
- }
-
- /**
- * Run the TraceControlComponent.
- *
- * @throws Exception
- * This will fail the test
- */
- @Test
- public void testUstProviderTree() throws Exception {
-
- fProxy.setTestFile(fTestFile);
- fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
-
- ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot();
-
- TargetNodeComponent node = new TargetNodeComponent("myNode", root, fProxy);
- root.addChild(node);
-
- fFacility.waitForJobs();
-
- fFacility.executeCommand(node, "connect");
-
- int i = 0;
- while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) {
- i++;
- fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
- }
-
- // Verify that node is connected
- assertEquals(TargetNodeState.CONNECTED, node.getTargetNodeState());
-
- // Get provider groups
- ITraceControlComponent[] groups = node.getChildren();
- assertNotNull(groups);
- assertEquals(2, groups.length);
-
- // Get kernel provider
- ITraceControlComponent[] providers = groups[0].getChildren();
- KernelProviderComponent kernelProvider = (KernelProviderComponent) providers[0];
-
- // Get kernel provider events and select 2 events
- ITraceControlComponent[] events = kernelProvider.getChildren();
- assertNotNull(events);
- assertEquals(3, events.length);
-
- BaseEventComponent baseEventInfo0 = (BaseEventComponent) events[0];
- BaseEventComponent baseEventInfo1 = (BaseEventComponent) events[1];
-
- // Initialize dialog implementations for command execution
- TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub());
- TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());
- TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
-
- // ------------------------------------------------------------------------
- // Create session
- // ------------------------------------------------------------------------
- // Initialize session handling scenario
- fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING_WITH_PATH);
-
- CreateSessionDialogStub sessionDialogStub = new CreateSessionDialogStub();
- sessionDialogStub.setSessionPath("/home/user/temp");
- TraceControlDialogFactory.getInstance().setCreateSessionDialog(sessionDialogStub);
-
- TraceSessionComponent session = fFacility.createSession(groups[1]);
-
- // Verify that session was created
- assertNotNull(session);
- assertEquals("mysession", session.getName());
- assertEquals("/home/user/temp", session.getSessionPath());
- assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
-
- // ------------------------------------------------------------------------
- // Enable Channel on UST global domain
- // ------------------------------------------------------------------------
- fProxy.setScenario(SCEN_SCENARIO2_TEST);
- EnableChannelDialogStub channelDialogStub = new EnableChannelDialogStub();
- channelDialogStub.setIsKernel(false);
- channelDialogStub.getChannelInfo().setOverwriteMode(false);
- channelDialogStub.getChannelInfo().setSwitchTimer(200);
- channelDialogStub.getChannelInfo().setReadTimer(100);
- channelDialogStub.getChannelInfo().setNumberOfSubBuffers(2);
- TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelDialogStub);
-
- fFacility.executeCommand(session, "enableChannelOnSession");
-
- // Verify that UST domain was created
- ITraceControlComponent[] domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- assertEquals("UST global", domains[0].getName());
-
- // Verify that channel was created with correct data
- ITraceControlComponent[]channels = domains[0].getChildren();
- assertNotNull(channels);
- assertEquals(1, channels.length);
-
- assertTrue(channels[0] instanceof TraceChannelComponent);
- TraceChannelComponent channel = (TraceChannelComponent) channels[0];
- assertEquals("mychannel", channel.getName());
- assertEquals(2, channel.getNumberOfSubBuffers());
- assertEquals("mmap()", channel.getOutputType().getInName());
- assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType());
- assertEquals(false, channel.isOverwriteMode());
- assertEquals(100, channel.getReadTimer());
- assertEquals(TraceEnablement.ENABLED, channel.getState());
- assertEquals(16384, channel.getSubBufferSize());
- assertEquals(200, channel.getSwitchTimer());
-
- // ------------------------------------------------------------------------
- // Enable event on default channel on created session above
- // ------------------------------------------------------------------------
- // Get first UST provider
- UstProviderComponent ustProvider = (UstProviderComponent) providers[1];
- assertEquals("/home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello [PID=9379]", ustProvider.getName());
- assertEquals(9379, ustProvider.getPid());
-
- // Get events
- events = ustProvider.getChildren();
- assertNotNull(events);
- assertEquals(2, events.length);
-
- baseEventInfo0 = (BaseEventComponent) events[0];
- baseEventInfo1 = (BaseEventComponent) events[1];
-
- ITraceControlComponent[] ustSelection = { baseEventInfo0, baseEventInfo1 };
-
- fFacility.executeCommand(ustSelection, "assign.event");
-
- // verify that events were created under the channel
- // Note that domain and channel has to be re-read because the tree is re-created
-
- domains = session.getChildren();
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
-
- ITraceControlComponent[] ustEvents = channels[0].getChildren();
- assertEquals(2, ustEvents.length);
-
- TraceEventComponent event = (TraceEventComponent) ustEvents[0];
- assertEquals("ust_tests_hello:tptest_sighandler", event.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- event = (TraceEventComponent) ustEvents[1];
- assertEquals("ust_tests_hello:tptest", ustEvents[1].getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // Disable event components
- // ------------------------------------------------------------------------
- fFacility.executeCommand(event, "disableEvent");
-
- assertEquals(TraceEnablement.DISABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // Enable event component
- // ------------------------------------------------------------------------
- fFacility.executeCommand(event, "enableEvent");
-
- // Verify event state
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // Destroy session
- // ------------------------------------------------------------------------
-
- // Initialize session handling scenario
- fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
-
- fFacility.destroySession(session);
-
- // Verify that no more session components exist
- assertEquals(0, groups[1].getChildren().length);
-
- //-------------------------------------------------------------------------
- // Disconnect node
- //-------------------------------------------------------------------------
- fFacility.executeCommand(node, "disconnect");
- assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
-
- //-------------------------------------------------------------------------
- // Delete node
- //-------------------------------------------------------------------------
- fFacility.executeCommand(node, "delete");
- assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length);
- }
-}
\ No newline at end of file
--- /dev/null
+/**********************************************************************
+ * 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:
+ * Bernd Hufmann - Initial API and implementation
+ * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
+ **********************************************************************/
+
+package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.remote.core.IRemoteConnection;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.BufferType;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.ChannelInfo;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.service.TestRemoteSystemProxy;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.FrameworkUtil;
+
+/**
+ * The class {@link TraceControlUstSession2Test} contains UST
+ * session/channel/event handling test cases for LTTng 2.2.
+ */
+public class TraceControlUstSession2Test {
+
+ // ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+
+ private static final String TEST_STREAM = "CreateTreeTest2.cfg";
+ private static final String SCEN_SCEN_PER_UID_TEST = "ScenPerUidTest";
+ private static final String SCEN_SCEN_PER_PID_TEST = "ScenPerPidTest";
+ private static final String SCEN_SCEN_BUF_SIZE_TEST = "ScenBufSizeTest";
+
+ // ------------------------------------------------------------------------
+ // Test data
+ // ------------------------------------------------------------------------
+
+ private TraceControlTestFacility fFacility;
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
+ private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
+ private String fTestFile;
+
+ // ------------------------------------------------------------------------
+ // Housekeeping
+ // ------------------------------------------------------------------------
+
+ /**
+ * Perform pre-test initialization.
+ *
+ * @throws Exception
+ * if the initialization fails for some reason
+ */
+ @Before
+ public void setUp() throws Exception {
+ fFacility = TraceControlTestFacility.getInstance();
+ fFacility.init();
+ URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ fTestFile = testfile.getAbsolutePath();
+ }
+
+ /**
+ * Perform post-test clean-up.
+ */
+ @After
+ public void tearDown() {
+ fFacility.dispose();
+ }
+
+ /**
+ * Run the TraceControlComponent.
+ *
+ * @throws Exception
+ * This will fail the test
+ */
+ @Test
+ public void testTraceSessionTree() throws Exception {
+
+ fProxy.setTestFile(fTestFile);
+ fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
+
+ ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot();
+
+ TargetNodeComponent node = new TargetNodeComponent("myNode", root, fProxy);
+
+ root.addChild(node);
+ fFacility.waitForJobs();
+
+ fFacility.executeCommand(node, "connect");
+ int i = 0;
+ while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) {
+ i++;
+ fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
+ }
+
+ // Get provider groups
+ ITraceControlComponent[] groups = node.getChildren();
+ assertNotNull(groups);
+ assertEquals(2, groups.length);
+
+ // Initialize dialog implementations for command execution
+ TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub());
+ TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());
+ TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
+
+ // Initialize scenario
+ fProxy.setScenario(SCEN_SCEN_PER_UID_TEST);
+
+ // ------------------------------------------------------------------------
+ // Create session
+ // ------------------------------------------------------------------------
+ TraceSessionComponent session = fFacility.createSession(groups[1]);
+
+ // Verify that session was created
+ assertNotNull(session);
+ assertEquals("mysession", session.getName());
+
+ // ------------------------------------------------------------------------
+ // Enable default channel on created session above
+ // ------------------------------------------------------------------------
+ EnableChannelDialogStub channelStub = new EnableChannelDialogStub();
+ channelStub.setIsKernel(false);
+ ChannelInfo info = (ChannelInfo)channelStub.getChannelInfo();
+ info.setName("mychannel");
+ info.setOverwriteMode(false);
+ info.setSubBufferSize(-1);
+ info.setNumberOfSubBuffers(-1);
+ info.setSwitchTimer(-1);
+ info.setReadTimer(-1);
+ info.setMaxNumberTraceFiles(-1);
+ info.setMaxSizeTraceFiles(-1);
+ info.setBufferType(BufferType.BUFFER_PER_UID);
+ channelStub.setChannelInfo(info);
+
+ TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub);
+
+ fFacility.executeCommand(session, "enableChannelOnSession");
+
+ // Verify that UST domain was created
+ ITraceControlComponent[] domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ assertEquals("UST global", domains[0].getName());
+ assertEquals("Domain buffer Type", BufferType.BUFFER_PER_UID, ((TraceDomainComponent)domains[0]).getBufferType());
+
+ // Verify that channel was created with correct data
+ ITraceControlComponent[] channels = domains[0].getChildren();
+ assertNotNull(channels);
+ assertEquals(1, channels.length);
+
+ assertTrue(channels[0] instanceof TraceChannelComponent);
+ TraceChannelComponent channel = (TraceChannelComponent) channels[0];
+ assertEquals("mychannel", channel.getName());
+
+ // ------------------------------------------------------------------------
+ // Destroy session
+ // ------------------------------------------------------------------------
+ fFacility.destroySession(session);
+
+ // Verify that no more session components exist
+ assertEquals(0, groups[1].getChildren().length);
+
+ // ------------------------------------------------------------------------
+ // Create session (per-pid buffers)
+ // ------------------------------------------------------------------------
+
+ // Initialize scenario
+ fProxy.setScenario(SCEN_SCEN_PER_PID_TEST);
+
+ session = fFacility.createSession(groups[1]);
+
+ // Verify that session was created
+ assertNotNull(session);
+ assertEquals("mysession", session.getName());
+
+ // ------------------------------------------------------------------------
+ // Enable default channel on created session above
+ // ------------------------------------------------------------------------
+ info = (ChannelInfo)channelStub.getChannelInfo();
+ info.setName("mychannel");
+ info.setBufferType(BufferType.BUFFER_PER_PID);
+ channelStub.setChannelInfo(info);
+
+ fFacility.executeCommand(session, "enableChannelOnSession");
+
+ // Verify that UST domain was created
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ assertEquals("UST global", domains[0].getName());
+ assertEquals("Domain buffer Type", BufferType.BUFFER_PER_PID, ((TraceDomainComponent)domains[0]).getBufferType());
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ assertNotNull(channels);
+ assertEquals(1, channels.length);
+
+ assertTrue(channels[0] instanceof TraceChannelComponent);
+ channel = (TraceChannelComponent) channels[0];
+ assertEquals("mychannel", channel.getName());
+
+ // ------------------------------------------------------------------------
+ // Destroy session
+ // ------------------------------------------------------------------------
+ fFacility.destroySession(session);
+
+ // Verify that no more session components exist
+ assertEquals(0, groups[1].getChildren().length);
+
+ // ------------------------------------------------------------------------
+ // Create session (configured file size and number of files)
+ // ------------------------------------------------------------------------
+
+ // Initialize scenario
+ fProxy.setScenario(SCEN_SCEN_BUF_SIZE_TEST);
+
+ session = fFacility.createSession(groups[1]);
+
+ // Verify that session was created
+ assertNotNull(session);
+ assertEquals("mysession", session.getName());
+
+ // ------------------------------------------------------------------------
+ // Enable default channel on created session above
+ // ------------------------------------------------------------------------
+ info = (ChannelInfo)channelStub.getChannelInfo();
+ info.setName("mychannel");
+ info.setMaxNumberTraceFiles(10);
+ info.setMaxSizeTraceFiles(1024);
+ info.setBufferType(BufferType.BUFFER_TYPE_UNKNOWN);
+ channelStub.setChannelInfo(info);
+
+ fFacility.executeCommand(session, "enableChannelOnSession");
+
+ // Verify that UST domain was created
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ assertEquals("UST global", domains[0].getName());
+ assertEquals("Domain buffer Type", BufferType.BUFFER_PER_PID, ((TraceDomainComponent)domains[0]).getBufferType());
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ assertNotNull(channels);
+ assertEquals(1, channels.length);
+
+ assertTrue(channels[0] instanceof TraceChannelComponent);
+ channel = (TraceChannelComponent) channels[0];
+ assertEquals("mychannel", channel.getName());
+
+ // ------------------------------------------------------------------------
+ // Destroy session
+ // ------------------------------------------------------------------------
+ fFacility.destroySession(session);
+
+ // Verify that no more session components exist
+ assertEquals(0, groups[1].getChildren().length);
+
+ //-------------------------------------------------------------------------
+ // Disconnect node
+ //-------------------------------------------------------------------------
+ fFacility.executeCommand(node, "disconnect");
+ assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
+
+ //-------------------------------------------------------------------------
+ // Delete node
+ //-------------------------------------------------------------------------
+
+ fFacility.executeCommand(node, "delete");
+ assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length);
+ }
+}
\ No newline at end of file
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2012, 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:
+ * Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
+ * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
+ **********************************************************************/
+
+package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.ILogListener;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.remote.core.IRemoteConnection;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceChannelOutputType;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEventType;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.BufferType;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.ChannelInfo;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.AddContextDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.EnableEventsDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub;
+import org.eclipse.tracecompass.internal.lttng2.control.stubs.service.TestRemoteSystemProxy;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceEventComponent;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.FrameworkUtil;
+
+/**
+ * The class <code>TraceControlUstSessionTests</code> contains UST
+ * session/channel/event handling test cases.
+ */
+public class TraceControlUstSessionTest {
+
+ // ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+
+ private static final String TEST_STREAM = "CreateTreeTest.cfg";
+ private static final String SCEN_SCENARIO4_TEST = "Scenario4";
+
+ // ------------------------------------------------------------------------
+ // Test data
+ // ------------------------------------------------------------------------
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
+ private TraceControlTestFacility fFacility;
+ private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
+ private String fTestFile;
+
+ // ------------------------------------------------------------------------
+ // Housekeeping
+ // ------------------------------------------------------------------------
+
+ /**
+ * Perform pre-test initialization.
+ *
+ * @throws Exception
+ * if the initialization fails for some reason
+ */
+ @Before
+ public void setUp() throws Exception {
+ fFacility = TraceControlTestFacility.getInstance();
+ fFacility.init();
+ URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null);
+ File testfile = new File(FileLocator.toFileURL(location).toURI());
+ fTestFile = testfile.getAbsolutePath();
+ }
+
+ /**
+ * Perform post-test clean-up.
+ */
+ @After
+ public void tearDown() {
+ fFacility.dispose();
+ }
+
+ /**
+ * Run the TraceControlComponent.
+ *
+ * @throws Exception
+ * This will fail the test
+ */
+ @Test
+ public void testTraceSessionTree() throws Exception {
+
+ fProxy.setTestFile(fTestFile);
+ fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
+
+ ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot();
+
+ TargetNodeComponent node = new TargetNodeComponent("myNode", root, fProxy);
+
+ root.addChild(node);
+ fFacility.waitForJobs();
+
+ fFacility.executeCommand(node, "connect");
+ int i = 0;
+ while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) {
+ i++;
+ fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
+ }
+
+ // Get provider groups
+ ITraceControlComponent[] groups = node.getChildren();
+ assertNotNull(groups);
+ assertEquals(2, groups.length);
+
+ // Initialize dialog implementations for command execution
+ TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub());
+ TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());
+ TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
+
+ // Initialize session handling scenario
+ fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
+
+ // ------------------------------------------------------------------------
+ // Create session
+ // ------------------------------------------------------------------------
+ TraceSessionComponent session = fFacility.createSession(groups[1]);
+
+ // Verify that session was created
+ assertNotNull(session);
+ assertEquals("mysession", session.getName());
+ assertEquals("/home/user/lttng-traces/mysession-20120314-132824", session.getSessionPath());
+ assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
+
+ // Initialize scenario
+ fProxy.setScenario(SCEN_SCENARIO4_TEST);
+
+ // ------------------------------------------------------------------------
+ // Enable default channel on created session above
+ // ------------------------------------------------------------------------
+ EnableChannelDialogStub channelStub = new EnableChannelDialogStub();
+ channelStub.setIsKernel(false);
+ TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub);
+
+ fFacility.executeCommand(session, "enableChannelOnSession");
+
+ // Verify that Kernel domain was created
+ ITraceControlComponent[] domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ assertEquals("UST global", domains[0].getName());
+ assertEquals("Domain buffer Type", BufferType.BUFFER_TYPE_UNKNOWN, ((TraceDomainComponent)domains[0]).getBufferType());
+
+ // Verify that channel was created with correct data
+ ITraceControlComponent[] channels = domains[0].getChildren();
+ assertNotNull(channels);
+ assertEquals(1, channels.length);
+
+ assertTrue(channels[0] instanceof TraceChannelComponent);
+ TraceChannelComponent channel = (TraceChannelComponent) channels[0];
+ assertEquals("mychannel", channel.getName());
+ assertEquals(4, channel.getNumberOfSubBuffers());
+ assertEquals("mmap()", channel.getOutputType().getInName());
+ assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType());
+ assertEquals(true, channel.isOverwriteMode());
+ assertEquals(200, channel.getReadTimer());
+ assertEquals(TraceEnablement.ENABLED, channel.getState());
+ assertEquals(16384, channel.getSubBufferSize());
+ assertEquals(100, channel.getSwitchTimer());
+
+ // ------------------------------------------------------------------------
+ // Add context on channel
+ // ------------------------------------------------------------------------
+ AddContextDialogStub addContextStub = new AddContextDialogStub();
+ List<String> contexts = new ArrayList<>();
+ contexts.add("procname");
+ contexts.add("vtid");
+ addContextStub.setContexts(contexts);
+ TraceControlDialogFactory.getInstance().setAddContextDialog(addContextStub);
+
+ /*
+ * Currently there is nothing to verify because the list commands don't
+ * show any context information. However, the execution of the command
+ * makes sure that the correct service command line is built and
+ * executed.
+ *
+ * There was a bug in the control where the add context command was
+ * called with -k option instead of -u. Sending the -k option would
+ * cause that the command string is not found in the scenario. When a
+ * command string is not found then it is logged in the error log.
+ *
+ * Check the error log here to verify that the command was successful.
+ */
+ final IStatus[] statusToCheck = new IStatus[1];
+ ILogListener listener = new ILogListener() {
+ @Override
+ public void logging(IStatus status, String plugin) {
+ if (plugin.contentEquals(Activator.PLUGIN_ID) && (!status.isOK())) {
+ statusToCheck[0] = status;
+ }
+ }
+ };
+ Activator.getDefault().getLog().addLogListener(listener);
+
+ fFacility.executeCommand(channels[0], "addContextOnChannel");
+
+ // check that no error status was created
+ assertNull(statusToCheck[0]);
+
+ Activator.getDefault().getLog().removeLogListener(listener);
+
+ fFacility.delay(10000);
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // ------------------------------------------------------------------------
+ // Enable channel on domain
+ // ------------------------------------------------------------------------
+ ChannelInfo info = (ChannelInfo)channelStub.getChannelInfo();
+ info.setName("mychannel2");
+ info.setOverwriteMode(false);
+ info.setSubBufferSize(32768);
+ info.setNumberOfSubBuffers(2);
+ info.setSwitchTimer(100);
+ info.setReadTimer(200);
+ channelStub.setChannelInfo(info);
+
+ fFacility.executeCommand(domains[0], "enableChannelOnDomain");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ assertNotNull(channels);
+ assertEquals(2, channels.length);
+
+ assertTrue(channels[1] instanceof TraceChannelComponent);
+ channel = (TraceChannelComponent) channels[1];
+ assertEquals("mychannel2", channel.getName());
+ assertEquals(2, channel.getNumberOfSubBuffers());
+ assertEquals("mmap()", channel.getOutputType().getInName());
+ assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType());
+ assertEquals(false, channel.isOverwriteMode());
+ assertEquals(200, channel.getReadTimer());
+ assertEquals(TraceEnablement.ENABLED, channel.getState());
+ assertEquals(32768, channel.getSubBufferSize());
+ assertEquals(100, channel.getSwitchTimer());
+
+ // ------------------------------------------------------------------------
+ // Enable event (tracepoint) on session and default channel
+ // ------------------------------------------------------------------------
+ EnableEventsDialogStub eventsDialogStub = new EnableEventsDialogStub();
+ eventsDialogStub.setIsTracePoints(true);
+ List<String> events = new ArrayList<>();
+ events.add("ust_tests_hello:tptest_sighandler");
+ eventsDialogStub.setNames(events);
+ eventsDialogStub.setIsKernel(false);
+ TraceControlDialogFactory.getInstance().setEnableEventsDialog(eventsDialogStub);
+
+ fFacility.executeCommand(session, "enableEventOnSession");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ assertNotNull(channels);
+ assertEquals(3, channels.length);
+
+ assertTrue(channels[2] instanceof TraceChannelComponent);
+ channel = (TraceChannelComponent) channels[2];
+ assertEquals("channel0", channel.getName());
+ // No need to check parameters of default channel because that has been done in other tests
+
+ ITraceControlComponent[] channel0Events = channel.getChildren();
+ assertEquals(1, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceEventComponent);
+
+ TraceEventComponent event = (TraceEventComponent) channel0Events[0];
+ assertEquals("ust_tests_hello:tptest_sighandler", event.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); // TODO
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // Enable event (tracepoint) on domain and default channel
+ // ------------------------------------------------------------------------
+ events.clear();
+ events.add("ust_tests_hello:tptest");
+ eventsDialogStub.setNames(events);
+
+ fFacility.executeCommand(domains[0], "enableEventOnDomain");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[2];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel0Events = channel.getChildren();
+ assertEquals(2, channel0Events.length);
+
+ assertTrue(channel0Events[1] instanceof TraceEventComponent);
+
+ event = (TraceEventComponent) channel0Events[1];
+ assertEquals("ust_tests_hello:tptest", event.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); // TODO
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // Enable event (all tracepoints) on specific channel
+ // ------------------------------------------------------------------------
+ events.clear();
+ eventsDialogStub.setNames(events);
+ eventsDialogStub.setIsAllTracePoints(true);
+
+ fFacility.executeCommand(channels[1], "enableEventOnChannel");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[1];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel = (TraceChannelComponent) channels[1];
+
+ channel0Events = channel.getChildren();
+ assertEquals(1, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceEventComponent);
+
+ event = (TraceEventComponent) channel0Events[0];
+ assertEquals("*", event.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // Enable event (wildcard) on specific channel
+ // ------------------------------------------------------------------------
+ events.clear();
+ eventsDialogStub.setIsTracePoints(false);
+ eventsDialogStub.setIsAllTracePoints(false);
+ eventsDialogStub.setIsWildcard(true);
+ eventsDialogStub.setWildcard("ust*");
+
+ fFacility.executeCommand(channels[0], "enableEventOnChannel");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[0];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel0Events = channel.getChildren();
+ assertEquals(1, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceEventComponent);
+
+ event = (TraceEventComponent) channel0Events[0];
+ assertEquals("ust*", event.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // Enable event (wildcard) on domain
+ // ------------------------------------------------------------------------
+ events.clear();
+ eventsDialogStub.setIsTracePoints(false);
+ eventsDialogStub.setIsAllTracePoints(false);
+ eventsDialogStub.setIsWildcard(true);
+ eventsDialogStub.setWildcard("ust*");
+
+ fFacility.executeCommand(domains[0], "enableEventOnDomain");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[0];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel0Events = channel.getChildren();
+ assertEquals(1, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceEventComponent);
+
+ event = (TraceEventComponent) channel0Events[0];
+ assertEquals("ust*", event.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // Enable event (wildcard) on session
+ // ------------------------------------------------------------------------
+ events.clear();
+ eventsDialogStub.setIsTracePoints(false);
+ eventsDialogStub.setIsAllTracePoints(false);
+ eventsDialogStub.setIsWildcard(true);
+ eventsDialogStub.setWildcard("ust*");
+
+ fFacility.executeCommand(domains[0], "enableEventOnDomain");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[2];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel0Events = channel.getChildren();
+ assertEquals(4, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceEventComponent);
+
+ event = (TraceEventComponent) channel0Events[0];
+ assertEquals("u*", event.getName());
+ assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // Enable event (loglevel) on domain
+ // ------------------------------------------------------------------------
+ events.clear();
+ eventsDialogStub.setIsWildcard(false);
+ eventsDialogStub.setIsLogLevel(true);
+ eventsDialogStub.setLogLevelEventName("myevent1");
+ eventsDialogStub.setLogLevelType(LogLevelType.LOGLEVEL);
+ eventsDialogStub.setLogLevel(TraceLogLevel.TRACE_WARNING);
+
+ fFacility.executeCommand(domains[0], "enableEventOnDomain");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[2];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel0Events = channel.getChildren();
+ assertEquals(5, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceEventComponent);
+
+ event = (TraceEventComponent) channel0Events[0];
+ assertEquals("myevent1", event.getName());
+ assertEquals(TraceLogLevel.TRACE_WARNING, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // Enable event (loglevel) on session
+ // ------------------------------------------------------------------------
+ eventsDialogStub.setLogLevelEventName("myevent2");
+ eventsDialogStub.setLogLevelType(LogLevelType.LOGLEVEL_ONLY);
+ eventsDialogStub.setLogLevel(TraceLogLevel.TRACE_DEBUG_FUNCTION);
+
+ fFacility.executeCommand(session, "enableEventOnSession");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[2];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel0Events = channel.getChildren();
+ assertEquals(6, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceEventComponent);
+
+ event = (TraceEventComponent) channel0Events[0];
+ assertEquals("myevent2", event.getName());
+ assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // Enable event (loglevel) on channel
+ // ------------------------------------------------------------------------
+ eventsDialogStub.setLogLevelEventName("myevent0");
+ eventsDialogStub.setLogLevelType(LogLevelType.LOGLEVEL_ONLY);
+ eventsDialogStub.setLogLevel(TraceLogLevel.TRACE_DEBUG_FUNCTION);
+
+ fFacility.executeCommand(channels[0], "enableEventOnChannel");
+
+ // Get Kernel domain component instance
+ domains = session.getChildren();
+ assertNotNull(domains);
+ assertEquals(1, domains.length);
+
+ // Verify that channel was created with correct data
+ channels = domains[0].getChildren();
+ channel = (TraceChannelComponent) channels[0];
+ // No need to check parameters of default channel because that has been done in other tests
+
+ channel0Events = channel.getChildren();
+ assertEquals(2, channel0Events.length);
+
+ assertTrue(channel0Events[0] instanceof TraceEventComponent);
+
+ event = (TraceEventComponent) channel0Events[0];
+ assertEquals("myevent0", event.getName());
+ assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, event.getLogLevel());
+ assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
+ assertEquals(TraceEnablement.ENABLED, event.getState());
+
+ // ------------------------------------------------------------------------
+ // Destroy session
+ // ------------------------------------------------------------------------
+ // Initialize session handling scenario
+ fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
+
+ fFacility.destroySession(session);
+
+ // Verify that no more session components exist
+ assertEquals("Session components still exist.", 0, groups[1].getChildren().length);
+
+ //-------------------------------------------------------------------------
+ // Disconnect node
+ //-------------------------------------------------------------------------
+ fFacility.executeCommand(node, "disconnect");
+ assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
+
+ //-------------------------------------------------------------------------
+ // Delete node
+ //-------------------------------------------------------------------------
+
+ fFacility.executeCommand(node, "delete");
+ assertEquals("Node not deleted.", 0, fFacility.getControlView().getTraceControlRoot().getChildren().length);
+ }
+}
\ No newline at end of file
+++ /dev/null
-/**********************************************************************
- * Copyright (c) 2012, 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:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
- **********************************************************************/
-
-package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.ILogListener;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.remote.core.IRemoteConnection;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceChannelOutputType;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEventType;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.BufferType;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.ChannelInfo;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.AddContextDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.EnableEventsDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceEventComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.FrameworkUtil;
-
-/**
- * The class <code>TraceControlUstSessionTests</code> contains UST
- * session/channel/event handling test cases.
- */
-public class TraceControlUstSessionTests {
-
- // ------------------------------------------------------------------------
- // Constants
- // ------------------------------------------------------------------------
-
- private static final String TEST_STREAM = "CreateTreeTest.cfg";
- private static final String SCEN_SCENARIO4_TEST = "Scenario4";
-
- // ------------------------------------------------------------------------
- // Test data
- // ------------------------------------------------------------------------
- private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
- private TraceControlTestFacility fFacility;
- private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
- private String fTestFile;
-
- // ------------------------------------------------------------------------
- // Housekeeping
- // ------------------------------------------------------------------------
-
- /**
- * Perform pre-test initialization.
- *
- * @throws Exception
- * if the initialization fails for some reason
- */
- @Before
- public void setUp() throws Exception {
- fFacility = TraceControlTestFacility.getInstance();
- fFacility.init();
- URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null);
- File testfile = new File(FileLocator.toFileURL(location).toURI());
- fTestFile = testfile.getAbsolutePath();
- }
-
- /**
- * Perform post-test clean-up.
- */
- @After
- public void tearDown() {
- fFacility.dispose();
- }
-
- /**
- * Run the TraceControlComponent.
- *
- * @throws Exception
- * This will fail the test
- */
- @Test
- public void testTraceSessionTree() throws Exception {
-
- fProxy.setTestFile(fTestFile);
- fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
-
- ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot();
-
- TargetNodeComponent node = new TargetNodeComponent("myNode", root, fProxy);
-
- root.addChild(node);
- fFacility.waitForJobs();
-
- fFacility.executeCommand(node, "connect");
- int i = 0;
- while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) {
- i++;
- fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
- }
-
- // Get provider groups
- ITraceControlComponent[] groups = node.getChildren();
- assertNotNull(groups);
- assertEquals(2, groups.length);
-
- // Initialize dialog implementations for command execution
- TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub());
- TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());
- TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
-
- // Initialize session handling scenario
- fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
-
- // ------------------------------------------------------------------------
- // Create session
- // ------------------------------------------------------------------------
- TraceSessionComponent session = fFacility.createSession(groups[1]);
-
- // Verify that session was created
- assertNotNull(session);
- assertEquals("mysession", session.getName());
- assertEquals("/home/user/lttng-traces/mysession-20120314-132824", session.getSessionPath());
- assertEquals(TraceSessionState.INACTIVE, session.getSessionState());
-
- // Initialize scenario
- fProxy.setScenario(SCEN_SCENARIO4_TEST);
-
- // ------------------------------------------------------------------------
- // Enable default channel on created session above
- // ------------------------------------------------------------------------
- EnableChannelDialogStub channelStub = new EnableChannelDialogStub();
- channelStub.setIsKernel(false);
- TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub);
-
- fFacility.executeCommand(session, "enableChannelOnSession");
-
- // Verify that Kernel domain was created
- ITraceControlComponent[] domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- assertEquals("UST global", domains[0].getName());
- assertEquals("Domain buffer Type", BufferType.BUFFER_TYPE_UNKNOWN, ((TraceDomainComponent)domains[0]).getBufferType());
-
- // Verify that channel was created with correct data
- ITraceControlComponent[] channels = domains[0].getChildren();
- assertNotNull(channels);
- assertEquals(1, channels.length);
-
- assertTrue(channels[0] instanceof TraceChannelComponent);
- TraceChannelComponent channel = (TraceChannelComponent) channels[0];
- assertEquals("mychannel", channel.getName());
- assertEquals(4, channel.getNumberOfSubBuffers());
- assertEquals("mmap()", channel.getOutputType().getInName());
- assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType());
- assertEquals(true, channel.isOverwriteMode());
- assertEquals(200, channel.getReadTimer());
- assertEquals(TraceEnablement.ENABLED, channel.getState());
- assertEquals(16384, channel.getSubBufferSize());
- assertEquals(100, channel.getSwitchTimer());
-
- // ------------------------------------------------------------------------
- // Add context on channel
- // ------------------------------------------------------------------------
- AddContextDialogStub addContextStub = new AddContextDialogStub();
- List<String> contexts = new ArrayList<>();
- contexts.add("procname");
- contexts.add("vtid");
- addContextStub.setContexts(contexts);
- TraceControlDialogFactory.getInstance().setAddContextDialog(addContextStub);
-
- /*
- * Currently there is nothing to verify because the list commands don't
- * show any context information. However, the execution of the command
- * makes sure that the correct service command line is built and
- * executed.
- *
- * There was a bug in the control where the add context command was
- * called with -k option instead of -u. Sending the -k option would
- * cause that the command string is not found in the scenario. When a
- * command string is not found then it is logged in the error log.
- *
- * Check the error log here to verify that the command was successful.
- */
- final IStatus[] statusToCheck = new IStatus[1];
- ILogListener listener = new ILogListener() {
- @Override
- public void logging(IStatus status, String plugin) {
- if (plugin.contentEquals(Activator.PLUGIN_ID) && (!status.isOK())) {
- statusToCheck[0] = status;
- }
- }
- };
- Activator.getDefault().getLog().addLogListener(listener);
-
- fFacility.executeCommand(channels[0], "addContextOnChannel");
-
- // check that no error status was created
- assertNull(statusToCheck[0]);
-
- Activator.getDefault().getLog().removeLogListener(listener);
-
- fFacility.delay(10000);
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // ------------------------------------------------------------------------
- // Enable channel on domain
- // ------------------------------------------------------------------------
- ChannelInfo info = (ChannelInfo)channelStub.getChannelInfo();
- info.setName("mychannel2");
- info.setOverwriteMode(false);
- info.setSubBufferSize(32768);
- info.setNumberOfSubBuffers(2);
- info.setSwitchTimer(100);
- info.setReadTimer(200);
- channelStub.setChannelInfo(info);
-
- fFacility.executeCommand(domains[0], "enableChannelOnDomain");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- assertNotNull(channels);
- assertEquals(2, channels.length);
-
- assertTrue(channels[1] instanceof TraceChannelComponent);
- channel = (TraceChannelComponent) channels[1];
- assertEquals("mychannel2", channel.getName());
- assertEquals(2, channel.getNumberOfSubBuffers());
- assertEquals("mmap()", channel.getOutputType().getInName());
- assertEquals(TraceChannelOutputType.MMAP, channel.getOutputType());
- assertEquals(false, channel.isOverwriteMode());
- assertEquals(200, channel.getReadTimer());
- assertEquals(TraceEnablement.ENABLED, channel.getState());
- assertEquals(32768, channel.getSubBufferSize());
- assertEquals(100, channel.getSwitchTimer());
-
- // ------------------------------------------------------------------------
- // Enable event (tracepoint) on session and default channel
- // ------------------------------------------------------------------------
- EnableEventsDialogStub eventsDialogStub = new EnableEventsDialogStub();
- eventsDialogStub.setIsTracePoints(true);
- List<String> events = new ArrayList<>();
- events.add("ust_tests_hello:tptest_sighandler");
- eventsDialogStub.setNames(events);
- eventsDialogStub.setIsKernel(false);
- TraceControlDialogFactory.getInstance().setEnableEventsDialog(eventsDialogStub);
-
- fFacility.executeCommand(session, "enableEventOnSession");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- assertNotNull(channels);
- assertEquals(3, channels.length);
-
- assertTrue(channels[2] instanceof TraceChannelComponent);
- channel = (TraceChannelComponent) channels[2];
- assertEquals("channel0", channel.getName());
- // No need to check parameters of default channel because that has been done in other tests
-
- ITraceControlComponent[] channel0Events = channel.getChildren();
- assertEquals(1, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceEventComponent);
-
- TraceEventComponent event = (TraceEventComponent) channel0Events[0];
- assertEquals("ust_tests_hello:tptest_sighandler", event.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); // TODO
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // Enable event (tracepoint) on domain and default channel
- // ------------------------------------------------------------------------
- events.clear();
- events.add("ust_tests_hello:tptest");
- eventsDialogStub.setNames(events);
-
- fFacility.executeCommand(domains[0], "enableEventOnDomain");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[2];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel0Events = channel.getChildren();
- assertEquals(2, channel0Events.length);
-
- assertTrue(channel0Events[1] instanceof TraceEventComponent);
-
- event = (TraceEventComponent) channel0Events[1];
- assertEquals("ust_tests_hello:tptest", event.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel()); // TODO
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // Enable event (all tracepoints) on specific channel
- // ------------------------------------------------------------------------
- events.clear();
- eventsDialogStub.setNames(events);
- eventsDialogStub.setIsAllTracePoints(true);
-
- fFacility.executeCommand(channels[1], "enableEventOnChannel");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[1];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel = (TraceChannelComponent) channels[1];
-
- channel0Events = channel.getChildren();
- assertEquals(1, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceEventComponent);
-
- event = (TraceEventComponent) channel0Events[0];
- assertEquals("*", event.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // Enable event (wildcard) on specific channel
- // ------------------------------------------------------------------------
- events.clear();
- eventsDialogStub.setIsTracePoints(false);
- eventsDialogStub.setIsAllTracePoints(false);
- eventsDialogStub.setIsWildcard(true);
- eventsDialogStub.setWildcard("ust*");
-
- fFacility.executeCommand(channels[0], "enableEventOnChannel");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[0];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel0Events = channel.getChildren();
- assertEquals(1, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceEventComponent);
-
- event = (TraceEventComponent) channel0Events[0];
- assertEquals("ust*", event.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // Enable event (wildcard) on domain
- // ------------------------------------------------------------------------
- events.clear();
- eventsDialogStub.setIsTracePoints(false);
- eventsDialogStub.setIsAllTracePoints(false);
- eventsDialogStub.setIsWildcard(true);
- eventsDialogStub.setWildcard("ust*");
-
- fFacility.executeCommand(domains[0], "enableEventOnDomain");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[0];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel0Events = channel.getChildren();
- assertEquals(1, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceEventComponent);
-
- event = (TraceEventComponent) channel0Events[0];
- assertEquals("ust*", event.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // Enable event (wildcard) on session
- // ------------------------------------------------------------------------
- events.clear();
- eventsDialogStub.setIsTracePoints(false);
- eventsDialogStub.setIsAllTracePoints(false);
- eventsDialogStub.setIsWildcard(true);
- eventsDialogStub.setWildcard("ust*");
-
- fFacility.executeCommand(domains[0], "enableEventOnDomain");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[2];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel0Events = channel.getChildren();
- assertEquals(4, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceEventComponent);
-
- event = (TraceEventComponent) channel0Events[0];
- assertEquals("u*", event.getName());
- assertEquals(TraceLogLevel.LEVEL_UNKNOWN, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // Enable event (loglevel) on domain
- // ------------------------------------------------------------------------
- events.clear();
- eventsDialogStub.setIsWildcard(false);
- eventsDialogStub.setIsLogLevel(true);
- eventsDialogStub.setLogLevelEventName("myevent1");
- eventsDialogStub.setLogLevelType(LogLevelType.LOGLEVEL);
- eventsDialogStub.setLogLevel(TraceLogLevel.TRACE_WARNING);
-
- fFacility.executeCommand(domains[0], "enableEventOnDomain");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[2];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel0Events = channel.getChildren();
- assertEquals(5, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceEventComponent);
-
- event = (TraceEventComponent) channel0Events[0];
- assertEquals("myevent1", event.getName());
- assertEquals(TraceLogLevel.TRACE_WARNING, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // Enable event (loglevel) on session
- // ------------------------------------------------------------------------
- eventsDialogStub.setLogLevelEventName("myevent2");
- eventsDialogStub.setLogLevelType(LogLevelType.LOGLEVEL_ONLY);
- eventsDialogStub.setLogLevel(TraceLogLevel.TRACE_DEBUG_FUNCTION);
-
- fFacility.executeCommand(session, "enableEventOnSession");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[2];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel0Events = channel.getChildren();
- assertEquals(6, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceEventComponent);
-
- event = (TraceEventComponent) channel0Events[0];
- assertEquals("myevent2", event.getName());
- assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // Enable event (loglevel) on channel
- // ------------------------------------------------------------------------
- eventsDialogStub.setLogLevelEventName("myevent0");
- eventsDialogStub.setLogLevelType(LogLevelType.LOGLEVEL_ONLY);
- eventsDialogStub.setLogLevel(TraceLogLevel.TRACE_DEBUG_FUNCTION);
-
- fFacility.executeCommand(channels[0], "enableEventOnChannel");
-
- // Get Kernel domain component instance
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- channel = (TraceChannelComponent) channels[0];
- // No need to check parameters of default channel because that has been done in other tests
-
- channel0Events = channel.getChildren();
- assertEquals(2, channel0Events.length);
-
- assertTrue(channel0Events[0] instanceof TraceEventComponent);
-
- event = (TraceEventComponent) channel0Events[0];
- assertEquals("myevent0", event.getName());
- assertEquals(TraceLogLevel.TRACE_DEBUG_FUNCTION, event.getLogLevel());
- assertEquals(TraceEventType.TRACEPOINT, event.getEventType());
- assertEquals(TraceEnablement.ENABLED, event.getState());
-
- // ------------------------------------------------------------------------
- // Destroy session
- // ------------------------------------------------------------------------
- // Initialize session handling scenario
- fProxy.setScenario(TraceControlTestFacility.SCEN_SCENARIO_SESSION_HANDLING);
-
- fFacility.destroySession(session);
-
- // Verify that no more session components exist
- assertEquals("Session components still exist.", 0, groups[1].getChildren().length);
-
- //-------------------------------------------------------------------------
- // Disconnect node
- //-------------------------------------------------------------------------
- fFacility.executeCommand(node, "disconnect");
- assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
-
- //-------------------------------------------------------------------------
- // Delete node
- //-------------------------------------------------------------------------
-
- fFacility.executeCommand(node, "delete");
- assertEquals("Node not deleted.", 0, fFacility.getControlView().getTraceControlRoot().getChildren().length);
- }
-}
\ No newline at end of file
+++ /dev/null
-/**********************************************************************
- * 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:
- * Bernd Hufmann - Initial API and implementation
- * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
- **********************************************************************/
-
-package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.net.URL;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.remote.core.IRemoteConnection;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.BufferType;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.ChannelInfo;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.CreateSessionDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.DestroyConfirmDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.EnableChannelDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs.GetEventInfoDialogStub;
-import org.eclipse.tracecompass.internal.lttng2.control.stubs.service.TestRemoteSystemProxy;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent;
-import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.osgi.framework.FrameworkUtil;
-
-/**
- * The class <code>TraceControlUstSessionTests</code> contains UST
- * session/channel/event handling test cases for LTTng 2.2.
- */
-public class TraceControlUstSessionTests2 {
-
- // ------------------------------------------------------------------------
- // Constants
- // ------------------------------------------------------------------------
-
- private static final String TEST_STREAM = "CreateTreeTest2.cfg";
- private static final String SCEN_SCEN_PER_UID_TEST = "ScenPerUidTest";
- private static final String SCEN_SCEN_PER_PID_TEST = "ScenPerPidTest";
- private static final String SCEN_SCEN_BUF_SIZE_TEST = "ScenBufSizeTest";
-
- // ------------------------------------------------------------------------
- // Test data
- // ------------------------------------------------------------------------
-
- private TraceControlTestFacility fFacility;
- private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
- private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
- private String fTestFile;
-
- // ------------------------------------------------------------------------
- // Housekeeping
- // ------------------------------------------------------------------------
-
- /**
- * Perform pre-test initialization.
- *
- * @throws Exception
- * if the initialization fails for some reason
- */
- @Before
- public void setUp() throws Exception {
- fFacility = TraceControlTestFacility.getInstance();
- fFacility.init();
- URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(TraceControlTestFacility.DIRECTORY + File.separator + TEST_STREAM), null);
- File testfile = new File(FileLocator.toFileURL(location).toURI());
- fTestFile = testfile.getAbsolutePath();
- }
-
- /**
- * Perform post-test clean-up.
- */
- @After
- public void tearDown() {
- fFacility.dispose();
- }
-
- /**
- * Run the TraceControlComponent.
- *
- * @throws Exception
- * This will fail the test
- */
- @Test
- public void testTraceSessionTree() throws Exception {
-
- fProxy.setTestFile(fTestFile);
- fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
-
- ITraceControlComponent root = fFacility.getControlView().getTraceControlRoot();
-
- TargetNodeComponent node = new TargetNodeComponent("myNode", root, fProxy);
-
- root.addChild(node);
- fFacility.waitForJobs();
-
- fFacility.executeCommand(node, "connect");
- int i = 0;
- while ((i < 10) && (node.getTargetNodeState() != TargetNodeState.CONNECTED)) {
- i++;
- fFacility.delay(TraceControlTestFacility.GUI_REFESH_DELAY);
- }
-
- // Get provider groups
- ITraceControlComponent[] groups = node.getChildren();
- assertNotNull(groups);
- assertEquals(2, groups.length);
-
- // Initialize dialog implementations for command execution
- TraceControlDialogFactory.getInstance().setCreateSessionDialog(new CreateSessionDialogStub());
- TraceControlDialogFactory.getInstance().setGetEventInfoDialog(new GetEventInfoDialogStub());
- TraceControlDialogFactory.getInstance().setConfirmDialog(new DestroyConfirmDialogStub());
-
- // Initialize scenario
- fProxy.setScenario(SCEN_SCEN_PER_UID_TEST);
-
- // ------------------------------------------------------------------------
- // Create session
- // ------------------------------------------------------------------------
- TraceSessionComponent session = fFacility.createSession(groups[1]);
-
- // Verify that session was created
- assertNotNull(session);
- assertEquals("mysession", session.getName());
-
- // ------------------------------------------------------------------------
- // Enable default channel on created session above
- // ------------------------------------------------------------------------
- EnableChannelDialogStub channelStub = new EnableChannelDialogStub();
- channelStub.setIsKernel(false);
- ChannelInfo info = (ChannelInfo)channelStub.getChannelInfo();
- info.setName("mychannel");
- info.setOverwriteMode(false);
- info.setSubBufferSize(-1);
- info.setNumberOfSubBuffers(-1);
- info.setSwitchTimer(-1);
- info.setReadTimer(-1);
- info.setMaxNumberTraceFiles(-1);
- info.setMaxSizeTraceFiles(-1);
- info.setBufferType(BufferType.BUFFER_PER_UID);
- channelStub.setChannelInfo(info);
-
- TraceControlDialogFactory.getInstance().setEnableChannelDialog(channelStub);
-
- fFacility.executeCommand(session, "enableChannelOnSession");
-
- // Verify that UST domain was created
- ITraceControlComponent[] domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- assertEquals("UST global", domains[0].getName());
- assertEquals("Domain buffer Type", BufferType.BUFFER_PER_UID, ((TraceDomainComponent)domains[0]).getBufferType());
-
- // Verify that channel was created with correct data
- ITraceControlComponent[] channels = domains[0].getChildren();
- assertNotNull(channels);
- assertEquals(1, channels.length);
-
- assertTrue(channels[0] instanceof TraceChannelComponent);
- TraceChannelComponent channel = (TraceChannelComponent) channels[0];
- assertEquals("mychannel", channel.getName());
-
- // ------------------------------------------------------------------------
- // Destroy session
- // ------------------------------------------------------------------------
- fFacility.destroySession(session);
-
- // Verify that no more session components exist
- assertEquals(0, groups[1].getChildren().length);
-
- // ------------------------------------------------------------------------
- // Create session (per-pid buffers)
- // ------------------------------------------------------------------------
-
- // Initialize scenario
- fProxy.setScenario(SCEN_SCEN_PER_PID_TEST);
-
- session = fFacility.createSession(groups[1]);
-
- // Verify that session was created
- assertNotNull(session);
- assertEquals("mysession", session.getName());
-
- // ------------------------------------------------------------------------
- // Enable default channel on created session above
- // ------------------------------------------------------------------------
- info = (ChannelInfo)channelStub.getChannelInfo();
- info.setName("mychannel");
- info.setBufferType(BufferType.BUFFER_PER_PID);
- channelStub.setChannelInfo(info);
-
- fFacility.executeCommand(session, "enableChannelOnSession");
-
- // Verify that UST domain was created
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- assertEquals("UST global", domains[0].getName());
- assertEquals("Domain buffer Type", BufferType.BUFFER_PER_PID, ((TraceDomainComponent)domains[0]).getBufferType());
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- assertNotNull(channels);
- assertEquals(1, channels.length);
-
- assertTrue(channels[0] instanceof TraceChannelComponent);
- channel = (TraceChannelComponent) channels[0];
- assertEquals("mychannel", channel.getName());
-
- // ------------------------------------------------------------------------
- // Destroy session
- // ------------------------------------------------------------------------
- fFacility.destroySession(session);
-
- // Verify that no more session components exist
- assertEquals(0, groups[1].getChildren().length);
-
- // ------------------------------------------------------------------------
- // Create session (configured file size and number of files)
- // ------------------------------------------------------------------------
-
- // Initialize scenario
- fProxy.setScenario(SCEN_SCEN_BUF_SIZE_TEST);
-
- session = fFacility.createSession(groups[1]);
-
- // Verify that session was created
- assertNotNull(session);
- assertEquals("mysession", session.getName());
-
- // ------------------------------------------------------------------------
- // Enable default channel on created session above
- // ------------------------------------------------------------------------
- info = (ChannelInfo)channelStub.getChannelInfo();
- info.setName("mychannel");
- info.setMaxNumberTraceFiles(10);
- info.setMaxSizeTraceFiles(1024);
- info.setBufferType(BufferType.BUFFER_TYPE_UNKNOWN);
- channelStub.setChannelInfo(info);
-
- fFacility.executeCommand(session, "enableChannelOnSession");
-
- // Verify that UST domain was created
- domains = session.getChildren();
- assertNotNull(domains);
- assertEquals(1, domains.length);
-
- assertEquals("UST global", domains[0].getName());
- assertEquals("Domain buffer Type", BufferType.BUFFER_PER_PID, ((TraceDomainComponent)domains[0]).getBufferType());
-
- // Verify that channel was created with correct data
- channels = domains[0].getChildren();
- assertNotNull(channels);
- assertEquals(1, channels.length);
-
- assertTrue(channels[0] instanceof TraceChannelComponent);
- channel = (TraceChannelComponent) channels[0];
- assertEquals("mychannel", channel.getName());
-
- // ------------------------------------------------------------------------
- // Destroy session
- // ------------------------------------------------------------------------
- fFacility.destroySession(session);
-
- // Verify that no more session components exist
- assertEquals(0, groups[1].getChildren().length);
-
- //-------------------------------------------------------------------------
- // Disconnect node
- //-------------------------------------------------------------------------
- fFacility.executeCommand(node, "disconnect");
- assertEquals(TargetNodeState.DISCONNECTED, node.getTargetNodeState());
-
- //-------------------------------------------------------------------------
- // Delete node
- //-------------------------------------------------------------------------
-
- fFacility.executeCommand(node, "delete");
- assertEquals(0,fFacility.getControlView().getTraceControlRoot().getChildren().length);
- }
-}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2011, 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:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.control.ui.tests.service;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Runner for the service unit tests.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- LTTngControlServiceTest.class,
- LTTngControlServiceMiTest.class
-})
-public class AllTests {
-
-}
org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.kernel;x-internal:=true,
org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.kernel.statesystem;x-internal:=true,
org.eclipse.tracecompass.lttng2.kernel.core.tests.event.matchandsync;x-internal:=true,
- org.eclipse.tracecompass.lttng2.kernel.core.tests.perf,
- org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.analysis;x-internal:=true,
+ org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.analysis,
+ org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.event.matching,
org.eclipse.tracecompass.lttng2.lttng.kernel.core.tests.shared.vm
Import-Package: com.google.common.collect,
org.eclipse.test.performance,
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Alexandre Montplaisir - Initial implementation and API
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.tests.perf;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Run all performance test suites.
- *
- * @author Alexandre Montplaisir
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.analysis.AllPerfTests.class,
- org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.event.matching.AllPerfTests.class
-})
-public class AllPerfTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.analysis;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- AnalysisBenchmark.class,
- StatisticsAnalysisBenchmark.class
-})
-public class AllPerfTests {
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.event.matching;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- EventMatchingBenchmark.class,
- TraceSynchronizationBenchmark.class
-})
-public class AllPerfTests {
-
-}
<name>Trace Compass LTTng Kernel Analysis Core Tests Plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <testSuite>org.eclipse.tracecompass.lttng2.kernel.core.tests</testSuite>
- <testClass>org.eclipse.tracecompass.lttng2.kernel.core.tests.AllTests</testClass>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 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
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.tests;
-
-import org.eclipse.tracecompass.tmf.core.tests.shared.DebugSuite;
-import org.junit.runner.RunWith;
-
-/**
- * Runner for the lttng2.kernel unit tests.
- */
-@RunWith(DebugSuite.class)
-@DebugSuite.SuiteClasses({
- ActivatorTest.class,
- org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.graph.AllTests.class,
- org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.kernel.AllTests.class,
- org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.kernel.statesystem.TestAll.class,
- org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.vm.AllTests.class,
- org.eclipse.tracecompass.lttng2.kernel.core.tests.event.matchandsync.AllTests.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2015 École Polytechnique de Montréal
- *
- * 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
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.graph;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for execution graph analysis
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- LttngExecutionGraphTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014, 2015 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.kernel;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.linuxtools.lttng2.kernel.core.analysis package
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- LttngKernelAnalysisTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 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:
- * Alexandre Montplaisir - Initial implementation
- ******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.kernel.statesystem;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Runner for the LTTng kernel state system tests.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- PartialStateSystemTest.class,
- StateSystemFullHistoryTest.class,
- StateSystemInMemoryTest.class
-})
-public class TestAll {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.vm;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- VirtualMachineAnalysisTest.class
-})
-public class AllTests {
-}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2013, 2014 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.core.tests.event.matchandsync;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.linuxtools.lttng2.kernel.core.tests.event.matching
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- ExperimentSyncTest.class,
- MatchAndSyncTest.class
-})
-public class AllTests {
-
-}
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
- <testSuite>org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests</testSuite>
- <testClass>org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests.AllTests</testClass>
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
- <argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
- <product>org.eclipse.platform.ide</product>
<environmentVariables>
<SWT_GTK3>${SWT_GTK3}</SWT_GTK3>
<LIBOVERLAY_SCROLLBAR>0</LIBOVERLAY_SCROLLBAR>
+++ /dev/null
-/*******************************************************************************
- * 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.lttng2.kernel.ui.swtbot.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for UI on the lttng kernel perspective
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- KernelPerspectiveChecker.class,
- ImportAndReadKernelSmokeTest.class,
- ControlFlowViewTest.class,
- ResourcesViewTest.class,
- OpenTraceStressTest.class
-})
-public class AllTests {
-
-}
import org.eclipse.swt.SWT;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.keyboard.Keyboard;
import org.eclipse.swtbot.swt.finder.keyboard.KeyboardFactory;
import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
import org.eclipse.ui.IWorkbenchPart;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
/**
* SWTBot tests for Control Flow view
*
* @author Patrick Tasse
*/
-public class ControlFlowViewTest extends KernelTest {
+@RunWith(SWTBotJunit4ClassRunner.class)
+public class ControlFlowViewTest extends KernelTestBase {
private static final String FOLLOW_CPU_BACKWARD = "Follow CPU Backward";
private static final String FOLLOW_CPU_FORWARD = "Follow CPU Forward";
public void before() {
super.before();
fViewBot = fBot.viewByTitle("Control Flow");
+ fViewBot.show();
+ fViewBot.setFocus();
}
/**
* @author Matthew Khouzam
*/
@RunWith(SWTBotJunit4ClassRunner.class)
-public class ImportAndReadKernelSmokeTest extends KernelTest {
+public class ImportAndReadKernelSmokeTest extends KernelTestBase {
private ITmfEvent fDesired1;
private ITmfEvent fDesired2;
+++ /dev/null
-/*******************************************************************************
- * 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
- * Marc-Andre Laperle
- * Patrick Tasse - Extract base class from ImportAndReadKernelSmokeTest
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests;
-
-import static org.junit.Assert.fail;
-
-import java.util.List;
-
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.Logger;
-import org.apache.log4j.SimpleLayout;
-import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
-import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
-import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
-import org.eclipse.swtbot.swt.finder.results.BoolResult;
-import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
-import org.eclipse.tracecompass.ctf.core.tests.shared.LttngKernelTraceGenerator;
-import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.ConditionHelpers;
-import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotUtils;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.WorkbenchException;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.runner.RunWith;
-
-/**
- * Base SWTBot test for LTTng Kernel UI.
- *
- * @author Matthew Khouzam
- */
-@RunWith(SWTBotJunit4ClassRunner.class)
-public class KernelTest {
-
- private static final String TRACE_TYPE = "org.eclipse.linuxtools.lttng2.kernel.tracetype";
- private static final String KERNEL_PERSPECTIVE_ID = "org.eclipse.linuxtools.lttng2.kernel.ui.perspective";
- private static final String TRACE_PROJECT_NAME = "test";
-
- /** The workbench bot */
- protected static SWTWorkbenchBot fBot;
-
- /** The Log4j logger instance. */
- private static final Logger fLogger = Logger.getRootLogger();
-
- /**
- * Before Class
- */
- @BeforeClass
- public static void beforeClass() {
- SWTBotUtils.initialize();
-
- /* set up for swtbot */
- SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */
- SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
- fLogger.removeAllAppenders();
- fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT));
- fBot = new SWTWorkbenchBot();
-
- final List<SWTBotView> openViews = fBot.views();
- for (SWTBotView view : openViews) {
- if (view.getTitle().equals("Welcome")) {
- view.close();
- fBot.waitUntil(ConditionHelpers.ViewIsClosed(view));
- }
- }
- /* Switch perspectives */
- switchKernelPerspective();
- /* Create the trace project */
- SWTBotUtils.createProject(TRACE_PROJECT_NAME);
- /* Finish waiting for eclipse to load */
- SWTBotUtils.waitForJobs();
- }
-
- /**
- * After Class
- */
- @AfterClass
- public static void afterClass() {
- SWTBotUtils.deleteProject(TRACE_PROJECT_NAME, fBot);
- fLogger.removeAllAppenders();
- }
-
- private static void switchKernelPerspective() {
- final Exception retE[] = new Exception[1];
- if (!UIThreadRunnable.syncExec(new BoolResult() {
- @Override
- public Boolean run() {
- try {
- PlatformUI.getWorkbench().showPerspective(KERNEL_PERSPECTIVE_ID,
- PlatformUI.getWorkbench().getActiveWorkbenchWindow());
- } catch (WorkbenchException e) {
- retE[0] = e;
- return false;
- }
- return true;
- }
- })) {
- fail(retE[0].getMessage());
- }
-
- }
-
- /**
- * Before Test
- */
- @Before
- public void before() {
- SWTBotUtils.openTrace(TRACE_PROJECT_NAME, LttngKernelTraceGenerator.getPath(), TRACE_TYPE);
- SWTBotUtils.activateEditor(fBot, LttngKernelTraceGenerator.getName());
- }
-
- /**
- * After Test
- */
- @After
- public void after() {
- fBot.closeAllEditors();
- }
-}
--- /dev/null
+/*******************************************************************************
+ * 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
+ * Marc-Andre Laperle
+ * Patrick Tasse - Extract base class from ImportAndReadKernelSmokeTest
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests;
+
+import static org.junit.Assert.fail;
+
+import java.util.List;
+
+import org.apache.log4j.ConsoleAppender;
+import org.apache.log4j.Logger;
+import org.apache.log4j.SimpleLayout;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.results.BoolResult;
+import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
+import org.eclipse.tracecompass.ctf.core.tests.shared.LttngKernelTraceGenerator;
+import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.ConditionHelpers;
+import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.SWTBotUtils;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchException;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+
+/**
+ * Base SWTBot test for LTTng Kernel UI.
+ *
+ * @author Matthew Khouzam
+ */
+@RunWith(SWTBotJunit4ClassRunner.class)
+public abstract class KernelTestBase {
+
+ private static final String TRACE_TYPE = "org.eclipse.linuxtools.lttng2.kernel.tracetype";
+ private static final String KERNEL_PERSPECTIVE_ID = "org.eclipse.linuxtools.lttng2.kernel.ui.perspective";
+ private static final String TRACE_PROJECT_NAME = "test";
+
+ /** The workbench bot */
+ protected static SWTWorkbenchBot fBot;
+
+ /** The Log4j logger instance. */
+ private static final Logger fLogger = Logger.getRootLogger();
+
+ /**
+ * Before Class
+ */
+ @BeforeClass
+ public static void beforeClass() {
+ SWTBotUtils.initialize();
+
+ /* set up for swtbot */
+ SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */
+ SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
+ fLogger.removeAllAppenders();
+ fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT));
+ fBot = new SWTWorkbenchBot();
+
+ final List<SWTBotView> openViews = fBot.views();
+ for (SWTBotView view : openViews) {
+ if (view.getTitle().equals("Welcome")) {
+ view.close();
+ fBot.waitUntil(ConditionHelpers.ViewIsClosed(view));
+ }
+ }
+ /* Switch perspectives */
+ switchKernelPerspective();
+ /* Create the trace project */
+ SWTBotUtils.createProject(TRACE_PROJECT_NAME);
+ /* Finish waiting for eclipse to load */
+ SWTBotUtils.waitForJobs();
+ }
+
+ /**
+ * After Class
+ */
+ @AfterClass
+ public static void afterClass() {
+ SWTBotUtils.deleteProject(TRACE_PROJECT_NAME, fBot);
+ fLogger.removeAllAppenders();
+ }
+
+ private static void switchKernelPerspective() {
+ final Exception retE[] = new Exception[1];
+ if (!UIThreadRunnable.syncExec(new BoolResult() {
+ @Override
+ public Boolean run() {
+ try {
+ PlatformUI.getWorkbench().showPerspective(KERNEL_PERSPECTIVE_ID,
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow());
+ } catch (WorkbenchException e) {
+ retE[0] = e;
+ return false;
+ }
+ return true;
+ }
+ })) {
+ fail(retE[0].getMessage());
+ }
+
+ }
+
+ /**
+ * Before Test
+ */
+ @Before
+ public void before() {
+ SWTBotUtils.openTrace(TRACE_PROJECT_NAME, LttngKernelTraceGenerator.getPath(), TRACE_TYPE);
+ SWTBotUtils.activateEditor(fBot, LttngKernelTraceGenerator.getName());
+ }
+
+ /**
+ * After Test
+ */
+ @After
+ public void after() {
+ fBot.closeAllEditors();
+ }
+}
*
* @author Patrick Tasse
*/
-public class ResourcesViewTest extends KernelTest {
+public class ResourcesViewTest extends KernelTestBase {
private static final String NEXT_MARKER = "Next Marker";
private static final String PREVIOUS_MARKER = "Previous Marker";
<name>Trace Compass LTTng Userspace Tracer Analysis Core Test Plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.ust.core.tests;
-
-import org.eclipse.tracecompass.tmf.core.tests.shared.DebugSuite;
-import org.junit.runner.RunWith;
-
-/**
- * Runner for the lttng2.kernel unit tests.
- */
-@RunWith(DebugSuite.class)
-@DebugSuite.SuiteClasses({
- ActivatorTest.class,
- org.eclipse.tracecompass.lttng2.ust.core.tests.analysis.debuginfo.AllTests.class,
- org.eclipse.tracecompass.lttng2.ust.core.tests.analysis.memory.AllTests.class,
- org.eclipse.tracecompass.lttng2.ust.core.tests.callstack.AllTests.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2015 EfficiOS inc. and others
- *
- * 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.ust.core.tests.analysis.debuginfo;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- UstDebugInfoAnalysisModuleTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * 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:
- * Guilliano Molaire - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.ust.core.tests.analysis.memory;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- UstMemoryAnalysisModuleTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Alexandre Montplaisir - Initial implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.ust.core.tests.callstack;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.lttng2.ust.core.tests.trace.callstack
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- LttngUstCallStackProviderFastTest.class,
- LttngUstCallStackProviderTest.class
-})
-public class AllTests {
-
-}
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
- <version>${tycho-version}</version>
<configuration>
- <testSuite>org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests</testSuite>
- <testClass>org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests.AllTests</testClass>
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
- <argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
- <product>org.eclipse.platform.ide</product>
-<!-- Disable GTK3 with Luna because it makes the test hang (bug in IcedTea http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1736) -->
<environmentVariables>
<SWT_GTK3>${SWT_GTK3}</SWT_GTK3>
<LIBOVERLAY_SCROLLBAR>0</LIBOVERLAY_SCROLLBAR>
</plugins>
</build>
- <groupId>org.eclipse.tracecompass</groupId>
</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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.lttng2.ust.ui.swtbot.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * SWTBot test suite for lttng2.ust.ui
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CallStackViewTest.class,
- MemoryUsageViewTest.class
-})
-public class AllTests {
-
-}
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
- <testSuite>org.eclipse.tracecompass.lttng2.ust.ui.tests</testSuite>
- <testClass>org.eclipse.tracecompass.lttng2.ust.ui.tests.AllTests</testClass>
<useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
- <argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
- <product>org.eclipse.platform.ide</product>
</configuration>
</plugin>
</plugins>
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.ust.ui.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Run the lttng2.ust.ui unit tests.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- ActivatorTest.class,
-})
-public class AllTests {
-
-}
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.tracecompass.pcap.core
-Export-Package: org.eclipse.tracecompass.pcap.core.tests,
- org.eclipse.tracecompass.pcap.core.tests.file;x-internal:=true,
+Export-Package: org.eclipse.tracecompass.pcap.core.tests.file;x-internal:=true,
org.eclipse.tracecompass.pcap.core.tests.packet;x-internal:=true,
- org.eclipse.tracecompass.pcap.core.tests.perf,
- org.eclipse.tracecompass.pcap.core.tests.perf.trace;x-internal:=true,
+ org.eclipse.tracecompass.pcap.core.tests.perf.trace,
org.eclipse.tracecompass.pcap.core.tests.protocol;x-internal:=true,
org.eclipse.tracecompass.pcap.core.tests.protocol.ethernet2;x-internal:=true,
org.eclipse.tracecompass.pcap.core.tests.protocol.ipv4;x-internal:=true,
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial implementation and API
- *******************************************************************************/
-
-package org.eclipse.tracecompass.pcap.core.tests.perf;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Run all performance test suites.
- *
- * @author Vincent Perot
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- org.eclipse.tracecompass.pcap.core.tests.perf.trace.AllTests.class
-})
-public class AllPerfTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.pcap.core.tests.perf.trace;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- PcapReadBenchmark.class,
- PcapSeekBenchmark.class
-})
-public class AllTests {
-}
<build>
<plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <testSuite>org.eclipse.tracecompass.pcap.core.tests</testSuite>
- <testClass>org.eclipse.tracecompass.pcap.core.tests.AllPcapCoreTests</testClass>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
<!-- We don't use the ant file to clean because of http://jira.codehaus.org/browse/MANTRUN-78 -->
<plugin>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.pcap.core.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Master test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- org.eclipse.tracecompass.pcap.core.tests.file.AllTests.class,
- org.eclipse.tracecompass.pcap.core.tests.packet.AllTests.class,
- org.eclipse.tracecompass.pcap.core.tests.protocol.AllTests.class,
- org.eclipse.tracecompass.pcap.core.tests.protocol.ethernet2.AllTests.class,
- org.eclipse.tracecompass.pcap.core.tests.protocol.ipv4.AllTests.class,
- org.eclipse.tracecompass.pcap.core.tests.protocol.pcap.AllTests.class,
- org.eclipse.tracecompass.pcap.core.tests.protocol.tcp.AllTests.class,
- org.eclipse.tracecompass.pcap.core.tests.protocol.udp.AllTests.class,
- org.eclipse.tracecompass.pcap.core.tests.protocol.unknown.AllTests.class,
- org.eclipse.tracecompass.pcap.core.tests.stream.AllTests.class
-})
-public class AllPcapCoreTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.pcap.core.tests.file;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * File test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- PcapFileOpenTest.class,
- PcapFileOpenFailTest.class,
- PcapFileReadTest.class,
- PcapFileEndiannessTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.pcap.core.tests.packet;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Generic Packet test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- PacketTest.class,
- BadPacketTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.pcap.core.tests.protocol;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Protocol test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- ProtocolTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.pcap.core.tests.protocol.ethernet2;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Ethernet II test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- EthernetIIPacketTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.pcap.core.tests.protocol.ipv4;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * IPv4 test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- IPv4PacketTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.pcap.core.tests.protocol.pcap;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Pcap test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- PcapPacketTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.pcap.core.tests.protocol.tcp;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * TCP test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TCPPacketTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.pcap.core.tests.protocol.udp;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * UDP test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- UDPPacketTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.pcap.core.tests.protocol.unknown;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Unknown test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- UnknownPacketTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.pcap.core.tests.stream;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Stream test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- StreamBuildTest.class
-})
-public class AllTests {
-
-}
org.eclipse.tracecompass.tmf.core.tests,
org.eclipse.tracecompass.tmf.pcap.core
Import-Package: com.google.common.collect
-Export-Package: org.eclipse.tracecompass.tmf.pcap.core.tests,
- org.eclipse.tracecompass.tmf.pcap.core.tests.analysis;x-internal:=true,
+Export-Package: org.eclipse.tracecompass.tmf.pcap.core.tests.analysis;x-internal:=true,
org.eclipse.tracecompass.tmf.pcap.core.tests.event;x-internal:=true,
org.eclipse.tracecompass.tmf.pcap.core.tests.shared;x-friends:="org.eclipse.tracecompass.tmf.pcap.ui.swtbot.tests",
org.eclipse.tracecompass.tmf.pcap.core.tests.stubs;x-internal:=true,
<name>Pcap Support for TMF Core Tests Plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>prepare</id>
- <phase>validate</phase>
- <configuration>
- <target>
- <echo message="prepare phase" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <includes>
- <include>**/AllTests.*</include>
- </includes>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial generation with CodePro tools
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.pcap.core.tests;
-
-import org.eclipse.tracecompass.tmf.core.tests.shared.DebugSuite;
-import org.junit.runner.RunWith;
-
-/**
- * The class <code>AllTmfPcapCoreTests</code> builds a suite to run all the
- * tests.
- *
- * @author Vincent Perot
- */
-@RunWith(DebugSuite.class)
-@DebugSuite.SuiteClasses({
- org.eclipse.tracecompass.tmf.pcap.core.tests.analysis.AllTests.class,
- org.eclipse.tracecompass.tmf.pcap.core.tests.event.AllTests.class,
- org.eclipse.tracecompass.tmf.pcap.core.tests.trace.AllTests.class
-})
-public class AllTmfPcapCoreTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.pcap.core.tests.analysis;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Analysis test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- StreamListAnalysisTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.pcap.core.tests.event;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Event and Event Field test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- PcapEventTest.class,
- PcapEventFieldTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Vincent Perot - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.pcap.core.tests.trace;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Pcap trace test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- PcapTraceTest.class
-})
-public class AllTests {
-
-}
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
- <testSuite>org.eclipse.tracecompass.tmf.pcap.ui.swtbot.tests</testSuite>
- <testClass>org.eclipse.tracecompass.tmf.pcap.ui.swtbot.tests.AllTests</testClass>
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
- <argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
- <product>org.eclipse.platform.ide</product>
<environmentVariables>
<SWT_GTK3>${SWT_GTK3}</SWT_GTK3>
<LIBOVERLAY_SCROLLBAR>0</LIBOVERLAY_SCROLLBAR>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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.pcap.ui.swtbot.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for UI on the PCAP parser and networking perspective
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- ImportAndReadPcapTest.class,
- NetworkPerspectiveChecker.class
-})
-public class AllTests {
-}
</licenses>
<properties>
- <base.test.vmargs>-Xms256m -Xmx1024m -XX:MaxPermSize=256m</base.test.vmargs>
<tycho-version>0.24.0</tycho-version>
<tycho-extras-version>0.24.0</tycho-extras-version>
<tycho.scmUrl>scm:git:git://git.eclipse.org/gitroot/tracecompass/org.eclipse.tracecompass.git</tycho.scmUrl>
</os>
</activation>
<properties>
- <base.ui.test.vmargs>${base.test.vmargs} -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Djava.awt.headless=false</base.ui.test.vmargs>
+ <base.ui.test.vmargs>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Djava.awt.headless=false</base.ui.test.vmargs>
</properties>
</profile>
<profile>
</activation>
<properties>
<!-- Disable webkit integration, especially unstable on Linux -->
- <base.ui.test.vmargs>${base.test.vmargs} -Dorg.eclipse.swt.browser.DefaultType=mozilla</base.ui.test.vmargs>
+ <base.ui.test.vmargs>-Dorg.eclipse.swt.browser.DefaultType=mozilla</base.ui.test.vmargs>
</properties>
</profile>
</profiles>
</configuration>
</plugin>
</plugins>
+
<pluginManagement>
<plugins>
<plugin>
<artifactId>tycho-p2-repository-plugin</artifactId>
<version>${tycho-version}</version>
</plugin>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <version>${tycho-version}</version>
- <configuration>
- <useUIHarness>true</useUIHarness>
- <useUIThread>true</useUIThread>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <!-- Default configuration, UI tests may have to override these -->
+ <useUIHarness>false</useUIHarness>
+ <useUIThread>false</useUIThread>
<dependencies>
<dependency>
<type>p2-installable-unit</type>
</dependency>
</dependencies>
<product>org.eclipse.platform.ide</product>
- <argLine>${tycho.testArgLine} -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m</argLine>
- </configuration>
- </plugin>
+ <argLine>${tycho.testArgLine} ${base.ui.test.vmargs} -Xms512m -Xmx1024m</argLine>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-versions-plugin</artifactId>
</dependency>
</dependencies>
</plugin>
- <plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
- org.eclipse.tracecompass.common.core.tests.AllCommonCoreTests.class,
- org.eclipse.tracecompass.btf.core.tests.AllTests.class,
- org.eclipse.tracecompass.ctf.core.tests.AllCtfCoreTests.class,
- org.eclipse.tracecompass.ctf.parser.tests.AllCtfParserTests.class,
- org.eclipse.tracecompass.gdbtrace.core.tests.AllGdbTraceCoreTests.class,
- org.eclipse.tracecompass.analysis.os.linux.core.tests.AllTests.class,
- org.eclipse.tracecompass.analysis.graph.core.tests.AllAnalysisGraphCoreTests.class,
- org.eclipse.tracecompass.lttng2.control.core.tests.AllTests.class,
- org.eclipse.tracecompass.lttng2.kernel.core.tests.AllTests.class,
- org.eclipse.tracecompass.lttng2.ust.core.tests.AllTests.class,
- org.eclipse.tracecompass.pcap.core.tests.AllPcapCoreTests.class,
- org.eclipse.tracecompass.statesystem.core.tests.AllTests.class,
- org.eclipse.tracecompass.segmentstore.core.tests.AllTests.class,
- org.eclipse.tracecompass.tmf.analysis.xml.core.tests.AllAnalysisXmlCoreTests.class,
- org.eclipse.tracecompass.tmf.core.tests.AllTmfCoreTests.class,
- org.eclipse.tracecompass.tmf.remote.core.tests.AllTmfRemoteCoreTests.class,
- org.eclipse.tracecompass.tmf.ctf.core.tests.AllTests.class,
- org.eclipse.tracecompass.tmf.pcap.core.tests.AllTmfPcapCoreTests.class
+ // FIXME Link to all core tests
})
public class RunAllCoreTests {
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
- org.eclipse.tracecompass.gdbtrace.ui.tests.AllGdbTraceUITests.class,
- org.eclipse.tracecompass.lttng2.control.ui.tests.AllTests.class,
- org.eclipse.tracecompass.lttng2.ust.ui.tests.AllTests.class,
- org.eclipse.tracecompass.tmf.analysis.xml.ui.tests.AllAnalysisXmlUiTests.class,
- org.eclipse.tracecompass.tmf.remote.ui.tests.AllTmfRemoteUITests.class,
- org.eclipse.tracecompass.tmf.ui.tests.AllTmfUITests.class,
+ // FIXME Link to all UI tests
})
public class RunAllUITests {
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
- org.eclipse.tracecompass.ctf.core.tests.perf.AllPerfTests.class,
- org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.AllPerfTests.class,
- org.eclipse.tracecompass.pcap.core.tests.perf.AllPerfTests.class,
- org.eclipse.tracecompass.tmf.core.tests.perf.AllPerfTests.class,
- org.eclipse.tracecompass.tmf.ctf.core.tests.perf.AllPerfTests.class
+ org.eclipse.tracecompass.ctf.core.tests.perf.trace.TraceReadBenchmark.class,
+ org.eclipse.tracecompass.ctf.core.tests.perf.trace.TraceSeekBenchmark.class,
+
+ org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.analysis.AnalysisBenchmark.class,
+ org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.analysis.StatisticsAnalysisBenchmark.class,
+ org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.event.matching.EventMatchingBenchmark.class,
+ org.eclipse.tracecompass.lttng2.kernel.core.tests.perf.event.matching.TraceSynchronizationBenchmark.class,
+
+ org.eclipse.tracecompass.pcap.core.tests.perf.trace.PcapReadBenchmark.class,
+ org.eclipse.tracecompass.pcap.core.tests.perf.trace.PcapSeekBenchmark.class,
+
+ org.eclipse.tracecompass.tmf.core.tests.perf.synchronization.TimestampTransformBenchmark.class,
+
+ org.eclipse.tracecompass.tmf.ctf.core.tests.perf.experiment.ExperimentBenchmark.class
})
public class RunAllPerfTests {
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
- org.eclipse.tracecompass.tmf.ui.swtbot.tests.AllTmfUISWTBotTests.class,
- org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests.AllTests.class,
- org.eclipse.tracecompass.tmf.pcap.ui.swtbot.tests.AllTests.class,
- org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests.AllTmfRemoteUISWTBotTests.class,
- org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests.AllTests.class,
- org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests.AllTests.class
+ // FIXME Link to all swtbot tests
})
public class RunAllSWTBotTests {
org.eclipse.core.resources,
org.eclipse.tracecompass.common.core,
org.eclipse.tracecompass.segmentstore.core
-Export-Package: org.eclipse.tracecompass.segmentstore.core.tests
+Export-Package: org.eclipse.tracecompass.segmentstore.core.tests.treemap;x-internal:=true
Import-Package: com.google.common.collect
<name>Trace Compass Segment Store DB Core Tests Plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <testSuite>org.eclipse.tracecompass.segmentstore.core.tests</testSuite>
- <testClass>org.eclipse.tracecompass.segmentstore.core.tests.AllTests</testClass>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2015 EfficiOS Inc. and others
- *
- * 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
- *******************************************************************************/
-
-package org.eclipse.tracecompass.segmentstore.core.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Master test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- org.eclipse.tracecompass.segmentstore.core.tests.treemap.AllTests.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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
- ******************************************************************************/
-
-package org.eclipse.tracecompass.segmentstore.core.tests.treemap;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.segmentstore.core.treemap
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TreeMapStoreTest.class
-})
-public class AllTests {
-
-}
<name>Trace Compass State System Core Tests Plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <testSuite>org.eclipse.tracecompass.statesystem.core.tests</testSuite>
- <testClass>org.eclipse.tracecompass.statesystem.core.tests.AllTests</testClass>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014, 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:
- * Alexandre Montplaisir - Initial API and implementation
- * Patrick Tasse - Enable StateSystemUtils tests
- *******************************************************************************/
-
-package org.eclipse.tracecompass.statesystem.core.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Master test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- AttributeTreeTest.class,
- StateSystemPushPopTest.class,
- StateSystemUtilsTest.class,
- org.eclipse.tracecompass.statesystem.core.tests.backend.AllTests.class,
- org.eclipse.tracecompass.statesystem.core.tests.statevalue.AllTests.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Alexandre Montplaisir - Initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.tracecompass.statesystem.core.tests.backend;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.statesystem.core.backend
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- HistoryTreeTest.class,
- InMemoryBackendTest.class
-})
-public class AllTests {
-
-}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * 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:
- * Naser Ezzati - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.statesystem.core.tests.statevalue;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for the StateValue package
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- StateValueCompareToTest.class
-})
-public class AllTests {
-
-}
<name>Trace Compass TMF Xml Analysis Core Tests Plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <testSuite>org.eclipse.tracecompass.tmf.analysis.xml.core.tests</testSuite>
- <testClass>org.eclipse.tracecompass.tmf.analysis.xml.core.tests.AllAnalysisXmlCoreTests</testClass>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.sdk.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2013, 2014 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.analysis.xml.core.tests;
-
-import org.eclipse.tracecompass.tmf.core.tests.shared.DebugSuite;
-import org.junit.runner.RunWith;
-
-/**
- * Master test suite for TMF XML Core Analysis plug-in.
- */
-@RunWith(DebugSuite.class)
-@DebugSuite.SuiteClasses({
- XmlAnalysisCorePluginTest.class,
- org.eclipse.tracecompass.tmf.analysis.xml.core.tests.module.AllTests.class,
- org.eclipse.tracecompass.tmf.analysis.xml.core.tests.stateprovider.AllTests.class
-})
-public class AllAnalysisXmlCoreTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014, 2015 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.analysis.xml.core.tests.module;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.tmf.analysis.xml.core.module package
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- XmlUtilsTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2013, 2015 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.analysis.xml.core.tests.stateprovider;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.tmf.analysis.xml.core.stateprovider
- * package
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- StateProviderModelTest.class,
- StateProviderTest.class,
- StateProviderModuleTest.class,
- TmfXmlConditionTest.class})
-public class AllTests {
-
-}
\ No newline at end of file
<name>Trace Compass TMF Xml Analysis UI Tests Plug-in</name>
- <build>
+ <build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
- <testSuite>org.eclipse.tracecompass.tmf.analysis.xml.ui.tests</testSuite>
- <testClass>org.eclipse.tracecompass.tmf.analysis.xml.ui.tests.AllAnalysisXmlUiTests</testClass>
<useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
- <argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
- <product>org.eclipse.sdk.ide</product>
</configuration>
</plugin>
</plugins>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2013, 2014 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.analysis.xml.ui.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Master test suite for TMF XML Analysis UI plug-in.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- XmlAnalysisUiPluginTest.class,
- org.eclipse.tracecompass.tmf.analysis.xml.ui.tests.module.AllTests.class
-})
-public class AllAnalysisXmlUiTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014, 2015 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.analysis.xml.ui.tests.module;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.tmf.analysis.xml.ui.module package
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- XmlAnalysisModuleSourceTest.class
-})
-public class AllTests {
-
-}
org.eclipse.test.performance,
org.eclipse.cdt.core
Export-Package: org.eclipse.tracecompass.tmf.core.tests,
- org.eclipse.tracecompass.tmf.core.tests.perf,
+ org.eclipse.tracecompass.tmf.core.tests.perf.synchronization,
org.eclipse.tracecompass.tmf.core.tests.shared,
org.eclipse.tracecompass.tmf.tests.stubs.trace,
org.eclipse.tracecompass.tmf.tests.stubs.trace.xml
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial implementation and API
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.perf;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * The class <code>AllPerformanceTests</code> builds a suite that can be used to
- * run all of the performance tests within its package as well as within any
- * subpackages of its package.
- *
- * @author Geneviève Bastien
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- org.eclipse.tracecompass.tmf.core.tests.perf.synchronization.AllPerfTests.class
-})
-public class AllPerfTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.perf.synchronization;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Performance tests for the synchronization classes
- *
- * @author Geneviève Bastien
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TimestampTransformBenchmark.class
-})
-public class AllPerfTests {
-
-}
<name>Trace Compass TMF Core Tests Plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <testSuite>org.eclipse.tracecompass.tmf.core.tests</testSuite>
- <testClass>org.eclipse.tracecompass.tmf.core.tests.AllTmfCoreTests</testClass>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * 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
- * Alexandre Montplaisir - Port to JUnit4, enable CTF and statistics tests
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests;
-
-import org.eclipse.tracecompass.tmf.core.tests.shared.DebugSuite;
-import org.junit.runner.RunWith;
-
-/**
- * Master test suite for TMF Core.
- */
-@RunWith(DebugSuite.class)
-@DebugSuite.SuiteClasses({
- TmfCorePluginTest.class,
- org.eclipse.tracecompass.tmf.core.tests.analysis.AllTests.class,
- org.eclipse.tracecompass.tmf.core.tests.callstack.AllTests.class,
- org.eclipse.tracecompass.tmf.core.tests.component.AllTests.class,
- org.eclipse.tracecompass.tmf.core.tests.event.AllTests.class,
- 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,
- org.eclipse.tracecompass.tmf.core.tests.statesystem.mipmap.AllTests.class,
- org.eclipse.tracecompass.tmf.core.tests.synchronization.AllTests.class,
- org.eclipse.tracecompass.tmf.core.tests.trace.AllTests.class,
- org.eclipse.tracecompass.tmf.core.tests.trace.indexer.AllTests.class,
- org.eclipse.tracecompass.tmf.core.tests.trace.indexer.checkpoint.AllTests.class,
- org.eclipse.tracecompass.tmf.core.tests.trace.location.AllTests.class,
- org.eclipse.tracecompass.tmf.core.tests.trace.text.AllTests.class,
- org.eclipse.tracecompass.tmf.core.tests.uml2sd.AllTests.class,
- org.eclipse.tracecompass.tmf.core.tests.util.AllTests.class
-})
-public class AllTmfCoreTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2013, 2014 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.analysis;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Unit tests for the analysis package.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- AnalysisManagerTest.class,
- AnalysisModuleTest.class,
- AnalysisModuleHelperTest.class,
- AnalysisParameterProviderTest.class,
- AnalysisRequirementTest.class,
- AnalysisRequirementHelperTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.callstack;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- FunctionNameMapperTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.component;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Unit tests for the component package.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfEventProviderCoalescingTest.class,
- TmfEventProviderTest.class,
- TmfProviderManagerTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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 - Adjusted for new Event Model
- * Alexandre Montplaisir - Port to JUnit4
- * Patrick Tasse - Added TmfNanoTimestampTest
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.event;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.tmf.core.event
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfEventFieldTest.class,
- TmfEventFieldValueEqualsTest.class,
- TmfEventTest.class,
- TmfEventTypeTest.class,
- TmfNanoTimestampTest.class,
- TmfSimpleTimestampTest.class,
- TmfTimePreferencesTest.class,
- TmfTimeRangeTest.class,
- TmfTimestampDeltaTest.class,
- TmfTimestampTest.class,
- TmfTimestampFormatTest.class,
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Bernd Hufmann - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.event.lookup;
-
-import org.eclipse.tracecompass.tmf.core.tests.event.lookup.TmfCallsiteTest;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.tmf.core.event.lookup
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfCallsiteTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014, 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:
- * Bernd Hufmann - Initial API and implementation
- * Patrick Tasse - Added filter node tests
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.filter;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Filter tests.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfFilterAndNodeTest.class,
- TmfFilterCompareNodeTest.class,
- TmfFilterContainsNodeTest.class,
- TmfFilterEqualsNodeTest.class,
- TmfFilterMatchesNodeTest.class,
- TmfFilterNodeTest.class,
- TmfFilterOrNodeTest.class,
- TmfFilterRootNodeTest.class,
- TmfFilterTraceTypeNodeTest.class,
- TmfCollapseFilterTest.class,
-})
-public class AllTests {
-
-}
* @author Patrick Tasse
*/
@SuppressWarnings("javadoc")
-public class TmfFilterAndNodeTest extends TmfFilterTreeNodeTest {
+public class TmfFilterAndNodeTest extends TmfFilterTreeNodeTestBase {
// ------------------------------------------------------------------------
// Variables
* @author Patrick Tasse
*/
@SuppressWarnings("javadoc")
-public class TmfFilterCompareNodeTest extends TmfFilterTreeNodeTest {
+public class TmfFilterCompareNodeTest extends TmfFilterTreeNodeTestBase {
// ------------------------------------------------------------------------
// Variables
* @author Patrick Tasse
*/
@SuppressWarnings("javadoc")
-public class TmfFilterContainsNodeTest extends TmfFilterTreeNodeTest {
+public class TmfFilterContainsNodeTest extends TmfFilterTreeNodeTestBase {
// ------------------------------------------------------------------------
// Variables
* @author Patrick Tasse
*/
@SuppressWarnings("javadoc")
-public class TmfFilterEqualsNodeTest extends TmfFilterTreeNodeTest {
+public class TmfFilterEqualsNodeTest extends TmfFilterTreeNodeTestBase {
// ------------------------------------------------------------------------
// Variables
* @author Patrick Tasse
*/
@SuppressWarnings("javadoc")
-public class TmfFilterMatchesNodeTest extends TmfFilterTreeNodeTest {
+public class TmfFilterMatchesNodeTest extends TmfFilterTreeNodeTestBase {
// ------------------------------------------------------------------------
// Variables
* @author Patrick Tasse
*/
@SuppressWarnings("javadoc")
-public class TmfFilterNodeTest extends TmfFilterTreeNodeTest {
+public class TmfFilterNodeTest extends TmfFilterTreeNodeTestBase {
// ------------------------------------------------------------------------
// Variables
* @author Patrick Tasse
*/
@SuppressWarnings("javadoc")
-public class TmfFilterOrNodeTest extends TmfFilterTreeNodeTest {
+public class TmfFilterOrNodeTest extends TmfFilterTreeNodeTestBase {
// ------------------------------------------------------------------------
// Variables
* @author Patrick Tasse
*/
@SuppressWarnings("javadoc")
-public class TmfFilterRootNodeTest extends TmfFilterTreeNodeTest {
+public class TmfFilterRootNodeTest extends TmfFilterTreeNodeTestBase {
// ------------------------------------------------------------------------
// Variables
* @author Patrick Tasse
*/
@SuppressWarnings("javadoc")
-public class TmfFilterTraceTypeNodeTest extends TmfFilterTreeNodeTest {
+public class TmfFilterTraceTypeNodeTest extends TmfFilterTreeNodeTestBase {
// ------------------------------------------------------------------------
// Variables
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Patrick Tasse - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.filter;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
-import org.eclipse.tracecompass.tmf.core.event.ITmfEventType;
-import org.eclipse.tracecompass.tmf.core.event.TmfEventField;
-import org.eclipse.tracecompass.tmf.core.event.TmfEventType;
-import org.eclipse.tracecompass.tmf.core.filter.model.ITmfFilterTreeNode;
-import org.eclipse.tracecompass.tmf.core.filter.model.TmfFilterNode;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.tests.stubs.trace.TmfTraceStub;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-/**
- * Test suite for the {@link TmfFilterTreeNodeTest} class.
- *
- * @author Patrick Tasse
- */
-@SuppressWarnings("javadoc")
-public class TmfFilterTreeNodeTest {
-
- // ------------------------------------------------------------------------
- // Variables
- // ------------------------------------------------------------------------
-
- protected static final @NonNull ITmfTrace TRACE = new TmfTraceStub();
- protected static final @NonNull String FIELD = "field";
- protected static final ITmfFilterTreeNode TRUE_NODE = new TmfFilterNode(null) {
- @Override
- public boolean matches(ITmfEvent event) {
- return true;
- }
- };
- protected static final ITmfFilterTreeNode FALSE_NODE = new TmfFilterNode(null) {
- @Override
- public boolean matches(ITmfEvent event) {
- return false;
- }
- };
- protected static final ITmfEventType EVENT_TYPE = new TmfEventType("Type", TmfEventField.makeRoot(new String[] { FIELD }));
- protected ITmfFilterTreeNode fFilterNode;
-
- @AfterClass
- public static void disposeTrace() {
- TRACE.dispose();
- }
-
- // ------------------------------------------------------------------------
- // Tests
- // ------------------------------------------------------------------------
-
- @Test
- public void testDefaults() {
- assertNull("getParent()", fFilterNode.getParent());
- assertEquals("hasChildren()", false, fFilterNode.hasChildren());
- assertEquals("getChildrenCount()", 0, fFilterNode.getChildrenCount());
- assertEquals("getChildren()", 0, fFilterNode.getChildren().length);
- }
-
- @Test
- public void testClone() {
- ITmfFilterTreeNode clone = fFilterNode.clone();
- assertFalse("clone().equals()", fFilterNode.equals(clone));
- assertFalse("clone() ==", fFilterNode == clone);
- assertEquals("clone().toString.equals()", fFilterNode.toString(), clone.toString());
- assertNull("clone().getParent()", clone.getParent());
- }
-
- @Test
- public void testAddChild() {
- ITmfFilterTreeNode child = fFilterNode.clone();
- assertEquals("addChild()", 0, fFilterNode.addChild(child));
- assertEquals("hasChildren()", true, fFilterNode.hasChildren());
- assertEquals("removeChild()", child, fFilterNode.removeChild(child));
- }
-
- @Test(expected = IndexOutOfBoundsException.class)
- public void testGetChild() {
- fFilterNode.getChild(0);
- }
-
- @Test
- public void testRemove() {
- ITmfFilterTreeNode child = fFilterNode.clone();
- assertEquals("addChild()", 0, fFilterNode.addChild(child));
- assertEquals("remove()", child, child.remove());
- assertEquals("hasChildren()", false, fFilterNode.hasChildren());
- }
-
- @Test
- public void testRemoveChild() {
- ITmfFilterTreeNode child = fFilterNode.clone();
- assertEquals("addChild()", 0, fFilterNode.addChild(child));
- assertEquals("removeChild()", child, fFilterNode.removeChild(child));
- assertEquals("hasChildren()", false, fFilterNode.hasChildren());
- }
-
- @Test
- public void testReplaceChild() {
- ITmfFilterTreeNode child1 = fFilterNode.clone();
- ITmfFilterTreeNode child2 = fFilterNode.clone();
- child1.addChild(child1.clone());
- assertEquals("addChild()", 0, fFilterNode.addChild(child1));
- assertEquals("getChild()", child1, fFilterNode.getChild(0));
- assertEquals("replaceChild()", child1, fFilterNode.replaceChild(0, child2));
- assertEquals("getChildrenCount()", 1, fFilterNode.getChildrenCount());
- assertEquals("getChild()", child2, fFilterNode.getChild(0));
- assertEquals("removeChild()", child2, fFilterNode.removeChild(child2));
- }
-}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 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:
+ * Patrick Tasse - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.tmf.core.tests.filter;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEventType;
+import org.eclipse.tracecompass.tmf.core.event.TmfEventField;
+import org.eclipse.tracecompass.tmf.core.event.TmfEventType;
+import org.eclipse.tracecompass.tmf.core.filter.model.ITmfFilterTreeNode;
+import org.eclipse.tracecompass.tmf.core.filter.model.TmfFilterNode;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.tests.stubs.trace.TmfTraceStub;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+/**
+ * Test suite for the {@link TmfFilterTreeNodeTestBase} class.
+ *
+ * @author Patrick Tasse
+ */
+@SuppressWarnings("javadoc")
+public abstract class TmfFilterTreeNodeTestBase {
+
+ // ------------------------------------------------------------------------
+ // Variables
+ // ------------------------------------------------------------------------
+
+ protected static final @NonNull ITmfTrace TRACE = new TmfTraceStub();
+ protected static final @NonNull String FIELD = "field";
+ protected static final ITmfFilterTreeNode TRUE_NODE = new TmfFilterNode(null) {
+ @Override
+ public boolean matches(ITmfEvent event) {
+ return true;
+ }
+ };
+ protected static final ITmfFilterTreeNode FALSE_NODE = new TmfFilterNode(null) {
+ @Override
+ public boolean matches(ITmfEvent event) {
+ return false;
+ }
+ };
+ protected static final ITmfEventType EVENT_TYPE = new TmfEventType("Type", TmfEventField.makeRoot(new String[] { FIELD }));
+ protected ITmfFilterTreeNode fFilterNode;
+
+ @AfterClass
+ public static void disposeTrace() {
+ TRACE.dispose();
+ }
+
+ // ------------------------------------------------------------------------
+ // Tests
+ // ------------------------------------------------------------------------
+
+ @Test
+ public void testDefaults() {
+ assertNull("getParent()", fFilterNode.getParent());
+ assertEquals("hasChildren()", false, fFilterNode.hasChildren());
+ assertEquals("getChildrenCount()", 0, fFilterNode.getChildrenCount());
+ assertEquals("getChildren()", 0, fFilterNode.getChildren().length);
+ }
+
+ @Test
+ public void testClone() {
+ ITmfFilterTreeNode clone = fFilterNode.clone();
+ assertFalse("clone().equals()", fFilterNode.equals(clone));
+ assertFalse("clone() ==", fFilterNode == clone);
+ assertEquals("clone().toString.equals()", fFilterNode.toString(), clone.toString());
+ assertNull("clone().getParent()", clone.getParent());
+ }
+
+ @Test
+ public void testAddChild() {
+ ITmfFilterTreeNode child = fFilterNode.clone();
+ assertEquals("addChild()", 0, fFilterNode.addChild(child));
+ assertEquals("hasChildren()", true, fFilterNode.hasChildren());
+ assertEquals("removeChild()", child, fFilterNode.removeChild(child));
+ }
+
+ @Test(expected = IndexOutOfBoundsException.class)
+ public void testGetChild() {
+ fFilterNode.getChild(0);
+ }
+
+ @Test
+ public void testRemove() {
+ ITmfFilterTreeNode child = fFilterNode.clone();
+ assertEquals("addChild()", 0, fFilterNode.addChild(child));
+ assertEquals("remove()", child, child.remove());
+ assertEquals("hasChildren()", false, fFilterNode.hasChildren());
+ }
+
+ @Test
+ public void testRemoveChild() {
+ ITmfFilterTreeNode child = fFilterNode.clone();
+ assertEquals("addChild()", 0, fFilterNode.addChild(child));
+ assertEquals("removeChild()", child, fFilterNode.removeChild(child));
+ assertEquals("hasChildren()", false, fFilterNode.hasChildren());
+ }
+
+ @Test
+ public void testReplaceChild() {
+ ITmfFilterTreeNode child1 = fFilterNode.clone();
+ ITmfFilterTreeNode child2 = fFilterNode.clone();
+ child1.addChild(child1.clone());
+ assertEquals("addChild()", 0, fFilterNode.addChild(child1));
+ assertEquals("getChild()", child1, fFilterNode.getChild(0));
+ assertEquals("replaceChild()", child1, fFilterNode.replaceChild(0, child2));
+ assertEquals("getChildrenCount()", 1, fFilterNode.getChildrenCount());
+ assertEquals("getChild()", child2, fFilterNode.getChild(0));
+ assertEquals("removeChild()", child2, fFilterNode.removeChild(child2));
+ }
+}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Bernd Hufmann - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.model;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Requests tests
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfTraceCoreUtilsTest.class,
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Francois Chouinard - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.request;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Requests tests
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfCoalescedEventRequestTest.class,
- TmfEventRequestTest.class,
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.signal;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Signal tests
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfSignalManagerTest.class,
- TmfSignalThrottlerTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2012, 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.statesystem;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.tmf.core.statesystem
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- ExperimentStateSystemModuleTest.class,
- StateSystemAnalysisModuleTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Patrick Tasse - Updates to mipmap feature
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.statesystem.mipmap;
-
-import org.eclipse.tracecompass.tmf.core.tests.statesystem.mipmap.TmfMipmapStateProviderTest;
-import org.eclipse.tracecompass.tmf.core.tests.statesystem.mipmap.TmfMipmapStateProviderWeightedTest;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.tmf.core.statesystem.mipmap
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfMipmapStateProviderTest.class,
- TmfMipmapStateProviderWeightedTest.class,
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2013, 2015 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.synchronization;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.tmf.core.synchronization
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({ TsTransformTest.class,
- SyncTest.class,
- TsTransformFactoryTest.class,
- TsTransformTest.class,
- TsTransformFastTest.class,
- TimeOffsetTest.class })
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * 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 - Adjusted for new Trace Model
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.trace;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.tmf.core.trace
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfContextTest.class,
- TmfExperimentTest.class,
- TmfExperimentUtilsTest.class,
- TmfMultiTraceExperimentTest.class,
- TmfTraceTest.class,
- TmfTraceUtilsTest.class
-})
-public class AllTests {}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Marc-Andre Laperle - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.trace.indexer;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite indexer classes
- *
- * @author Marc-Andre Laperle
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- BTreeTest.class,
- FlatArrayTest.class,
- TmfMemoryIndexTest.class
-})
-public class AllTests {
-
-}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.trace.indexer.checkpoint;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.tmf.core.trace.indexer.checkpoint
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfBTreeIndexTest.class,
- TmfCheckpointIndexTest.class,
- TmfCheckpointIndexTest2.class,
- TmfCheckpointTest.class,
- TmfExperimentCheckpointIndexTest.class,
-})
-public class AllTests {}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * 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 - Adjusted for new Trace Model
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.trace.location;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.tmf.core.trace.location
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfLocationTest.class,
-})
-public class AllTests {}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
- *
- * 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:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.trace.stub;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Unit tests for the development trace package.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- XmlStubTraceTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014, 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:
- * Bernd Hufmann - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.trace.text;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.tmf.core.trace.text
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TextTraceContextTest.class,
- TextTraceEventContentTest.class,
- TextTraceTest.class,
-})
-public class AllTests {}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.uml2sd;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Unit tests for tmf.core.uml2sd
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfAsyncSequenceDiagramEventTest.class,
- TmfSyncSequenceDiagramEventTest.class
-})
-public class AllTests {
-
-}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * 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:
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.tests.util;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Unit tests for tmf.core.util
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- PairTest.class
-})
-public class AllTests {
-
-}
\ No newline at end of file
<name>Trace Compass TMF Remote Core Tests Plug-in</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <configuration>
- <testSuite>org.eclipse.tracecompass.tmf.remote.core.tests</testSuite>
- <testClass>org.eclipse.tracecompass.tmf.remote.core.tests.AllTmfRemoteCoreTests</testClass>
- <useUIHarness>false</useUIHarness>
- <useUIThread>false</useUIThread>
- <product>org.eclipse.platform.ide</product>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Bernd Hufmann - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.remote.core.tests;
-
-import org.eclipse.tracecompass.tmf.core.tests.shared.DebugSuite;
-import org.junit.runner.RunWith;
-
-/**
- * Master test suite for TMF Core.
- */
-@RunWith(DebugSuite.class)
-@DebugSuite.SuiteClasses({
- TmfRemoteCorePluginTest.class,
- org.eclipse.tracecompass.tmf.remote.core.tests.shell.AllTests.class
-})
-public class AllTmfRemoteCoreTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Bernd Hufmann - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.remote.core.tests.shell;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Unit tests for the analysis package.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CommandInputTest.class,
- CommandResultTest.class,
- CommandShellTest.class
-})
-public class AllTests {
-
-}
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
- <testSuite>org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests</testSuite>
- <testClass>org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests.AllTmfRemoteUISWTBotTests</testClass>
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
- <argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
- <product>org.eclipse.platform.ide</product>
<environmentVariables>
<SWT_GTK3>${SWT_GTK3}</SWT_GTK3>
<LIBOVERLAY_SCROLLBAR>0</LIBOVERLAY_SCROLLBAR>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Bernd Hufmann - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests;
-
-import org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests.fetch.FetchRemoteTracesTest;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * SWTBot test suite for tmf.ui
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- FetchRemoteTracesTest.class,
-})
-public class AllTmfRemoteUISWTBotTests {
-}
<name>Trace Compass TMF Remote UI Tests Plug-in</name>
- <build>
+ <build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
- <testSuite>org.eclipse.tracecompass.tmf.remote.ui.tests</testSuite>
- <testClass>org.eclipse.tracecompass.tmf.remote.ui.tests.AllTmfRemoteUITests</testClass>
<useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
- <argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
- <product>org.eclipse.platform.ide</product>
</configuration>
</plugin>
</plugins>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Bernd Hufmann - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.remote.ui.tests;
-
-import org.eclipse.tracecompass.tmf.core.tests.shared.DebugSuite;
-import org.eclipse.tracecompass.tmf.remote.ui.tests.fetch.AllTests;
-import org.junit.runner.RunWith;
-
-/**
- * Master test suite for TMF UI Core.
- */
-@RunWith(DebugSuite.class)
-@DebugSuite.SuiteClasses({
- AllTests.class
-})
-public class AllTmfRemoteUITests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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.remote.ui.tests.fetch;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- RemoteImportProfilesReaderTest.class,
- RemoteImportProfilesWriterTest.class
-})
-
-@SuppressWarnings("javadoc")
-public class AllTests {
-}
org.eclipse.swtbot.swt.finder.utils,
org.eclipse.swtbot.swt.finder.waits,
org.eclipse.swtbot.swt.finder.widgets
-Export-Package: org.eclipse.tracecompass.tmf.ui.swtbot.tests;x-friends:="org.eclipse.tracecompass.alltests",
- org.eclipse.tracecompass.tmf.ui.swtbot.tests.parsers.custom;x-internal:=true,
+Export-Package: org.eclipse.tracecompass.tmf.ui.swtbot.tests.parsers.custom;x-internal:=true,
org.eclipse.tracecompass.tmf.ui.swtbot.tests.perspectives;x-internal:=true,
org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared,
org.eclipse.tracecompass.tmf.ui.swtbot.tests.viewers.events;x-internal:=true,
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
- <testSuite>org.eclipse.tracecompass.tmf.ui.swtbot.tests</testSuite>
- <testClass>org.eclipse.tracecompass.tmf.ui.swtbot.tests.AllTmfUISWTBotTests</testClass>
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
- <argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
- <product>org.eclipse.platform.ide</product>
<environmentVariables>
<SWT_GTK3>${SWT_GTK3}</SWT_GTK3>
<LIBOVERLAY_SCROLLBAR>0</LIBOVERLAY_SCROLLBAR>
+++ /dev/null
-/*******************************************************************************
- * 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.swtbot.tests;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * SWTBot test suite for tmf.ui
- *
- * @author Matthew Khouzam
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- org.eclipse.tracecompass.tmf.ui.swtbot.tests.parsers.custom.AllTests.class,
- org.eclipse.tracecompass.tmf.ui.swtbot.tests.perspectives.TracingPerspectiveChecker.class,
- org.eclipse.tracecompass.tmf.ui.swtbot.tests.viewers.events.AllTests.class,
- org.eclipse.tracecompass.tmf.ui.swtbot.tests.wizards.AllTests.class
-})
-public class AllTmfUISWTBotTests {
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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:
- * Bernd Hufmann - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.swtbot.tests.parsers.custom;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TestCustomTxtWizard.class,
- TestCustomXmlWizard.class
-})
-public class AllTests {
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014, 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:
- * Bernd Hufmann - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.swtbot.tests.perspectives;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * SWTBot test suite
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TracingPerspectiveChecker.class
-})
-public class AllTests {
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014, 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:
- * Bernd Hufmann - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.swtbot.tests.viewers.events;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * SWTBot test suite for testing of the TMF events table.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CallsiteEventsInTableTest.class,
- CollapseEventsInTableTest.class,
- ColorsViewTest.class,
- ColumnHeaderMenuTest.class,
- CopyToClipboardTest.class,
- FilterColorEditorTest.class,
- FilterViewerTest.class,
- FontEventEditorTest.class,
- MovableColumnEventsEditorTest.class,
- SDViewTest.class,
- TestTraceOffsetting.class,
- TmfAlignTimeAxisTest.class,
- TestRefreshTextTrace.class,
- TestRefreshCustomTextTrace.class,
-})
-public class AllTests {
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 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.swtbot.tests.wizards;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * SWTBot test suite for testing of the TMF events table.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- StandardImportGzipTraceTest.class,
- TestImportExportPackageWizard.class
-})
-public class AllTests {
-}
<name>Trace Compass TMF UI Tests Plug-in</name>
- <build>
+ <build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
- <testSuite>org.eclipse.tracecompass.tmf.ui.tests</testSuite>
- <testClass>org.eclipse.tracecompass.tmf.ui.tests.AllTmfUITests</testClass>
<useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
- <argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
- <product>org.eclipse.platform.ide</product>
</configuration>
</plugin>
</plugins>
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2011, 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:
- * Bernd Hufmann - Initial API and implementation
- * Bernd Hufmann - Add UML2SD tests
- * Mathieu Denis <mathieu.denis@polymtl.ca> - Add Statistics test
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.tests;
-
-import org.eclipse.tracecompass.tmf.core.tests.shared.DebugSuite;
-import org.junit.runner.RunWith;
-
-/**
- * Master test suite for TMF UI Core.
- */
-@RunWith(DebugSuite.class)
-@DebugSuite.SuiteClasses({
- 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.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
-})
-public class AllTmfUITests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2011, 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:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.tests.histogram;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite class for histogram tests.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- HistogramDataModelTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2013, 2015 École Polytechnique de Montréal and others.
- *
- * 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:
- * Geneviève Bastien - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.tests.project.model;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for org.eclipse.tracecompass.tmf.ui.project.model
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- ProjectModelAnalysisTest.class,
- ProjectModelOutputTest.class,
- ProjectModelTraceTest.class,
- TraceAndExperimentTypeTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2011, 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:
- * Mathieu Denis <mathieu.denis@polymtl.ca> - Initial API and Implementation
- * Bernd Hufmann - Fixed suite name
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.tests.statistics;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for statistic tests.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfBaseColumnDataProviderTest.class,
- TmfBaseColumnDataTest.class,
- TmfBaseStatisticsDataTest.class,
- TmfStatisticsTest.class,
- TmfStatisticsTreeNodeTest.class,
- TmfStatisticsTreeManagerTest.class,
- TmfTreeContentProviderTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2011-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:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.tests.views.uml2sd.dialogs;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite of UML2SD dialog tests.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CriteriaTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2011, 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:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.tests.views.uml2sd.load;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for testing loader manager of UML2SD extension point.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- LoadersManagerTest.class
-})
-public class AllTests {
-
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2011-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:
- * Bernd Hufmann - Initial API and implementation
- * Alexandre Montplaisir - Port to JUnit4
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.tests.views.uml2sd.loader;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * Test suite for testing the TmfUml2SDSyncLoader class.
- *
- * @author Bernd Hufmann
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TmfUml2SDSyncLoaderExpTest.class,
- TmfUml2SDSyncLoaderFilterTest.class,
- TmfUml2SDSyncLoaderFindTest.class,
- TmfUml2SDSyncLoaderPagesTest.class,
- TmfUml2SDSyncLoaderSignalTest.class,
- TmfUml2SDSyncLoaderTimeTest.class
-})
-public class AllTests {
-
-}