From: Alexandre Montplaisir Date: Tue, 24 Nov 2015 23:50:53 +0000 (-0500) Subject: Remove all "AllTests" suites X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=b0d2c5580f617109889340f6a1e83d64d9488900;p=deliverable%2Ftracecompass.git Remove all "AllTests" suites tycho-surefire-plugin's default configuration is to look for @Tests in classes that start or end with "Test", or end with "TestCase". We can make use of this and avoid all the nested AllTests.java suites found in every single test package in the tree. This also avoids the need for most custom configuration in each test plugin's pom.xml. To run a complete test plugin from within Eclipse, one can still right-click on the plugin itself, and choose Run As -> Junit Plug-in Test. (Doing this before this patch would actually run all tests twice!) Note: this breaks the suites in the "alltests" plugin, but those could be brought back by using something like ClasspathSuite, if desired. Change-Id: Ibf960df37c5d3c98dc0e0dd722d7c9fe5c0b9d4f Signed-off-by: Alexandre Montplaisir Reviewed-on: https://git.eclipse.org/r/59442 Reviewed-by: Hudson CI Reviewed-by: Marc-Andre Laperle Tested-by: Marc-Andre Laperle --- diff --git a/README.md b/README.md index 55e5982ce2..7316be4a73 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ the build system. You can set them by using `-P[profile name]` and 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` diff --git a/analysis/org.eclipse.tracecompass.analysis.graph.core.tests/pom.xml b/analysis/org.eclipse.tracecompass.analysis.graph.core.tests/pom.xml index ed9d0da1e6..62206baa78 100644 --- a/analysis/org.eclipse.tracecompass.analysis.graph.core.tests/pom.xml +++ b/analysis/org.eclipse.tracecompass.analysis.graph.core.tests/pom.xml @@ -25,21 +25,4 @@ Trace Compass Graph Analysis Core Test plug-in - - - - org.eclipse.tycho - tycho-surefire-plugin - ${tycho-version} - - org.eclipse.tracecompass.analysis.graph.core.tests - org.eclipse.tracecompass.analysis.graph.core.tests.AllAnalysisGraphCoreTests - false - false - org.eclipse.sdk.ide - - - - - diff --git a/analysis/org.eclipse.tracecompass.analysis.graph.core.tests/src/org/eclipse/tracecompass/analysis/graph/core/tests/AllAnalysisGraphCoreTests.java b/analysis/org.eclipse.tracecompass.analysis.graph.core.tests/src/org/eclipse/tracecompass/analysis/graph/core/tests/AllAnalysisGraphCoreTests.java deleted file mode 100644 index 43ac432766..0000000000 --- a/analysis/org.eclipse.tracecompass.analysis.graph.core.tests/src/org/eclipse/tracecompass/analysis/graph/core/tests/AllAnalysisGraphCoreTests.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * 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 { - -} - diff --git a/analysis/org.eclipse.tracecompass.analysis.graph.core.tests/src/org/eclipse/tracecompass/analysis/graph/core/tests/analysis/criticalpath/AllTests.java b/analysis/org.eclipse.tracecompass.analysis.graph.core.tests/src/org/eclipse/tracecompass/analysis/graph/core/tests/analysis/criticalpath/AllTests.java deleted file mode 100644 index c7986912ab..0000000000 --- a/analysis/org.eclipse.tracecompass.analysis.graph.core.tests/src/org/eclipse/tracecompass/analysis/graph/core/tests/analysis/criticalpath/AllTests.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * 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 { - -} - diff --git a/analysis/org.eclipse.tracecompass.analysis.graph.core.tests/src/org/eclipse/tracecompass/analysis/graph/core/tests/graph/AllTests.java b/analysis/org.eclipse.tracecompass.analysis.graph.core.tests/src/org/eclipse/tracecompass/analysis/graph/core/tests/graph/AllTests.java deleted file mode 100644 index 8b29f0cde7..0000000000 --- a/analysis/org.eclipse.tracecompass.analysis.graph.core.tests/src/org/eclipse/tracecompass/analysis/graph/core/tests/graph/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/pom.xml b/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/pom.xml index e42a65fd0e..5830f192ed 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/pom.xml +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/pom.xml @@ -23,39 +23,4 @@ Trace Compass Linux Kernel Analysis Core Tests Plug-in - - - - org.apache.maven.plugins - maven-antrun-plugin - - - prepare - validate - - - - - - - run - - - - - - org.eclipse.tycho - tycho-surefire-plugin - - - **/AllTests.* - - false - false - org.eclipse.platform.ide - - - - - diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/AllTests.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/AllTests.java deleted file mode 100644 index 96fd24ac5f..0000000000 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/AllTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/cpuusage/AllTests.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/cpuusage/AllTests.java deleted file mode 100644 index 3f74b64e24..0000000000 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/cpuusage/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/kernelanalysis/AllTests.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/kernelanalysis/AllTests.java deleted file mode 100644 index 781e2f32cd..0000000000 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core.tests/src/org/eclipse/tracecompass/analysis/os/linux/core/tests/kernelanalysis/AllTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * 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 diff --git a/btf/org.eclipse.tracecompass.btf.core.tests/pom.xml b/btf/org.eclipse.tracecompass.btf.core.tests/pom.xml index 12309b7dca..d7aacdc568 100644 --- a/btf/org.eclipse.tracecompass.btf.core.tests/pom.xml +++ b/btf/org.eclipse.tracecompass.btf.core.tests/pom.xml @@ -25,20 +25,4 @@ Best Trace Format Tests Plug-in - - - - org.eclipse.tycho - tycho-surefire-plugin - - org.eclipse.tracecompass.btf.core.tests - org.eclipse.tracecompass.btf.core.tests.AllTests - false - false - org.eclipse.platform.ide - - - - - diff --git a/btf/org.eclipse.tracecompass.btf.core.tests/src/org/eclipse/tracecompass/btf/core/tests/AllTests.java b/btf/org.eclipse.tracecompass.btf.core.tests/src/org/eclipse/tracecompass/btf/core/tests/AllTests.java deleted file mode 100644 index 061396280f..0000000000 --- a/btf/org.eclipse.tracecompass.btf.core.tests/src/org/eclipse/tracecompass/btf/core/tests/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/common/org.eclipse.tracecompass.common.core.tests/pom.xml b/common/org.eclipse.tracecompass.common.core.tests/pom.xml index a84f7ef0f5..df2af51b44 100644 --- a/common/org.eclipse.tracecompass.common.core.tests/pom.xml +++ b/common/org.eclipse.tracecompass.common.core.tests/pom.xml @@ -25,20 +25,4 @@ Trace Compass Common Utilities Core Tests Plug-in - - - - org.eclipse.tycho - tycho-surefire-plugin - - org.eclipse.tracecompass.common.core.tests - org.eclipse.tracecompass.common.core.tests.AllCommonCoreTests - false - false - org.eclipse.platform.ide - - - - - diff --git a/common/org.eclipse.tracecompass.common.core.tests/src/org/eclipse/tracecompass/common/core/tests/AllCommonCoreTests.java b/common/org.eclipse.tracecompass.common.core.tests/src/org/eclipse/tracecompass/common/core/tests/AllCommonCoreTests.java deleted file mode 100644 index f648667fa6..0000000000 --- a/common/org.eclipse.tracecompass.common.core.tests/src/org/eclipse/tracecompass/common/core/tests/AllCommonCoreTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/common/org.eclipse.tracecompass.common.core.tests/src/org/eclipse/tracecompass/common/core/tests/collect/AllTests.java b/common/org.eclipse.tracecompass.common.core.tests/src/org/eclipse/tracecompass/common/core/tests/collect/AllTests.java deleted file mode 100644 index cbd75b8b2d..0000000000 --- a/common/org.eclipse.tracecompass.common.core.tests/src/org/eclipse/tracecompass/common/core/tests/collect/AllTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/ctf/org.eclipse.tracecompass.ctf.core.tests/META-INF/MANIFEST.MF b/ctf/org.eclipse.tracecompass.ctf.core.tests/META-INF/MANIFEST.MF index 18c731df7d..3db558b436 100644 --- a/ctf/org.eclipse.tracecompass.ctf.core.tests/META-INF/MANIFEST.MF +++ b/ctf/org.eclipse.tracecompass.ctf.core.tests/META-INF/MANIFEST.MF @@ -16,8 +16,7 @@ Export-Package: org.eclipse.tracecompass.ctf.core.tests;x-friends:="org.eclipse. 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, diff --git a/ctf/org.eclipse.tracecompass.ctf.core.tests/perf/org/eclipse/tracecompass/ctf/core/tests/perf/AllPerfTests.java b/ctf/org.eclipse.tracecompass.ctf.core.tests/perf/org/eclipse/tracecompass/ctf/core/tests/perf/AllPerfTests.java deleted file mode 100644 index 8fd0ab1ea4..0000000000 --- a/ctf/org.eclipse.tracecompass.ctf.core.tests/perf/org/eclipse/tracecompass/ctf/core/tests/perf/AllPerfTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/ctf/org.eclipse.tracecompass.ctf.core.tests/perf/org/eclipse/tracecompass/ctf/core/tests/perf/trace/AllPerfTests.java b/ctf/org.eclipse.tracecompass.ctf.core.tests/perf/org/eclipse/tracecompass/ctf/core/tests/perf/trace/AllPerfTests.java deleted file mode 100644 index 07ad35e31d..0000000000 --- a/ctf/org.eclipse.tracecompass.ctf.core.tests/perf/org/eclipse/tracecompass/ctf/core/tests/perf/trace/AllPerfTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { -} diff --git a/ctf/org.eclipse.tracecompass.ctf.core.tests/pom.xml b/ctf/org.eclipse.tracecompass.ctf.core.tests/pom.xml index 7ba751f45f..c150acf7fc 100644 --- a/ctf/org.eclipse.tracecompass.ctf.core.tests/pom.xml +++ b/ctf/org.eclipse.tracecompass.ctf.core.tests/pom.xml @@ -66,19 +66,6 @@ - - org.eclipse.tycho - tycho-surefire-plugin - - - **/AllCtfCoreTests.* - - false - false - org.eclipse.platform.ide - - - maven-clean-plugin diff --git a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/AllCtfCoreTests.java b/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/AllCtfCoreTests.java deleted file mode 100644 index edcc9f5c3a..0000000000 --- a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/AllCtfCoreTests.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Matthew Khouzam - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.tracecompass.ctf.core.tests; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * The class TestAll 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 { -} diff --git a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/ctftestsuite/CtfTestSuiteTest.java b/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/ctftestsuite/CtfTestSuiteTest.java new file mode 100644 index 0000000000..0e0ad36fa5 --- /dev/null +++ b/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/ctftestsuite/CtfTestSuiteTest.java @@ -0,0 +1,214 @@ +/******************************************************************************* + * 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 getTracePaths() { + final List 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 dirs, Path path, boolean expectSuccess) { + if (!Files.exists(path)) { + /* Some planned directories may not exist yet in the test suite */ + return; + } + try (DirectoryStream 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 dirs, Path path, + boolean expectSuccess) { + if (!Files.exists(path)) { + return; + } + try (DirectoryStream ds = Files.newDirectoryStream(path, DIR_FILTER);) { + for (Path p : ds) { + addDirsFrom(dirs, p, expectSuccess); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + private static final DirectoryStream.Filter DIR_FILTER = + new DirectoryStream.Filter() { + @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() + ")"); + } + } +} diff --git a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/ctftestsuite/CtfTestSuiteTests.java b/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/ctftestsuite/CtfTestSuiteTests.java deleted file mode 100644 index 8362c924b7..0000000000 --- a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/ctftestsuite/CtfTestSuiteTests.java +++ /dev/null @@ -1,214 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 getTracePaths() { - final List 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 dirs, Path path, boolean expectSuccess) { - if (!Files.exists(path)) { - /* Some planned directories may not exist yet in the test suite */ - return; - } - try (DirectoryStream 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 dirs, Path path, - boolean expectSuccess) { - if (!Files.exists(path)) { - return; - } - try (DirectoryStream ds = Files.newDirectoryStream(path, DIR_FILTER);) { - for (Path p : ds) { - addDirsFrom(dirs, p, expectSuccess); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - private static final DirectoryStream.Filter DIR_FILTER = - new DirectoryStream.Filter() { - @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() + ")"); - } - } -} diff --git a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/ctftestsuite/TestAll.java b/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/ctftestsuite/TestAll.java deleted file mode 100644 index 2d637c7aa2..0000000000 --- a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/ctftestsuite/TestAll.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 TestAll 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 { - -} diff --git a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/event/TestAll.java b/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/event/TestAll.java deleted file mode 100644 index 2c43f56cda..0000000000 --- a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/event/TestAll.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Matthew Khouzam - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.tracecompass.ctf.core.tests.event; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * The class TestAll 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 { - -} diff --git a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/io/TestAll.java b/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/io/TestAll.java deleted file mode 100644 index 9a08e38082..0000000000 --- a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/io/TestAll.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Matthew Khouzam - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.tracecompass.ctf.core.tests.io; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * The class TestAll 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 { - -} diff --git a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/scope/TestAll.java b/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/scope/TestAll.java deleted file mode 100644 index 90c9a540f4..0000000000 --- a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/scope/TestAll.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * 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 TestAll 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 { - -} diff --git a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/trace/TestAll.java b/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/trace/TestAll.java deleted file mode 100644 index 599047c458..0000000000 --- a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/trace/TestAll.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013-2014 Ericsson - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Matthew Khouzam - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.tracecompass.ctf.core.tests.trace; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * The class TestAll 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 { - -} diff --git a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/TestAll.java b/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/TestAll.java deleted file mode 100644 index 3d898f27af..0000000000 --- a/ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/types/TestAll.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Matthew Khouzam - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.tracecompass.ctf.core.tests.types; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * The class TestAll 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 { - -} diff --git a/ctf/org.eclipse.tracecompass.ctf.parser.tests/pom.xml b/ctf/org.eclipse.tracecompass.ctf.parser.tests/pom.xml index 6277786370..2d7411ac6b 100644 --- a/ctf/org.eclipse.tracecompass.ctf.parser.tests/pom.xml +++ b/ctf/org.eclipse.tracecompass.ctf.parser.tests/pom.xml @@ -23,20 +23,4 @@ Trace Compass CTF Parser Tests Plug-in - - - - org.eclipse.tycho - tycho-surefire-plugin - - org.eclipse.tracecompass.ctf.parser.tests - org.eclipse.tracecompass.ctf.parser.tests.AllCtfParserTests - false - false - org.eclipse.platform.ide - - - - - diff --git a/ctf/org.eclipse.tracecompass.ctf.parser.tests/src/org/eclipse/tracecompass/ctf/parser/tests/AllCtfParserTests.java b/ctf/org.eclipse.tracecompass.ctf.parser.tests/src/org/eclipse/tracecompass/ctf/parser/tests/AllCtfParserTests.java deleted file mode 100644 index 8bab8b50c1..0000000000 --- a/ctf/org.eclipse.tracecompass.ctf.parser.tests/src/org/eclipse/tracecompass/ctf/parser/tests/AllCtfParserTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 { - -} diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/META-INF/MANIFEST.MF b/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/META-INF/MANIFEST.MF index 17122f0f2a..1a1ebb9f3a 100644 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/META-INF/MANIFEST.MF +++ b/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/META-INF/MANIFEST.MF @@ -15,9 +15,7 @@ Require-Bundle: org.junit;bundle-version="4.0.0", 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, diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/perf/org/eclipse/tracecompass/tmf/ctf/core/tests/perf/AllPerfTests.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/perf/org/eclipse/tracecompass/tmf/ctf/core/tests/perf/AllPerfTests.java deleted file mode 100644 index f96e647d3b..0000000000 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/perf/org/eclipse/tracecompass/tmf/ctf/core/tests/perf/AllPerfTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * 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 AllPerformanceTests 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 { - -} diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/perf/org/eclipse/tracecompass/tmf/ctf/core/tests/perf/experiment/AllPerfTests.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/perf/org/eclipse/tracecompass/tmf/ctf/core/tests/perf/experiment/AllPerfTests.java deleted file mode 100644 index 23b4f4f55d..0000000000 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/perf/org/eclipse/tracecompass/tmf/ctf/core/tests/perf/experiment/AllPerfTests.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * 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 diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/pom.xml b/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/pom.xml index fd746f4de6..7274a11e82 100644 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/pom.xml +++ b/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/pom.xml @@ -23,39 +23,4 @@ CTF Support for TMF Core Tests Plug-in - - - - org.apache.maven.plugins - maven-antrun-plugin - - - prepare - validate - - - - - - - run - - - - - - org.eclipse.tycho - tycho-surefire-plugin - - - **/AllTests.* - - false - false - org.eclipse.platform.ide - - - - - diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/AllTests.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/AllTests.java deleted file mode 100644 index ab4eabeb2b..0000000000 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/AllTests.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * 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 TestAll 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 { - -} diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/context/AllTests.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/context/AllTests.java deleted file mode 100644 index a837f59d2e..0000000000 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/context/AllTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * 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 diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/event/AllTests.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/event/AllTests.java deleted file mode 100644 index a01d370af5..0000000000 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/event/AllTests.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * 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 diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/iterator/AllTests.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/iterator/AllTests.java deleted file mode 100644 index 7a76947636..0000000000 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/iterator/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/request/AllTests.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/request/AllTests.java deleted file mode 100644 index 3528d8554f..0000000000 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/request/AllTests.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * 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 diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/statistics/AllTests.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/statistics/AllTests.java deleted file mode 100644 index 43d938ec9d..0000000000 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/statistics/AllTests.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * 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 {} diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/tracemanager/AllTests.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/tracemanager/AllTests.java deleted file mode 100644 index 1c4b8719ec..0000000000 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/tracemanager/AllTests.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * 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 diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/trace/AllTests.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/trace/AllTests.java deleted file mode 100644 index 6c67472fd3..0000000000 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/trace/AllTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * 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 diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/trace/indexer/AllTests.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/trace/indexer/AllTests.java deleted file mode 100644 index 0743ae3b2a..0000000000 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/trace/indexer/AllTests.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/pom.xml b/ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/pom.xml index 156778c5db..a663210d48 100644 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/pom.xml +++ b/ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/pom.xml @@ -31,12 +31,8 @@ org.eclipse.tycho tycho-surefire-plugin - org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests - org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests.AllTests true false - ${tycho.testArgLine} ${base.ui.test.vmargs} - org.eclipse.platform.ide ${SWT_GTK3} 0 diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ctf/ui/swtbot/tests/AllTests.java b/ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ctf/ui/swtbot/tests/AllTests.java deleted file mode 100644 index e5cbf0d8c8..0000000000 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ctf/ui/swtbot/tests/AllTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Matthew Khouzam - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.tracecompass.tmf.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 { -} diff --git a/gdbtrace/org.eclipse.tracecompass.gdbtrace.core.tests/pom.xml b/gdbtrace/org.eclipse.tracecompass.gdbtrace.core.tests/pom.xml index 5ac286e769..01bca82191 100644 --- a/gdbtrace/org.eclipse.tracecompass.gdbtrace.core.tests/pom.xml +++ b/gdbtrace/org.eclipse.tracecompass.gdbtrace.core.tests/pom.xml @@ -23,20 +23,4 @@ Trace Compass GDB Tracepoint Analysis Core Tests Plug-in - - - - org.eclipse.tycho - tycho-surefire-plugin - - org.eclipse.tracecompass.gdbtrace.core.tests - org.eclipse.tracecompass.gdbtrace.core.tests.AllGdbTraceCoreTests - false - false - org.eclipse.platform.ide - - - - - diff --git a/gdbtrace/org.eclipse.tracecompass.gdbtrace.core.tests/src/org/eclipse/tracecompass/gdbtrace/core/tests/AllGdbTraceCoreTests.java b/gdbtrace/org.eclipse.tracecompass.gdbtrace.core.tests/src/org/eclipse/tracecompass/gdbtrace/core/tests/AllGdbTraceCoreTests.java deleted file mode 100644 index a3e4b43370..0000000000 --- a/gdbtrace/org.eclipse.tracecompass.gdbtrace.core.tests/src/org/eclipse/tracecompass/gdbtrace/core/tests/AllGdbTraceCoreTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 { - -} diff --git a/gdbtrace/org.eclipse.tracecompass.gdbtrace.ui.tests/pom.xml b/gdbtrace/org.eclipse.tracecompass.gdbtrace.ui.tests/pom.xml index 1cd1630408..8e97ff8624 100644 --- a/gdbtrace/org.eclipse.tracecompass.gdbtrace.ui.tests/pom.xml +++ b/gdbtrace/org.eclipse.tracecompass.gdbtrace.ui.tests/pom.xml @@ -23,19 +23,16 @@ Trace Compass GDB Tracepoint Analysis UI Tests Plug-in - + - - org.eclipse.tycho - tycho-surefire-plugin - - org.eclipse.tracecompass.gdbtrace.ui.tests - org.eclipse.tracecompass.gdbtrace.ui.tests.AllGdbTraceUITests - false - false - org.eclipse.platform.ide - - + + org.eclipse.tycho + tycho-surefire-plugin + + true + true + + diff --git a/gdbtrace/org.eclipse.tracecompass.gdbtrace.ui.tests/src/org/eclipse/tracecompass/gdbtrace/ui/tests/AllGdbTraceUITests.java b/gdbtrace/org.eclipse.tracecompass.gdbtrace.ui.tests/src/org/eclipse/tracecompass/gdbtrace/ui/tests/AllGdbTraceUITests.java deleted file mode 100644 index c754653ad3..0000000000 --- a/gdbtrace/org.eclipse.tracecompass.gdbtrace.ui.tests/src/org/eclipse/tracecompass/gdbtrace/ui/tests/AllGdbTraceUITests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.core.tests/pom.xml b/lttng/org.eclipse.tracecompass.lttng2.control.core.tests/pom.xml index 65c21bbf9c..61c140054a 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.core.tests/pom.xml +++ b/lttng/org.eclipse.tracecompass.lttng2.control.core.tests/pom.xml @@ -23,20 +23,4 @@ Trace Compass LTTng Control Core Tests Plug-in - - - - org.eclipse.tycho - tycho-surefire-plugin - - org.eclipse.tracecompass.lttng2.control.core.tests - org.eclipse.tracecompass.lttng2.control.core.tests.AllTests - false - false - org.eclipse.platform.ide - - - - - diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/AllTests.java deleted file mode 100644 index e4544e290f..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/AllTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/model/impl/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/model/impl/AllTests.java deleted file mode 100644 index 9b5538d30a..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/model/impl/AllTests.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/session/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/session/AllTests.java deleted file mode 100644 index c48958311d..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/session/AllTests.java +++ /dev/null @@ -1,26 +0,0 @@ -/********************************************************************** - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/pom.xml b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/pom.xml index 64df5be137..cf72931dea 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/pom.xml +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/pom.xml @@ -23,18 +23,14 @@ Trace Compass LTTng Control UI Tests Plug-in - - + + org.eclipse.tycho tycho-surefire-plugin - org.eclipse.tracecompass.lttng2.control.ui.tests - org.eclipse.tracecompass.lttng2.control.ui.tests.AllTests true true - ${tycho.testArgLine} ${base.ui.test.vmargs} - org.eclipse.platform.ide diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/AllTests.java deleted file mode 100644 index fdc59a147e..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/AllTests.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/AllTests.java deleted file mode 100644 index e6f23155e3..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/AllTests.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlCreateSessionMiTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlCreateSessionMiTest.java new file mode 100644 index 0000000000..ddcbf2ae1f --- /dev/null +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlCreateSessionMiTest.java @@ -0,0 +1,27 @@ +/********************************************************************** + * 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; + } +} diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlCreateSessionMiTests.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlCreateSessionMiTests.java deleted file mode 100644 index 87103363c6..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlCreateSessionMiTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/********************************************************************** - * 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; - } -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlCreateSessionTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlCreateSessionTest.java new file mode 100644 index 0000000000..a5710b5237 --- /dev/null +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlCreateSessionTest.java @@ -0,0 +1,280 @@ +/********************************************************************** + * 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; + } + +} diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlCreateSessionTests.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlCreateSessionTests.java deleted file mode 100644 index 3c26afbdd7..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlCreateSessionTests.java +++ /dev/null @@ -1,280 +0,0 @@ -/********************************************************************** - * Copyright (c) 2013, 2015 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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; - } - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlKernelProviderTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlKernelProviderTest.java new file mode 100644 index 0000000000..bb62a73653 --- /dev/null +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlKernelProviderTest.java @@ -0,0 +1,266 @@ +/********************************************************************** + * 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlKernelProviderTests.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlKernelProviderTests.java deleted file mode 100644 index 83a67d643e..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlKernelProviderTests.java +++ /dev/null @@ -1,266 +0,0 @@ -/********************************************************************** - * 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 TraceControlKernelProviderTests 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlKernelSessionTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlKernelSessionTest.java new file mode 100644 index 0000000000..e64c0e18f2 --- /dev/null +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlKernelSessionTest.java @@ -0,0 +1,818 @@ +/********************************************************************** + * 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 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 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlKernelSessionTests.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlKernelSessionTests.java deleted file mode 100644 index 68da5f74bf..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlKernelSessionTests.java +++ /dev/null @@ -1,818 +0,0 @@ -/********************************************************************** - * 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 TraceControlKernelSessionTests 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 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 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlSnapshotSessionTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlSnapshotSessionTest.java new file mode 100644 index 0000000000..b124a31a76 --- /dev/null +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlSnapshotSessionTest.java @@ -0,0 +1,214 @@ +/********************************************************************** + * 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 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlSnapshotSessionTests.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlSnapshotSessionTests.java deleted file mode 100644 index a9b7909fc4..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlSnapshotSessionTests.java +++ /dev/null @@ -1,214 +0,0 @@ -/********************************************************************** - * Copyright (c) 2013, 2015 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 TraceControlSnapshotSessionTests 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 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstProviderTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstProviderTest.java new file mode 100644 index 0000000000..e3d9af1afb --- /dev/null +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstProviderTest.java @@ -0,0 +1,293 @@ +/********************************************************************** + * 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstProviderTests.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstProviderTests.java deleted file mode 100644 index 90cb188ef1..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstProviderTests.java +++ /dev/null @@ -1,293 +0,0 @@ -/********************************************************************** - * 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 TraceControlUstProviderTests 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstSession2Test.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstSession2Test.java new file mode 100644 index 0000000000..707eb00600 --- /dev/null +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstSession2Test.java @@ -0,0 +1,303 @@ +/********************************************************************** + * 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstSessionTest.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstSessionTest.java new file mode 100644 index 0000000000..4409d7fc95 --- /dev/null +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstSessionTest.java @@ -0,0 +1,596 @@ +/********************************************************************** + * 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 TraceControlUstSessionTests 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 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 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests.java deleted file mode 100644 index d2677010a8..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests.java +++ /dev/null @@ -1,596 +0,0 @@ -/********************************************************************** - * 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 TraceControlUstSessionTests 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 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 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests2.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests2.java deleted file mode 100644 index 157ebca588..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/model/component/TraceControlUstSessionTests2.java +++ /dev/null @@ -1,303 +0,0 @@ -/********************************************************************** - * Copyright (c) 2013, 2015 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 TraceControlUstSessionTests 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/AllTests.java deleted file mode 100644 index 4181191ee8..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/src/org/eclipse/tracecompass/lttng2/control/ui/tests/service/AllTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/META-INF/MANIFEST.MF b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/META-INF/MANIFEST.MF index db45c9869b..7e0df50c5d 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/META-INF/MANIFEST.MF +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/META-INF/MANIFEST.MF @@ -25,8 +25,8 @@ Export-Package: org.eclipse.tracecompass.lttng2.kernel.core.tests, 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, diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/tracecompass/lttng2/kernel/core/tests/perf/AllPerfTests.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/tracecompass/lttng2/kernel/core/tests/perf/AllPerfTests.java deleted file mode 100644 index 7d3b2bf38b..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/tracecompass/lttng2/kernel/core/tests/perf/AllPerfTests.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/tracecompass/lttng2/kernel/core/tests/perf/analysis/AllPerfTests.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/tracecompass/lttng2/kernel/core/tests/perf/analysis/AllPerfTests.java deleted file mode 100644 index d6cce5556c..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/tracecompass/lttng2/kernel/core/tests/perf/analysis/AllPerfTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/tracecompass/lttng2/kernel/core/tests/perf/event/matching/AllPerfTests.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/tracecompass/lttng2/kernel/core/tests/perf/event/matching/AllPerfTests.java deleted file mode 100644 index a9b017b59c..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/perf/org/eclipse/tracecompass/lttng2/kernel/core/tests/perf/event/matching/AllPerfTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/pom.xml b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/pom.xml index 9477a5043f..a3fd4d93fa 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/pom.xml +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/pom.xml @@ -23,20 +23,4 @@ Trace Compass LTTng Kernel Analysis Core Tests Plug-in - - - - org.eclipse.tycho - tycho-surefire-plugin - - org.eclipse.tracecompass.lttng2.kernel.core.tests - org.eclipse.tracecompass.lttng2.kernel.core.tests.AllTests - false - false - org.eclipse.platform.ide - - - - - diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/AllTests.java deleted file mode 100644 index c12d9131c5..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/AllTests.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/graph/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/graph/AllTests.java deleted file mode 100644 index c8f0b99776..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/graph/AllTests.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/kernel/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/kernel/AllTests.java deleted file mode 100644 index 8db6614820..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/kernel/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/kernel/statesystem/TestAll.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/kernel/statesystem/TestAll.java deleted file mode 100644 index 0fe407d7a6..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/kernel/statesystem/TestAll.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/vm/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/vm/AllTests.java deleted file mode 100644 index 2223160a84..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/vm/AllTests.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/event/matchandsync/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/event/matchandsync/AllTests.java deleted file mode 100644 index 2402a4bcc6..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/event/matchandsync/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/pom.xml b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/pom.xml index d92640e063..948acbb816 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/pom.xml +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/pom.xml @@ -31,12 +31,8 @@ org.eclipse.tycho tycho-surefire-plugin - org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests - org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests.AllTests true false - ${tycho.testArgLine} ${base.ui.test.vmargs} - org.eclipse.platform.ide ${SWT_GTK3} 0 diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/AllTests.java deleted file mode 100644 index 32147f6456..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/AllTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2015 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Matthew Khouzam - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.tracecompass.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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ControlFlowViewTest.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ControlFlowViewTest.java index 99415916fe..76ec140cd7 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ControlFlowViewTest.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ControlFlowViewTest.java @@ -18,6 +18,7 @@ import org.eclipse.jdt.annotation.NonNull; 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; @@ -37,13 +38,15 @@ import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.TimeGraphContro 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"; @@ -73,6 +76,8 @@ public class ControlFlowViewTest extends KernelTest { public void before() { super.before(); fViewBot = fBot.viewByTitle("Control Flow"); + fViewBot.show(); + fViewBot.setFocus(); } /** diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ImportAndReadKernelSmokeTest.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ImportAndReadKernelSmokeTest.java index 5a197bb18b..ad9cb896f9 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ImportAndReadKernelSmokeTest.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ImportAndReadKernelSmokeTest.java @@ -53,7 +53,7 @@ import org.junit.runner.RunWith; * @author Matthew Khouzam */ @RunWith(SWTBotJunit4ClassRunner.class) -public class ImportAndReadKernelSmokeTest extends KernelTest { +public class ImportAndReadKernelSmokeTest extends KernelTestBase { private ITmfEvent fDesired1; private ITmfEvent fDesired2; diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/KernelTest.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/KernelTest.java deleted file mode 100644 index 5feac5f100..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/KernelTest.java +++ /dev/null @@ -1,133 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2015 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Matthew Khouzam - Initial API and implementation - * 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 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(); - } -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/KernelTestBase.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/KernelTestBase.java new file mode 100644 index 0000000000..f049bce62d --- /dev/null +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/KernelTestBase.java @@ -0,0 +1,133 @@ +/******************************************************************************* + * 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 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(); + } +} diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ResourcesViewTest.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ResourcesViewTest.java index 6c25d65e9a..c951183734 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ResourcesViewTest.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/kernel/ui/swtbot/tests/ResourcesViewTest.java @@ -41,7 +41,7 @@ import org.junit.Test; * * @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"; diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/pom.xml b/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/pom.xml index 73a103eefa..8a7e124179 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/pom.xml +++ b/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/pom.xml @@ -23,18 +23,4 @@ Trace Compass LTTng Userspace Tracer Analysis Core Test Plug-in - - - - org.eclipse.tycho - tycho-surefire-plugin - - false - false - org.eclipse.platform.ide - - - - - diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/tracecompass/lttng2/ust/core/tests/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/tracecompass/lttng2/ust/core/tests/AllTests.java deleted file mode 100644 index 54004fa90a..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/tracecompass/lttng2/ust/core/tests/AllTests.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/tracecompass/lttng2/ust/core/tests/analysis/debuginfo/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/tracecompass/lttng2/ust/core/tests/analysis/debuginfo/AllTests.java deleted file mode 100644 index f4e5b1cb8f..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/tracecompass/lttng2/ust/core/tests/analysis/debuginfo/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/tracecompass/lttng2/ust/core/tests/analysis/memory/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/tracecompass/lttng2/ust/core/tests/analysis/memory/AllTests.java deleted file mode 100644 index 495af20988..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/tracecompass/lttng2/ust/core/tests/analysis/memory/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/tracecompass/lttng2/ust/core/tests/callstack/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/tracecompass/lttng2/ust/core/tests/callstack/AllTests.java deleted file mode 100644 index 70b2807ff5..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.core.tests/src/org/eclipse/tracecompass/lttng2/ust/core/tests/callstack/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2015 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests/pom.xml b/lttng/org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests/pom.xml index e9d4834182..c91ed9872c 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests/pom.xml +++ b/lttng/org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests/pom.xml @@ -30,15 +30,9 @@ org.eclipse.tycho tycho-surefire-plugin - ${tycho-version} - org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests - org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests.AllTests true false - ${tycho.testArgLine} ${base.ui.test.vmargs} - org.eclipse.platform.ide - ${SWT_GTK3} 0 @@ -48,5 +42,4 @@ - org.eclipse.tracecompass diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/ust/ui/swtbot/tests/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/ust/ui/swtbot/tests/AllTests.java deleted file mode 100644 index f1d523a820..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests/src/org/eclipse/tracecompass/lttng2/ust/ui/swtbot/tests/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.ui.tests/pom.xml b/lttng/org.eclipse.tracecompass.lttng2.ust.ui.tests/pom.xml index 9fa836b86d..24ba9f1570 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.ui.tests/pom.xml +++ b/lttng/org.eclipse.tracecompass.lttng2.ust.ui.tests/pom.xml @@ -29,12 +29,8 @@ org.eclipse.tycho tycho-surefire-plugin - org.eclipse.tracecompass.lttng2.ust.ui.tests - org.eclipse.tracecompass.lttng2.ust.ui.tests.AllTests true true - ${tycho.testArgLine} ${base.ui.test.vmargs} - org.eclipse.platform.ide diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.ui.tests/src/org/eclipse/tracecompass/lttng2/ust/ui/tests/AllTests.java b/lttng/org.eclipse.tracecompass.lttng2.ust.ui.tests/src/org/eclipse/tracecompass/lttng2/ust/ui/tests/AllTests.java deleted file mode 100644 index 11575ec087..0000000000 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.ui.tests/src/org/eclipse/tracecompass/lttng2/ust/ui/tests/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.pcap.core.tests/META-INF/MANIFEST.MF b/pcap/org.eclipse.tracecompass.pcap.core.tests/META-INF/MANIFEST.MF index 21391c0991..98740f6994 100644 --- a/pcap/org.eclipse.tracecompass.pcap.core.tests/META-INF/MANIFEST.MF +++ b/pcap/org.eclipse.tracecompass.pcap.core.tests/META-INF/MANIFEST.MF @@ -11,11 +11,9 @@ Require-Bundle: org.junit;bundle-version="4.0.0", 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, diff --git a/pcap/org.eclipse.tracecompass.pcap.core.tests/perf/org/eclipse/tracecompass/pcap/core/tests/perf/AllPerfTests.java b/pcap/org.eclipse.tracecompass.pcap.core.tests/perf/org/eclipse/tracecompass/pcap/core/tests/perf/AllPerfTests.java deleted file mode 100644 index 2b1da2bf71..0000000000 --- a/pcap/org.eclipse.tracecompass.pcap.core.tests/perf/org/eclipse/tracecompass/pcap/core/tests/perf/AllPerfTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.pcap.core.tests/perf/org/eclipse/tracecompass/pcap/core/tests/perf/trace/AllTests.java b/pcap/org.eclipse.tracecompass.pcap.core.tests/perf/org/eclipse/tracecompass/pcap/core/tests/perf/trace/AllTests.java deleted file mode 100644 index a4b4c92cf7..0000000000 --- a/pcap/org.eclipse.tracecompass.pcap.core.tests/perf/org/eclipse/tracecompass/pcap/core/tests/perf/trace/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { -} diff --git a/pcap/org.eclipse.tracecompass.pcap.core.tests/pom.xml b/pcap/org.eclipse.tracecompass.pcap.core.tests/pom.xml index 2d8ad0a3ab..c8838ee979 100644 --- a/pcap/org.eclipse.tracecompass.pcap.core.tests/pom.xml +++ b/pcap/org.eclipse.tracecompass.pcap.core.tests/pom.xml @@ -62,17 +62,6 @@ - - org.eclipse.tycho - tycho-surefire-plugin - - org.eclipse.tracecompass.pcap.core.tests - org.eclipse.tracecompass.pcap.core.tests.AllPcapCoreTests - false - false - org.eclipse.platform.ide - - diff --git a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/AllPcapCoreTests.java b/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/AllPcapCoreTests.java deleted file mode 100644 index 8aae4abda3..0000000000 --- a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/AllPcapCoreTests.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/file/AllTests.java b/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/file/AllTests.java deleted file mode 100644 index c04a03699d..0000000000 --- a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/file/AllTests.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/packet/AllTests.java b/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/packet/AllTests.java deleted file mode 100644 index d40c2ae897..0000000000 --- a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/packet/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/AllTests.java b/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/AllTests.java deleted file mode 100644 index 22ca1340c5..0000000000 --- a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/ethernet2/AllTests.java b/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/ethernet2/AllTests.java deleted file mode 100644 index a36a4231d9..0000000000 --- a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/ethernet2/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/ipv4/AllTests.java b/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/ipv4/AllTests.java deleted file mode 100644 index 5222ea56e5..0000000000 --- a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/ipv4/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/pcap/AllTests.java b/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/pcap/AllTests.java deleted file mode 100644 index e3d325bd08..0000000000 --- a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/pcap/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/tcp/AllTests.java b/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/tcp/AllTests.java deleted file mode 100644 index 17b014ac75..0000000000 --- a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/tcp/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/udp/AllTests.java b/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/udp/AllTests.java deleted file mode 100644 index e896476fc7..0000000000 --- a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/udp/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/unknown/AllTests.java b/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/unknown/AllTests.java deleted file mode 100644 index 99136d5028..0000000000 --- a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/protocol/unknown/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/stream/AllTests.java b/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/stream/AllTests.java deleted file mode 100644 index 9c2edb806b..0000000000 --- a/pcap/org.eclipse.tracecompass.pcap.core.tests/src/org/eclipse/tracecompass/pcap/core/tests/stream/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/META-INF/MANIFEST.MF b/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/META-INF/MANIFEST.MF index 95c0188033..0c894e52e1 100644 --- a/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/META-INF/MANIFEST.MF +++ b/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/META-INF/MANIFEST.MF @@ -16,8 +16,7 @@ Require-Bundle: org.junit;bundle-version="4.0.0", 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, diff --git a/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/pom.xml b/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/pom.xml index 095c52abf9..fbd2562526 100644 --- a/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/pom.xml +++ b/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/pom.xml @@ -23,39 +23,4 @@ Pcap Support for TMF Core Tests Plug-in - - - - org.apache.maven.plugins - maven-antrun-plugin - - - prepare - validate - - - - - - - run - - - - - - org.eclipse.tycho - tycho-surefire-plugin - - - **/AllTests.* - - false - false - org.eclipse.platform.ide - - - - - diff --git a/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/src/org/eclipse/tracecompass/tmf/pcap/core/tests/AllTmfPcapCoreTests.java b/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/src/org/eclipse/tracecompass/tmf/pcap/core/tests/AllTmfPcapCoreTests.java deleted file mode 100644 index 9ba2ad45e6..0000000000 --- a/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/src/org/eclipse/tracecompass/tmf/pcap/core/tests/AllTmfPcapCoreTests.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * 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 AllTmfPcapCoreTests 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/src/org/eclipse/tracecompass/tmf/pcap/core/tests/analysis/AllTests.java b/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/src/org/eclipse/tracecompass/tmf/pcap/core/tests/analysis/AllTests.java deleted file mode 100644 index 1e53578a33..0000000000 --- a/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/src/org/eclipse/tracecompass/tmf/pcap/core/tests/analysis/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/src/org/eclipse/tracecompass/tmf/pcap/core/tests/event/AllTests.java b/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/src/org/eclipse/tracecompass/tmf/pcap/core/tests/event/AllTests.java deleted file mode 100644 index ffc4de3759..0000000000 --- a/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/src/org/eclipse/tracecompass/tmf/pcap/core/tests/event/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/src/org/eclipse/tracecompass/tmf/pcap/core/tests/trace/AllTests.java b/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/src/org/eclipse/tracecompass/tmf/pcap/core/tests/trace/AllTests.java deleted file mode 100644 index f359830304..0000000000 --- a/pcap/org.eclipse.tracecompass.tmf.pcap.core.tests/src/org/eclipse/tracecompass/tmf/pcap/core/tests/trace/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/pcap/org.eclipse.tracecompass.tmf.pcap.ui.swtbot.tests/pom.xml b/pcap/org.eclipse.tracecompass.tmf.pcap.ui.swtbot.tests/pom.xml index 98b6fdcbc2..7faead97f8 100644 --- a/pcap/org.eclipse.tracecompass.tmf.pcap.ui.swtbot.tests/pom.xml +++ b/pcap/org.eclipse.tracecompass.tmf.pcap.ui.swtbot.tests/pom.xml @@ -31,12 +31,8 @@ org.eclipse.tycho tycho-surefire-plugin - org.eclipse.tracecompass.tmf.pcap.ui.swtbot.tests - org.eclipse.tracecompass.tmf.pcap.ui.swtbot.tests.AllTests true false - ${tycho.testArgLine} ${base.ui.test.vmargs} - org.eclipse.platform.ide ${SWT_GTK3} 0 diff --git a/pcap/org.eclipse.tracecompass.tmf.pcap.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/pcap/ui/swtbot/tests/AllTests.java b/pcap/org.eclipse.tracecompass.tmf.pcap.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/pcap/ui/swtbot/tests/AllTests.java deleted file mode 100644 index 2766171311..0000000000 --- a/pcap/org.eclipse.tracecompass.tmf.pcap.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/pcap/ui/swtbot/tests/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { -} diff --git a/pom.xml b/pom.xml index af01e48ac4..a257cfb07f 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,6 @@ - -Xms256m -Xmx1024m -XX:MaxPermSize=256m 0.24.0 0.24.0 scm:git:git://git.eclipse.org/gitroot/tracecompass/org.eclipse.tracecompass.git @@ -144,7 +143,7 @@ - ${base.test.vmargs} -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Djava.awt.headless=false + -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Djava.awt.headless=false @@ -156,7 +155,7 @@ - ${base.test.vmargs} -Dorg.eclipse.swt.browser.DefaultType=mozilla + -Dorg.eclipse.swt.browser.DefaultType=mozilla @@ -343,6 +342,7 @@ + @@ -379,13 +379,14 @@ tycho-p2-repository-plugin ${tycho-version} - - org.eclipse.tycho - tycho-surefire-plugin - ${tycho-version} - - true - true + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho-version} + + + false + false p2-installable-unit @@ -394,9 +395,9 @@ org.eclipse.platform.ide - ${tycho.testArgLine} -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m - - + ${tycho.testArgLine} ${base.ui.test.vmargs} -Xms512m -Xmx1024m + + org.eclipse.tycho tycho-versions-plugin @@ -419,7 +420,7 @@ - + org.apache.maven.plugins maven-resources-plugin 2.7 diff --git a/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/RunAllCoreTests.java b/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/RunAllCoreTests.java index c2e0d9f6b5..4b4979b97a 100644 --- a/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/RunAllCoreTests.java +++ b/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/RunAllCoreTests.java @@ -20,24 +20,7 @@ import org.junit.runners.Suite; */ @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 { diff --git a/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/RunAllUITests.java b/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/RunAllUITests.java index 4822e5311a..5b8becfb06 100644 --- a/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/RunAllUITests.java +++ b/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/RunAllUITests.java @@ -20,12 +20,7 @@ import org.junit.runners.Suite; */ @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 { diff --git a/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/perf/RunAllPerfTests.java b/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/perf/RunAllPerfTests.java index 2acc94e8a5..2684173412 100644 --- a/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/perf/RunAllPerfTests.java +++ b/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/perf/RunAllPerfTests.java @@ -20,11 +20,20 @@ import org.junit.runners.Suite; */ @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 { diff --git a/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/swtbot/RunAllSWTBotTests.java b/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/swtbot/RunAllSWTBotTests.java index 8648903d20..e48996cf09 100644 --- a/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/swtbot/RunAllSWTBotTests.java +++ b/releng/org.eclipse.tracecompass.alltests/src/org/eclipse/tracecompass/alltests/swtbot/RunAllSWTBotTests.java @@ -23,12 +23,7 @@ import org.junit.runners.Suite; */ @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 { diff --git a/statesystem/org.eclipse.tracecompass.segmentstore.core.tests/META-INF/MANIFEST.MF b/statesystem/org.eclipse.tracecompass.segmentstore.core.tests/META-INF/MANIFEST.MF index 2c7658b8b1..fd2596bb8e 100644 --- a/statesystem/org.eclipse.tracecompass.segmentstore.core.tests/META-INF/MANIFEST.MF +++ b/statesystem/org.eclipse.tracecompass.segmentstore.core.tests/META-INF/MANIFEST.MF @@ -12,5 +12,5 @@ Require-Bundle: org.junit;bundle-version="4.0.0", 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 diff --git a/statesystem/org.eclipse.tracecompass.segmentstore.core.tests/pom.xml b/statesystem/org.eclipse.tracecompass.segmentstore.core.tests/pom.xml index 15c5e64664..da3e97982a 100644 --- a/statesystem/org.eclipse.tracecompass.segmentstore.core.tests/pom.xml +++ b/statesystem/org.eclipse.tracecompass.segmentstore.core.tests/pom.xml @@ -25,20 +25,4 @@ Trace Compass Segment Store DB Core Tests Plug-in - - - - org.eclipse.tycho - tycho-surefire-plugin - - org.eclipse.tracecompass.segmentstore.core.tests - org.eclipse.tracecompass.segmentstore.core.tests.AllTests - false - false - org.eclipse.platform.ide - - - - - diff --git a/statesystem/org.eclipse.tracecompass.segmentstore.core.tests/src/org/eclipse/tracecompass/segmentstore/core/tests/AllTests.java b/statesystem/org.eclipse.tracecompass.segmentstore.core.tests/src/org/eclipse/tracecompass/segmentstore/core/tests/AllTests.java deleted file mode 100644 index 0c3130ac76..0000000000 --- a/statesystem/org.eclipse.tracecompass.segmentstore.core.tests/src/org/eclipse/tracecompass/segmentstore/core/tests/AllTests.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/statesystem/org.eclipse.tracecompass.segmentstore.core.tests/src/org/eclipse/tracecompass/segmentstore/core/tests/treemap/AllTests.java b/statesystem/org.eclipse.tracecompass.segmentstore.core.tests/src/org/eclipse/tracecompass/segmentstore/core/tests/treemap/AllTests.java deleted file mode 100644 index eae57e9d3b..0000000000 --- a/statesystem/org.eclipse.tracecompass.segmentstore.core.tests/src/org/eclipse/tracecompass/segmentstore/core/tests/treemap/AllTests.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/statesystem/org.eclipse.tracecompass.statesystem.core.tests/pom.xml b/statesystem/org.eclipse.tracecompass.statesystem.core.tests/pom.xml index 896391a220..299b4b399b 100644 --- a/statesystem/org.eclipse.tracecompass.statesystem.core.tests/pom.xml +++ b/statesystem/org.eclipse.tracecompass.statesystem.core.tests/pom.xml @@ -25,20 +25,4 @@ Trace Compass State System Core Tests Plug-in - - - - org.eclipse.tycho - tycho-surefire-plugin - - org.eclipse.tracecompass.statesystem.core.tests - org.eclipse.tracecompass.statesystem.core.tests.AllTests - false - false - org.eclipse.platform.ide - - - - - diff --git a/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/AllTests.java b/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/AllTests.java deleted file mode 100644 index 97edf6e407..0000000000 --- a/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/AllTests.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/AllTests.java b/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/AllTests.java deleted file mode 100644 index 00726467ce..0000000000 --- a/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2015 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 diff --git a/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/statevalue/AllTests.java b/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/statevalue/AllTests.java deleted file mode 100644 index c7c02edbda..0000000000 --- a/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/statevalue/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core.tests/pom.xml b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core.tests/pom.xml index 42e8c19283..8ad52a7ef7 100644 --- a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core.tests/pom.xml +++ b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core.tests/pom.xml @@ -25,20 +25,4 @@ Trace Compass TMF Xml Analysis Core Tests Plug-in - - - - org.eclipse.tycho - tycho-surefire-plugin - - org.eclipse.tracecompass.tmf.analysis.xml.core.tests - org.eclipse.tracecompass.tmf.analysis.xml.core.tests.AllAnalysisXmlCoreTests - false - false - org.eclipse.sdk.ide - - - - - diff --git a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/core/tests/AllAnalysisXmlCoreTests.java b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/core/tests/AllAnalysisXmlCoreTests.java deleted file mode 100644 index 5656601ac0..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/core/tests/AllAnalysisXmlCoreTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/core/tests/module/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/core/tests/module/AllTests.java deleted file mode 100644 index 734766ea32..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/core/tests/module/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/core/tests/stateprovider/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/core/tests/stateprovider/AllTests.java deleted file mode 100644 index 9d91c93bfc..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/core/tests/stateprovider/AllTests.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * 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 diff --git a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui.tests/pom.xml b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui.tests/pom.xml index 7993e9c5f1..5eaadd00bd 100644 --- a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui.tests/pom.xml +++ b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui.tests/pom.xml @@ -25,18 +25,14 @@ Trace Compass TMF Xml Analysis UI Tests Plug-in - + org.eclipse.tycho tycho-surefire-plugin - org.eclipse.tracecompass.tmf.analysis.xml.ui.tests - org.eclipse.tracecompass.tmf.analysis.xml.ui.tests.AllAnalysisXmlUiTests true true - ${tycho.testArgLine} ${base.ui.test.vmargs} - org.eclipse.sdk.ide diff --git a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/ui/tests/AllAnalysisXmlUiTests.java b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/ui/tests/AllAnalysisXmlUiTests.java deleted file mode 100644 index 1637d173ee..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/ui/tests/AllAnalysisXmlUiTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/ui/tests/module/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/ui/tests/module/AllTests.java deleted file mode 100644 index d9f9f0b823..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui.tests/src/org/eclipse/tracecompass/tmf/analysis/xml/ui/tests/module/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/META-INF/MANIFEST.MF b/tmf/org.eclipse.tracecompass.tmf.core.tests/META-INF/MANIFEST.MF index c73794ac00..b76d3ec01a 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/META-INF/MANIFEST.MF +++ b/tmf/org.eclipse.tracecompass.tmf.core.tests/META-INF/MANIFEST.MF @@ -16,7 +16,7 @@ Require-Bundle: org.junit;bundle-version="4.0.0", 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 diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/perf/org/eclipse/tracecompass/tmf/core/tests/perf/AllPerfTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/perf/org/eclipse/tracecompass/tmf/core/tests/perf/AllPerfTests.java deleted file mode 100644 index 62c8e57967..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/perf/org/eclipse/tracecompass/tmf/core/tests/perf/AllPerfTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * 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 AllPerformanceTests 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/perf/org/eclipse/tracecompass/tmf/core/tests/perf/synchronization/AllPerfTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/perf/org/eclipse/tracecompass/tmf/core/tests/perf/synchronization/AllPerfTests.java deleted file mode 100644 index 4532360872..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/perf/org/eclipse/tracecompass/tmf/core/tests/perf/synchronization/AllPerfTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/pom.xml b/tmf/org.eclipse.tracecompass.tmf.core.tests/pom.xml index 9b320ee09b..7ea512a4aa 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/pom.xml +++ b/tmf/org.eclipse.tracecompass.tmf.core.tests/pom.xml @@ -25,20 +25,4 @@ Trace Compass TMF Core Tests Plug-in - - - - org.eclipse.tycho - tycho-surefire-plugin - - org.eclipse.tracecompass.tmf.core.tests - org.eclipse.tracecompass.tmf.core.tests.AllTmfCoreTests - false - false - org.eclipse.platform.ide - - - - - diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/AllTmfCoreTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/AllTmfCoreTests.java deleted file mode 100644 index 3de510b6c0..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/AllTmfCoreTests.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Francois Chouinard - Initial API and implementation - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/analysis/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/analysis/AllTests.java deleted file mode 100644 index 6108f99e0d..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/analysis/AllTests.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/callstack/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/callstack/AllTests.java deleted file mode 100644 index f72c4625a0..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/callstack/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/component/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/component/AllTests.java deleted file mode 100644 index f533fafc14..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/component/AllTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/AllTests.java deleted file mode 100644 index f423deeed3..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/AllTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/lookup/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/lookup/AllTests.java deleted file mode 100644 index 27c697a070..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/lookup/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2015 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/AllTests.java deleted file mode 100644 index f5b0b9d429..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/AllTests.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterAndNodeTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterAndNodeTest.java index 5aace92938..0e9193b490 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterAndNodeTest.java +++ b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterAndNodeTest.java @@ -40,7 +40,7 @@ import org.junit.Test; * @author Patrick Tasse */ @SuppressWarnings("javadoc") -public class TmfFilterAndNodeTest extends TmfFilterTreeNodeTest { +public class TmfFilterAndNodeTest extends TmfFilterTreeNodeTestBase { // ------------------------------------------------------------------------ // Variables diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterCompareNodeTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterCompareNodeTest.java index 55e5ba4767..670202a976 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterCompareNodeTest.java +++ b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterCompareNodeTest.java @@ -34,7 +34,7 @@ import org.junit.Test; * @author Patrick Tasse */ @SuppressWarnings("javadoc") -public class TmfFilterCompareNodeTest extends TmfFilterTreeNodeTest { +public class TmfFilterCompareNodeTest extends TmfFilterTreeNodeTestBase { // ------------------------------------------------------------------------ // Variables diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterContainsNodeTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterContainsNodeTest.java index 9b10a05d58..123614feb6 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterContainsNodeTest.java +++ b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterContainsNodeTest.java @@ -32,7 +32,7 @@ import org.junit.Test; * @author Patrick Tasse */ @SuppressWarnings("javadoc") -public class TmfFilterContainsNodeTest extends TmfFilterTreeNodeTest { +public class TmfFilterContainsNodeTest extends TmfFilterTreeNodeTestBase { // ------------------------------------------------------------------------ // Variables diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterEqualsNodeTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterEqualsNodeTest.java index 31165b457a..33051722f7 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterEqualsNodeTest.java +++ b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterEqualsNodeTest.java @@ -32,7 +32,7 @@ import org.junit.Test; * @author Patrick Tasse */ @SuppressWarnings("javadoc") -public class TmfFilterEqualsNodeTest extends TmfFilterTreeNodeTest { +public class TmfFilterEqualsNodeTest extends TmfFilterTreeNodeTestBase { // ------------------------------------------------------------------------ // Variables diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterMatchesNodeTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterMatchesNodeTest.java index 583c63e91d..c16e08e5f9 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterMatchesNodeTest.java +++ b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterMatchesNodeTest.java @@ -32,7 +32,7 @@ import org.junit.Test; * @author Patrick Tasse */ @SuppressWarnings("javadoc") -public class TmfFilterMatchesNodeTest extends TmfFilterTreeNodeTest { +public class TmfFilterMatchesNodeTest extends TmfFilterTreeNodeTestBase { // ------------------------------------------------------------------------ // Variables diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterNodeTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterNodeTest.java index 14f953f5ed..27b74bc782 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterNodeTest.java +++ b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterNodeTest.java @@ -41,7 +41,7 @@ import org.junit.Test; * @author Patrick Tasse */ @SuppressWarnings("javadoc") -public class TmfFilterNodeTest extends TmfFilterTreeNodeTest { +public class TmfFilterNodeTest extends TmfFilterTreeNodeTestBase { // ------------------------------------------------------------------------ // Variables diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterOrNodeTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterOrNodeTest.java index 0357c728ab..8c0a7ffe1b 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterOrNodeTest.java +++ b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterOrNodeTest.java @@ -40,7 +40,7 @@ import org.junit.Test; * @author Patrick Tasse */ @SuppressWarnings("javadoc") -public class TmfFilterOrNodeTest extends TmfFilterTreeNodeTest { +public class TmfFilterOrNodeTest extends TmfFilterTreeNodeTestBase { // ------------------------------------------------------------------------ // Variables diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterRootNodeTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterRootNodeTest.java index 01317ba255..bcd444f644 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterRootNodeTest.java +++ b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterRootNodeTest.java @@ -32,7 +32,7 @@ import org.junit.Test; * @author Patrick Tasse */ @SuppressWarnings("javadoc") -public class TmfFilterRootNodeTest extends TmfFilterTreeNodeTest { +public class TmfFilterRootNodeTest extends TmfFilterTreeNodeTestBase { // ------------------------------------------------------------------------ // Variables diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterTraceTypeNodeTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterTraceTypeNodeTest.java index 7ff09423a0..e9cac2952b 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterTraceTypeNodeTest.java +++ b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterTraceTypeNodeTest.java @@ -52,7 +52,7 @@ import org.junit.Test; * @author Patrick Tasse */ @SuppressWarnings("javadoc") -public class TmfFilterTraceTypeNodeTest extends TmfFilterTreeNodeTest { +public class TmfFilterTraceTypeNodeTest extends TmfFilterTreeNodeTestBase { // ------------------------------------------------------------------------ // Variables diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterTreeNodeTest.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterTreeNodeTest.java deleted file mode 100644 index 6c5947609f..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterTreeNodeTest.java +++ /dev/null @@ -1,127 +0,0 @@ -/******************************************************************************* - * 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)); - } -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterTreeNodeTestBase.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterTreeNodeTestBase.java new file mode 100644 index 0000000000..090f0093d4 --- /dev/null +++ b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/filter/TmfFilterTreeNodeTestBase.java @@ -0,0 +1,127 @@ +/******************************************************************************* + * 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)); + } +} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/model/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/model/AllTests.java deleted file mode 100644 index ac9984afb3..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/model/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/request/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/request/AllTests.java deleted file mode 100644 index 506851e80e..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/request/AllTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/signal/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/signal/AllTests.java deleted file mode 100644 index 6c4f6adcd2..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/signal/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/statesystem/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/statesystem/AllTests.java deleted file mode 100644 index 100563d193..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/statesystem/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/statesystem/mipmap/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/statesystem/mipmap/AllTests.java deleted file mode 100644 index 1c32f72c0b..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/statesystem/mipmap/AllTests.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2015 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/synchronization/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/synchronization/AllTests.java deleted file mode 100644 index bbdf3c6359..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/synchronization/AllTests.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/AllTests.java deleted file mode 100644 index 0bf1db15cd..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/AllTests.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * 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 diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/indexer/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/indexer/AllTests.java deleted file mode 100644 index 5647b6058b..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/indexer/AllTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/indexer/checkpoint/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/indexer/checkpoint/AllTests.java deleted file mode 100644 index 38237fc5cb..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/indexer/checkpoint/AllTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2015 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/location/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/location/AllTests.java deleted file mode 100644 index 921b85b10c..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/location/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/stub/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/stub/AllTests.java deleted file mode 100644 index fc5d8ace08..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/stub/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/text/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/text/AllTests.java deleted file mode 100644 index 7b27aea250..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/trace/text/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/uml2sd/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/uml2sd/AllTests.java deleted file mode 100644 index ee7c1a4a16..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/uml2sd/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/util/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/util/AllTests.java deleted file mode 100644 index f3d2879fd4..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/util/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * 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 diff --git a/tmf/org.eclipse.tracecompass.tmf.remote.core.tests/pom.xml b/tmf/org.eclipse.tracecompass.tmf.remote.core.tests/pom.xml index 8a43d1f01f..caaeb6246d 100644 --- a/tmf/org.eclipse.tracecompass.tmf.remote.core.tests/pom.xml +++ b/tmf/org.eclipse.tracecompass.tmf.remote.core.tests/pom.xml @@ -25,20 +25,4 @@ Trace Compass TMF Remote Core Tests Plug-in - - - - org.eclipse.tycho - tycho-surefire-plugin - - org.eclipse.tracecompass.tmf.remote.core.tests - org.eclipse.tracecompass.tmf.remote.core.tests.AllTmfRemoteCoreTests - false - false - org.eclipse.platform.ide - - - - - diff --git a/tmf/org.eclipse.tracecompass.tmf.remote.core.tests/src/org/eclipse/tracecompass/tmf/remote/core/tests/AllTmfRemoteCoreTests.java b/tmf/org.eclipse.tracecompass.tmf.remote.core.tests/src/org/eclipse/tracecompass/tmf/remote/core/tests/AllTmfRemoteCoreTests.java deleted file mode 100644 index 6a9ae37bc3..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.remote.core.tests/src/org/eclipse/tracecompass/tmf/remote/core/tests/AllTmfRemoteCoreTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.remote.core.tests/src/org/eclipse/tracecompass/tmf/remote/core/tests/shell/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.remote.core.tests/src/org/eclipse/tracecompass/tmf/remote/core/tests/shell/AllTests.java deleted file mode 100644 index 70c1db2b05..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.remote.core.tests/src/org/eclipse/tracecompass/tmf/remote/core/tests/shell/AllTests.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests/pom.xml b/tmf/org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests/pom.xml index c1e0d99410..c05305f1c6 100644 --- a/tmf/org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests/pom.xml +++ b/tmf/org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests/pom.xml @@ -31,12 +31,8 @@ org.eclipse.tycho tycho-surefire-plugin - org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests - org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests.AllTmfRemoteUISWTBotTests true false - ${tycho.testArgLine} ${base.ui.test.vmargs} - org.eclipse.platform.ide ${SWT_GTK3} 0 diff --git a/tmf/org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/remote/ui/swtbot/tests/AllTmfRemoteUISWTBotTests.java b/tmf/org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/remote/ui/swtbot/tests/AllTmfRemoteUISWTBotTests.java deleted file mode 100644 index 34ef3fa43a..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.remote.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/remote/ui/swtbot/tests/AllTmfRemoteUISWTBotTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { -} diff --git a/tmf/org.eclipse.tracecompass.tmf.remote.ui.tests/pom.xml b/tmf/org.eclipse.tracecompass.tmf.remote.ui.tests/pom.xml index 77530254ba..613e65f6d1 100644 --- a/tmf/org.eclipse.tracecompass.tmf.remote.ui.tests/pom.xml +++ b/tmf/org.eclipse.tracecompass.tmf.remote.ui.tests/pom.xml @@ -25,18 +25,14 @@ Trace Compass TMF Remote UI Tests Plug-in - + org.eclipse.tycho tycho-surefire-plugin - org.eclipse.tracecompass.tmf.remote.ui.tests - org.eclipse.tracecompass.tmf.remote.ui.tests.AllTmfRemoteUITests true true - ${tycho.testArgLine} ${base.ui.test.vmargs} - org.eclipse.platform.ide diff --git a/tmf/org.eclipse.tracecompass.tmf.remote.ui.tests/src/org/eclipse/tracecompass/tmf/remote/ui/tests/AllTmfRemoteUITests.java b/tmf/org.eclipse.tracecompass.tmf.remote.ui.tests/src/org/eclipse/tracecompass/tmf/remote/ui/tests/AllTmfRemoteUITests.java deleted file mode 100644 index 7250fa2f12..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.remote.ui.tests/src/org/eclipse/tracecompass/tmf/remote/ui/tests/AllTmfRemoteUITests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.remote.ui.tests/src/org/eclipse/tracecompass/tmf/remote/ui/tests/fetch/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.remote.ui.tests/src/org/eclipse/tracecompass/tmf/remote/ui/tests/fetch/AllTests.java deleted file mode 100644 index 2f40628266..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.remote.ui.tests/src/org/eclipse/tracecompass/tmf/remote/ui/tests/fetch/AllTests.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * 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 { -} diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/META-INF/MANIFEST.MF b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/META-INF/MANIFEST.MF index f1a77c89bc..d8f193ba5b 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/META-INF/MANIFEST.MF +++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/META-INF/MANIFEST.MF @@ -33,8 +33,7 @@ Import-Package: com.google.common.collect, 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, diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/pom.xml b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/pom.xml index 4394cbeebf..b46f6eb95f 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/pom.xml +++ b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/pom.xml @@ -31,12 +31,8 @@ org.eclipse.tycho tycho-surefire-plugin - org.eclipse.tracecompass.tmf.ui.swtbot.tests - org.eclipse.tracecompass.tmf.ui.swtbot.tests.AllTmfUISWTBotTests true false - ${tycho.testArgLine} ${base.ui.test.vmargs} - org.eclipse.platform.ide ${SWT_GTK3} 0 diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/AllTmfUISWTBotTests.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/AllTmfUISWTBotTests.java deleted file mode 100644 index 9d3b82e251..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/AllTmfUISWTBotTests.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013, 2015 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Matthew Khouzam - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.tracecompass.tmf.ui.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 { -} diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/parsers/custom/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/parsers/custom/AllTests.java deleted file mode 100644 index cca7f798e9..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/parsers/custom/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { -} diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/perspectives/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/perspectives/AllTests.java deleted file mode 100644 index 838540a070..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/perspectives/AllTests.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * 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 { -} diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/AllTests.java deleted file mode 100644 index 1396915c55..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/viewers/events/AllTests.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * 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 { -} diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/wizards/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/wizards/AllTests.java deleted file mode 100644 index 3b57ef2011..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.ui.swtbot.tests/src/org/eclipse/tracecompass/tmf/ui/swtbot/tests/wizards/AllTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 { -} diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/pom.xml b/tmf/org.eclipse.tracecompass.tmf.ui.tests/pom.xml index 4b79a566ce..1f065081c7 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui.tests/pom.xml +++ b/tmf/org.eclipse.tracecompass.tmf.ui.tests/pom.xml @@ -25,18 +25,14 @@ Trace Compass TMF UI Tests Plug-in - + org.eclipse.tycho tycho-surefire-plugin - org.eclipse.tracecompass.tmf.ui.tests - org.eclipse.tracecompass.tmf.ui.tests.AllTmfUITests true true - ${tycho.testArgLine} ${base.ui.test.vmargs} - org.eclipse.platform.ide diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/AllTmfUITests.java b/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/AllTmfUITests.java deleted file mode 100644 index 13beee5cc1..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/AllTmfUITests.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * 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 - 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/histogram/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/histogram/AllTests.java deleted file mode 100644 index ef85f3d131..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/histogram/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/project/model/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/project/model/AllTests.java deleted file mode 100644 index e84c1c326e..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/project/model/AllTests.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/statistics/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/statistics/AllTests.java deleted file mode 100644 index 030eae091c..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/statistics/AllTests.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * 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 - 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/dialogs/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/dialogs/AllTests.java deleted file mode 100644 index 4b600ad123..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/dialogs/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/load/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/load/AllTests.java deleted file mode 100644 index 90971e4d3f..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/load/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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 { - -} diff --git a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/loader/AllTests.java b/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/loader/AllTests.java deleted file mode 100644 index e3c3a25835..0000000000 --- a/tmf/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/loader/AllTests.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * 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 { - -}