From b031866026c1a893dc9c77fdb4c9b1c29e97e88a Mon Sep 17 00:00:00 2001 From: Alexandre Montplaisir Date: Mon, 11 Jun 2012 14:03:06 -0400 Subject: [PATCH] lttng: Fix Javadoc in lttng2.core plus some very simple warnings. Signed-off-by: Alexandre Montplaisir --- .../lttng2/core/tests/ActivatorTest.java | 5 +- .../lttng2/core/tests/AllTests.java | 5 +- .../tests/control/model/impl/AllTests.java | 7 +- .../control/model/impl/BaseEventInfoTest.java | 102 +++++++++--------- .../control/model/impl/ChannelInfoTest.java | 62 +++++------ .../control/model/impl/DomainInfoTest.java | 30 +++--- .../control/model/impl/EventInfoTest.java | 44 ++++---- .../control/model/impl/ModelImplFactory.java | 28 ++--- .../model/impl/ProbeEventInfoTest.java | 34 +++--- .../control/model/impl/SessionInfoTest.java | 42 ++++---- .../control/model/impl/TraceInfoTest.java | 30 +++--- .../model/impl/UstProviderInfoTest.java | 42 ++++---- .../core/control/model/ISessionInfo.java | 22 ++-- .../lttng2/core/control/model/ITraceInfo.java | 14 +-- .../core/control/model/LogLevelType.java | 21 ++-- .../core/control/model/TargetNodeState.java | 22 ++-- .../core/control/model/TraceEnablement.java | 17 +-- .../core/control/model/TraceEventType.java | 21 ++-- .../core/control/model/TraceLogLevel.java | 66 +++++++----- .../core/control/model/TraceSessionState.java | 19 ++-- .../core/control/model/impl/ChannelInfo.java | 28 ++--- .../core/control/model/impl/DomainInfo.java | 24 ++--- .../core/control/model/impl/SessionInfo.java | 26 ++--- .../core/control/model/impl/TraceInfo.java | 15 ++- .../control/model/impl/UstProviderInfo.java | 28 ++--- 25 files changed, 395 insertions(+), 359 deletions(-) diff --git a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/ActivatorTest.java b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/ActivatorTest.java index 9eeec2a983..bd6c1f2eff 100644 --- a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/ActivatorTest.java +++ b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/ActivatorTest.java @@ -1,11 +1,11 @@ /******************************************************************************* * Copyright (c) 2012 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 *******************************************************************************/ @@ -26,6 +26,7 @@ import org.junit.Test; * Test suite for the Activator class *

*/ +@SuppressWarnings("javadoc") public class ActivatorTest extends TestCase { // ------------------------------------------------------------------------ diff --git a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/AllTests.java b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/AllTests.java index cce041eae1..3f83720290 100644 --- a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/AllTests.java +++ b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/AllTests.java @@ -1,11 +1,11 @@ /******************************************************************************* * Copyright (c) 2012 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 *******************************************************************************/ @@ -19,6 +19,7 @@ import junit.framework.TestSuite; * AllTests *

*/ +@SuppressWarnings("javadoc") public class AllTests { public static Test suite() { diff --git a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/AllTests.java b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/AllTests.java index bce587572b..6fa43af6ba 100644 --- a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/AllTests.java +++ b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/AllTests.java @@ -1,11 +1,11 @@ /******************************************************************************* * Copyright (c) 2011 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 *******************************************************************************/ @@ -14,10 +14,11 @@ package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl; import junit.framework.Test; import junit.framework.TestSuite; +@SuppressWarnings("javadoc") public class AllTests { public static Test suite() { - + TestSuite suite = new TestSuite(AllTests.class.getName()); //$JUnit-BEGIN$ suite.addTestSuite(BaseEventInfoTest.class); diff --git a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/BaseEventInfoTest.java b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/BaseEventInfoTest.java index 40f882af7f..b8520aec02 100644 --- a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/BaseEventInfoTest.java +++ b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/BaseEventInfoTest.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl; @@ -21,7 +21,7 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BaseEventI /** * The class BaseEventInfoTest contains test for the class {@link BaseEventInfo}. */ -@SuppressWarnings("nls") +@SuppressWarnings({"nls", "javadoc"}) public class BaseEventInfoTest extends TestCase { // ------------------------------------------------------------------------ @@ -29,7 +29,7 @@ public class BaseEventInfoTest extends TestCase { // ------------------------------------------------------------------------ private IBaseEventInfo fEventInfo1 = null; private IBaseEventInfo fEventInfo2 = null; - + // ------------------------------------------------------------------------ // Housekeeping // ------------------------------------------------------------------------ @@ -42,7 +42,7 @@ public class BaseEventInfoTest extends TestCase { @Override public void setUp() throws Exception { super.setUp(); - ModelImplFactory factory = new ModelImplFactory(); + ModelImplFactory factory = new ModelImplFactory(); fEventInfo1 = factory.getBaseEventInfo1(); fEventInfo2 = factory.getBaseEventInfo2(); } @@ -68,15 +68,15 @@ public class BaseEventInfoTest extends TestCase { public void testBaseEventInfo() { BaseEventInfo fixture = new BaseEventInfo("event"); assertNotNull(fixture); - + TraceEventType result = fixture.getEventType(); - + assertEquals("event", fixture.getName()); assertEquals("unknown", result.getInName()); assertEquals("UNKNOWN", result.name()); assertEquals("UNKNOWN", result.toString()); assertEquals(3, result.ordinal()); - + TraceLogLevel level = fixture.getLogLevel(); assertEquals("TRACE_DEBUG", level.getInName()); assertEquals("TRACE_DEBUG", level.name()); @@ -89,7 +89,7 @@ public class BaseEventInfoTest extends TestCase { */ public void testEventInfoCopy() { BaseEventInfo info = new BaseEventInfo((BaseEventInfo)fEventInfo1); - + assertEquals(fEventInfo1.getName(), info.getName()); assertEquals(fEventInfo1.getEventType(), info.getEventType()); assertEquals(fEventInfo1.getLogLevel(), info.getLogLevel()); @@ -108,7 +108,7 @@ public class BaseEventInfoTest extends TestCase { // Success } } - + /** * Run the TraceEventType getEventType() method test. * @@ -126,14 +126,14 @@ public class BaseEventInfoTest extends TestCase { assertEquals("UNKNOWN", result.name()); assertEquals("UNKNOWN", result.toString()); assertEquals(3, result.ordinal()); - + fixture.setEventType(""); result = fixture.getEventType(); assertEquals("unknown", result.getInName()); assertEquals("UNKNOWN", result.name()); assertEquals("UNKNOWN", result.toString()); assertEquals(3, result.ordinal()); - + fixture.setEventType("tracepoint"); result = fixture.getEventType(); assertNotNull(result); @@ -141,7 +141,7 @@ public class BaseEventInfoTest extends TestCase { assertEquals("TRACEPOINT", result.name()); assertEquals("TRACEPOINT", result.toString()); assertEquals(0, result.ordinal()); - + fixture.setEventType("syscall"); result = fixture.getEventType(); assertNotNull(result); @@ -149,7 +149,7 @@ public class BaseEventInfoTest extends TestCase { assertEquals("SYSCALL", result.name()); assertEquals("SYSCALL", result.toString()); assertEquals(1, result.ordinal()); - + fixture.setEventType("probe"); result = fixture.getEventType(); assertNotNull(result); @@ -167,24 +167,24 @@ public class BaseEventInfoTest extends TestCase { public void testSetEventType_2() { BaseEventInfo fixture = new BaseEventInfo("event"); fixture.setEventType(TraceEventType.TRACEPOINT); - + TraceEventType result = fixture.getEventType(); - + assertNotNull(result); assertEquals("tracepoint", result.getInName()); assertEquals("TRACEPOINT", result.name()); assertEquals("TRACEPOINT", result.toString()); assertEquals(0, result.ordinal()); - + fixture.setEventType(TraceEventType.UNKNOWN); result = fixture.getEventType(); - + assertNotNull(result); assertEquals("unknown", result.getInName()); assertEquals("UNKNOWN", result.name()); assertEquals("UNKNOWN", result.toString()); assertEquals(3, result.ordinal()); - + fixture.setEventType(TraceEventType.SYSCALL); result = fixture.getEventType(); assertNotNull(result); @@ -192,7 +192,7 @@ public class BaseEventInfoTest extends TestCase { assertEquals("SYSCALL", result.name()); assertEquals("SYSCALL", result.toString()); assertEquals(1, result.ordinal()); - + fixture.setEventType(TraceEventType.PROBE); result = fixture.getEventType(); assertNotNull(result); @@ -202,17 +202,17 @@ public class BaseEventInfoTest extends TestCase { assertEquals(2, result.ordinal()); } - + /** * Run the void setLogLevel(TraceLogLevel) method test. * Run the TraceLogLevel getLogLevel() method test - * + * */ public void testSetLogLevel1() { BaseEventInfo fixture = new BaseEventInfo("event"); fixture.setEventType(TraceEventType.TRACEPOINT); fixture.setLogLevel(TraceLogLevel.TRACE_CRIT); - + // 2 set/get-operations are enough to test the method TraceLogLevel result = fixture.getLogLevel(); assertNotNull(result); @@ -222,7 +222,7 @@ public class BaseEventInfoTest extends TestCase { assertEquals(2, result.ordinal()); fixture.setLogLevel(TraceLogLevel.TRACE_DEBUG_FUNCTION); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_DEBUG_FUNCTION", result.getInName()); @@ -230,17 +230,17 @@ public class BaseEventInfoTest extends TestCase { assertEquals("TRACE_DEBUG_FUNCTION", result.toString()); assertEquals(12, result.ordinal()); } - + /** * Run the void setLogLevel(String) method test. * Run the TraceLogLevel getLogLevel() method test - * + * */ public void testSetLogLevel2() { BaseEventInfo fixture = new BaseEventInfo("event"); fixture.setEventType(TraceEventType.TRACEPOINT); fixture.setLogLevel("TRACE_EMERG"); - + TraceLogLevel result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_EMERG", result.getInName()); @@ -249,16 +249,16 @@ public class BaseEventInfoTest extends TestCase { //------------------------ fixture.setLogLevel("TRACE_ALERT"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_ALERT", result.getInName()); assertEquals("TRACE_ALERT", result.name()); assertEquals(1, result.ordinal()); - + //------------------------ fixture.setLogLevel("TRACE_CRIT"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_CRIT", result.getInName()); @@ -267,7 +267,7 @@ public class BaseEventInfoTest extends TestCase { //------------------------ fixture.setLogLevel("TRACE_ERR"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_ERR", result.getInName()); @@ -276,7 +276,7 @@ public class BaseEventInfoTest extends TestCase { //------------------------ fixture.setLogLevel("TRACE_WARNING"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_WARNING", result.getInName()); @@ -285,7 +285,7 @@ public class BaseEventInfoTest extends TestCase { //------------------------ fixture.setLogLevel("TRACE_NOTICE"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_NOTICE", result.getInName()); @@ -294,7 +294,7 @@ public class BaseEventInfoTest extends TestCase { //------------------------ fixture.setLogLevel("TRACE_INFO"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_INFO", result.getInName()); @@ -303,7 +303,7 @@ public class BaseEventInfoTest extends TestCase { //------------------------ fixture.setLogLevel("TRACE_DEBUG_SYSTEM"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_DEBUG_SYSTEM", result.getInName()); @@ -312,7 +312,7 @@ public class BaseEventInfoTest extends TestCase { //------------------------ fixture.setLogLevel("TRACE_DEBUG_PROGRAM"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_DEBUG_PROGRAM", result.getInName()); @@ -321,7 +321,7 @@ public class BaseEventInfoTest extends TestCase { //------------------------ fixture.setLogLevel("TRACE_DEBUG_PROCESS"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_DEBUG_PROCESS", result.getInName()); @@ -330,7 +330,7 @@ public class BaseEventInfoTest extends TestCase { //------------------------ fixture.setLogLevel("TRACE_DEBUG_MODULE"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_DEBUG_MODULE", result.getInName()); @@ -339,7 +339,7 @@ public class BaseEventInfoTest extends TestCase { //------------------------ fixture.setLogLevel("TRACE_DEBUG_UNIT"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_DEBUG_UNIT", result.getInName()); @@ -348,7 +348,7 @@ public class BaseEventInfoTest extends TestCase { //------------------------ fixture.setLogLevel("TRACE_DEBUG_FUNCTION"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_DEBUG_FUNCTION", result.getInName()); @@ -357,7 +357,7 @@ public class BaseEventInfoTest extends TestCase { //------------------------ fixture.setLogLevel("TRACE_DEBUG_LINE"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_DEBUG_LINE", result.getInName()); @@ -366,7 +366,7 @@ public class BaseEventInfoTest extends TestCase { //------------------------ fixture.setLogLevel("TRACE_DEBUG"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_DEBUG", result.getInName()); @@ -375,22 +375,22 @@ public class BaseEventInfoTest extends TestCase { //------------------------- fixture.setLogLevel("LEVEL_UNKNOWN"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("LEVEL_UNKNOWN", result.getInName()); assertEquals("LEVEL_UNKNOWN", result.name()); assertEquals(15, result.ordinal()); - + fixture.setLogLevel("garbage"); - + result = fixture.getLogLevel(); assertNotNull(result); assertEquals("TRACE_DEBUG", result.getInName()); assertEquals("TRACE_DEBUG", result.name()); assertEquals(14, result.ordinal()); } - + /** * Run the String toString() method test. @@ -419,7 +419,7 @@ public class BaseEventInfoTest extends TestCase { assertTrue("equals", !fEventInfo1.equals(fEventInfo2)); assertTrue("equals", !fEventInfo2.equals(fEventInfo1)); } - + public void testEqualsSymmetry() { BaseEventInfo info1 = new BaseEventInfo((BaseEventInfo)fEventInfo1); BaseEventInfo info2 = new BaseEventInfo((BaseEventInfo)fEventInfo2); @@ -430,7 +430,7 @@ public class BaseEventInfoTest extends TestCase { assertTrue("equals", info2.equals(fEventInfo2)); assertTrue("equals", fEventInfo2.equals(info2)); } - + public void testEqualsTransivity() { BaseEventInfo info1 = new BaseEventInfo((BaseEventInfo)fEventInfo1); BaseEventInfo info2 = new BaseEventInfo((BaseEventInfo)fEventInfo1); @@ -440,12 +440,12 @@ public class BaseEventInfoTest extends TestCase { assertTrue("equals", info2.equals(info3)); assertTrue("equals", info1.equals(info3)); } - + public void testEqualsNull() { assertTrue("equals", !fEventInfo1.equals(null)); assertTrue("equals", !fEventInfo2.equals(null)); } - + // ------------------------------------------------------------------------ // hashCode // ------------------------------------------------------------------------ diff --git a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ChannelInfoTest.java b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ChannelInfoTest.java index c3bb233af2..4e9597e8ef 100644 --- a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ChannelInfoTest.java +++ b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ChannelInfoTest.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl; @@ -26,18 +26,18 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.EventInfo; * The class ChannelInfoTest contains tests for the class {@link ChannelInfo}. * */ -@SuppressWarnings("nls") +@SuppressWarnings({"nls", "javadoc"}) public class ChannelInfoTest extends TestCase { // ------------------------------------------------------------------------ // Test data // ------------------------------------------------------------------------ private IChannelInfo fChannelInfo1 = null; private IChannelInfo fChannelInfo2 = null; - + // ------------------------------------------------------------------------ // Housekeeping // ------------------------------------------------------------------------ - + /** * Perform pre-test initialization. * @@ -66,7 +66,7 @@ public class ChannelInfoTest extends TestCase { // ------------------------------------------------------------------------ // Tests // ------------------------------------------------------------------------ - + // ------------------------------------------------------------------------ // Constructors // ------------------------------------------------------------------------ @@ -78,7 +78,7 @@ public class ChannelInfoTest extends TestCase { public void testChannelInfo() { ChannelInfo result = new ChannelInfo("test"); assertNotNull(result); - + assertEquals("test", result.getName()); assertEquals(0, result.getNumberOfSubBuffers()); assertEquals("", result.getOutputType()); @@ -91,7 +91,7 @@ public class ChannelInfoTest extends TestCase { public void testChannelInfoCopy() { ChannelInfo channelInfo = new ChannelInfo((ChannelInfo)fChannelInfo1); - + assertEquals(fChannelInfo1.getName(), channelInfo.getName()); assertEquals(fChannelInfo1.getNumberOfSubBuffers(), channelInfo.getNumberOfSubBuffers()); assertEquals(fChannelInfo1.getOutputType(), channelInfo.getOutputType()); @@ -100,7 +100,7 @@ public class ChannelInfoTest extends TestCase { assertEquals(fChannelInfo1.getState(), channelInfo.getState()); assertEquals(fChannelInfo1.getSwitchTimer(), channelInfo.getSwitchTimer()); assertEquals(fChannelInfo1.getEvents().length, channelInfo.getEvents().length); - + IEventInfo[] orignalEvents = fChannelInfo1.getEvents(); IEventInfo[] resultEvents = channelInfo.getEvents(); for (int i = 0; i < orignalEvents.length; i++) { @@ -132,7 +132,7 @@ public class ChannelInfoTest extends TestCase { fixture.setNumberOfSubBuffers(1); fixture.setOutputType(""); fixture.setSubBufferSize(1L); - + // add an event IEventInfo event = new EventInfo("event"); fixture.addEvent(event); @@ -163,22 +163,22 @@ public class ChannelInfoTest extends TestCase { long switchTimer = fixture.getSwitchTimer(); assertEquals(2L, switchTimer); - + boolean mode = fixture.isOverwriteMode(); assertTrue(mode); - + long readTimer = fixture.getReadTimer(); assertEquals(3L, readTimer); - + TraceEnablement state = fixture.getState(); assertEquals("disabled", state.getInName()); - + long numSubBuffers = fixture.getNumberOfSubBuffers(); assertEquals(4, numSubBuffers); - + String outputType = fixture.getOutputType(); assertEquals("splice()", outputType); - + long subBufferSize = fixture.getSubBufferSize(); assertEquals(1L, subBufferSize); @@ -192,22 +192,22 @@ public class ChannelInfoTest extends TestCase { switchTimer = fixture.getSwitchTimer(); assertEquals(5L, switchTimer); - + mode = fixture.isOverwriteMode(); assertFalse(mode); - + readTimer = fixture.getReadTimer(); assertEquals(6L, readTimer); - + state = fixture.getState(); assertEquals("enabled", state.getInName()); - + numSubBuffers = fixture.getNumberOfSubBuffers(); assertEquals(7, numSubBuffers); - + outputType = fixture.getOutputType(); assertEquals("mmap()", outputType); - + subBufferSize = fixture.getSubBufferSize(); assertEquals(8L, subBufferSize); } @@ -226,7 +226,7 @@ public class ChannelInfoTest extends TestCase { fixture.setOutputType(""); fixture.setSubBufferSize(1L); List events = new LinkedList(); - + for (int i = 0; i < 2; i++) { IEventInfo info = new EventInfo("event" + i); info.setEventType("tracepoint"); @@ -237,9 +237,9 @@ public class ChannelInfoTest extends TestCase { fixture.setEvents(events); IEventInfo[] infos = fixture.getEvents(); - + assertEquals(events.size(), infos.length); - + for (int i = 0; i < infos.length; i++) { assertEquals(events.get(i), infos[i]); } @@ -271,7 +271,7 @@ public class ChannelInfoTest extends TestCase { // add additional test code here assertEquals("[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED)])]", result); } - + // ------------------------------------------------------------------------ // equals // ------------------------------------------------------------------------ @@ -283,7 +283,7 @@ public class ChannelInfoTest extends TestCase { assertTrue("equals", !fChannelInfo1.equals(fChannelInfo2)); assertTrue("equals", !fChannelInfo2.equals(fChannelInfo1)); } - + public void testEqualsSymmetry() { ChannelInfo event1 = new ChannelInfo((ChannelInfo)fChannelInfo1); ChannelInfo event2 = new ChannelInfo((ChannelInfo)fChannelInfo2); @@ -294,7 +294,7 @@ public class ChannelInfoTest extends TestCase { assertTrue("equals", event2.equals(fChannelInfo2)); assertTrue("equals", fChannelInfo2.equals(event2)); } - + public void testEqualsTransivity() { ChannelInfo channel1 = new ChannelInfo((ChannelInfo)fChannelInfo1); ChannelInfo channel2 = new ChannelInfo((ChannelInfo)fChannelInfo1); @@ -304,12 +304,12 @@ public class ChannelInfoTest extends TestCase { assertTrue("equals", channel2.equals(channel3)); assertTrue("equals", channel1.equals(channel3)); } - + public void testEqualsNull() throws Exception { assertTrue("equals", !fChannelInfo1.equals(null)); assertTrue("equals", !fChannelInfo2.equals(null)); } - + // ------------------------------------------------------------------------ // hashCode // ------------------------------------------------------------------------ diff --git a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/DomainInfoTest.java b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/DomainInfoTest.java index e3be27aa56..012c786eb6 100644 --- a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/DomainInfoTest.java +++ b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/DomainInfoTest.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl; @@ -24,7 +24,7 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.DomainInfo * The class ChannelInfoTest contains tests for the class {@link DomainInfo}. * */ -@SuppressWarnings("nls") +@SuppressWarnings({"nls", "javadoc"}) public class DomainInfoTest extends TestCase { // ------------------------------------------------------------------------ // Test data @@ -37,7 +37,7 @@ public class DomainInfoTest extends TestCase { // ------------------------------------------------------------------------ // Housekeeping // ------------------------------------------------------------------------ - + /** * Perform pre-test initialization. * @@ -69,7 +69,7 @@ public class DomainInfoTest extends TestCase { // ------------------------------------------------------------------------ // Tests // ------------------------------------------------------------------------ - + // ------------------------------------------------------------------------ // Constructors // ------------------------------------------------------------------------ @@ -81,7 +81,7 @@ public class DomainInfoTest extends TestCase { public void testDomainInfo() { DomainInfo result = new DomainInfo("test"); assertNotNull(result); - + assertEquals("test", result.getName()); assertEquals(0, result.getChannels().length); } @@ -111,19 +111,19 @@ public class DomainInfoTest extends TestCase { * */ public void testGetAndSetters() { - + // Note that addChannel() has been executed in setUp() // check get method here assertEquals(1, fDomainInfo1.getChannels().length); assertNotNull(fDomainInfo1.getChannels()[0]); assertEquals(fChannelInfo1, fDomainInfo1.getChannels()[0]); - + IDomainInfo domain = new DomainInfo("domain"); List list = new LinkedList(); list.add(fChannelInfo1); list.add(fChannelInfo2); domain.setChannels(list); - + IChannelInfo[] result = domain.getChannels(); assertEquals(2, result.length); assertEquals(fChannelInfo1, result[0]); @@ -147,7 +147,7 @@ public class DomainInfoTest extends TestCase { assertEquals("[DomainInfo([TraceInfo(Name=test1)],Channels=[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED)])],isKernel=false)]", result); } - + // ------------------------------------------------------------------------ // equals // ------------------------------------------------------------------------ @@ -159,7 +159,7 @@ public class DomainInfoTest extends TestCase { assertTrue("equals", !fDomainInfo1.equals(fDomainInfo2)); assertTrue("equals", !fDomainInfo2.equals(fDomainInfo1)); } - + public void testEqualsSymmetry() { DomainInfo event1 = new DomainInfo((DomainInfo)fDomainInfo1); DomainInfo event2 = new DomainInfo((DomainInfo)fDomainInfo2); @@ -170,7 +170,7 @@ public class DomainInfoTest extends TestCase { assertTrue("equals", event2.equals(fDomainInfo2)); assertTrue("equals", fDomainInfo2.equals(event2)); } - + public void testEqualsTransivity() { DomainInfo channel1 = new DomainInfo((DomainInfo)fDomainInfo1); DomainInfo channel2 = new DomainInfo((DomainInfo)fDomainInfo1); @@ -180,12 +180,12 @@ public class DomainInfoTest extends TestCase { assertTrue("equals", channel2.equals(channel3)); assertTrue("equals", channel1.equals(channel3)); } - + public void testEqualsNull() throws Exception { assertTrue("equals", !fDomainInfo1.equals(null)); assertTrue("equals", !fDomainInfo2.equals(null)); } - + // ------------------------------------------------------------------------ // hashCode // ------------------------------------------------------------------------ diff --git a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/EventInfoTest.java b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/EventInfoTest.java index 0a171a0ae0..3b11d4109c 100644 --- a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/EventInfoTest.java +++ b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/EventInfoTest.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl; @@ -22,7 +22,7 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.EventInfo; /** * The class BaseEventInfoTest contains test for the class {@link BaseEventInfo}. */ -@SuppressWarnings("nls") +@SuppressWarnings({"nls", "javadoc"}) public class EventInfoTest extends TestCase { // ------------------------------------------------------------------------ @@ -30,7 +30,7 @@ public class EventInfoTest extends TestCase { // ------------------------------------------------------------------------ private IEventInfo fEventInfo1 = null; private IEventInfo fEventInfo2 = null; - + // ------------------------------------------------------------------------ // Housekeeping // ------------------------------------------------------------------------ @@ -68,15 +68,15 @@ public class EventInfoTest extends TestCase { public void testBaseEventInfo() { EventInfo fixture = new EventInfo("event"); assertNotNull(fixture); - + TraceEventType result = fixture.getEventType(); - + assertEquals("event", fixture.getName()); assertEquals("unknown", result.getInName()); assertEquals("UNKNOWN", result.name()); assertEquals("UNKNOWN", result.toString()); assertEquals(3, result.ordinal()); - + TraceEnablement state = fixture.getState(); assertEquals("disabled", state.getInName()); assertEquals("DISABLED", state.name()); @@ -90,7 +90,7 @@ public class EventInfoTest extends TestCase { */ public void testEventInfoCopy() { EventInfo info = new EventInfo((EventInfo)fEventInfo1); - + assertEquals(fEventInfo1.getName(), info.getName()); assertEquals(fEventInfo1.getEventType(), info.getEventType()); assertEquals(fEventInfo1.getState(), info.getState()); @@ -109,13 +109,13 @@ public class EventInfoTest extends TestCase { // Success } } - + /** - * Getter/Setter tests + * Getter/Setter tests */ public void testGetAndSetter() { EventInfo fixture = new EventInfo("event"); - + fixture.setEventType(TraceEventType.TRACEPOINT); TraceEventType result = fixture.getEventType(); @@ -132,12 +132,12 @@ public class EventInfoTest extends TestCase { assertEquals("UNKNOWN", result.name()); assertEquals("UNKNOWN", result.toString()); assertEquals(3, result.ordinal()); - + // setEventType(String typeName) String typeName = ""; fixture.setEventType(typeName); result = fixture.getEventType(); - + assertEquals("unknown", result.getInName()); assertEquals("UNKNOWN", result.name()); assertEquals("UNKNOWN", result.toString()); @@ -147,7 +147,7 @@ public class EventInfoTest extends TestCase { fixture.setEventType(typeName); result = fixture.getEventType(); - + assertEquals("unknown", result.getInName()); assertEquals("UNKNOWN", result.name()); assertEquals("UNKNOWN", result.toString()); @@ -167,14 +167,14 @@ public class EventInfoTest extends TestCase { assertEquals("DISABLED", state.name()); assertEquals("DISABLED", state.toString()); assertEquals(0, state.ordinal()); - + fixture.setState("enabled"); state = fixture.getState(); assertEquals("enabled", state.getInName()); assertEquals("ENABLED", state.name()); assertEquals("ENABLED", state.toString()); assertEquals(1, state.ordinal()); - + // setState(TraceEnablement state) fixture.setState(TraceEnablement.DISABLED); state = fixture.getState(); @@ -182,7 +182,7 @@ public class EventInfoTest extends TestCase { assertEquals("DISABLED", state.name()); assertEquals("DISABLED", state.toString()); assertEquals(0, state.ordinal()); - + fixture.setState(TraceEnablement.ENABLED); state = fixture.getState(); assertEquals("enabled", state.getInName()); @@ -215,7 +215,7 @@ public class EventInfoTest extends TestCase { assertTrue("equals", !fEventInfo1.equals(fEventInfo2)); assertTrue("equals", !fEventInfo2.equals(fEventInfo1)); } - + public void testEqualsSymmetry() { EventInfo info1 = new EventInfo((EventInfo)fEventInfo1); EventInfo info2 = new EventInfo((EventInfo)fEventInfo2); @@ -226,7 +226,7 @@ public class EventInfoTest extends TestCase { assertTrue("equals", info2.equals(fEventInfo2)); assertTrue("equals", fEventInfo2.equals(info2)); } - + public void testEqualsTransivity() { EventInfo info1 = new EventInfo((EventInfo)fEventInfo1); EventInfo info2 = new EventInfo((EventInfo)fEventInfo1); @@ -236,12 +236,12 @@ public class EventInfoTest extends TestCase { assertTrue("equals", info2.equals(info3)); assertTrue("equals", info1.equals(info3)); } - + public void testEqualsNull() { assertTrue("equals", !fEventInfo1.equals(null)); assertTrue("equals", !fEventInfo2.equals(null)); } - + // ------------------------------------------------------------------------ // hashCode // ------------------------------------------------------------------------ diff --git a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ModelImplFactory.java b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ModelImplFactory.java index 3dad415bcd..fa92c7c051 100644 --- a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ModelImplFactory.java +++ b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ModelImplFactory.java @@ -1,11 +1,11 @@ /******************************************************************************* * Copyright (c) 2012 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 *******************************************************************************/ @@ -31,11 +31,11 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.SessionInf import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.UstProviderInfo; /** - * Test facility to constants across test case + * Test facility to constants across test case */ -@SuppressWarnings("nls") +@SuppressWarnings({"nls", "javadoc"}) public class ModelImplFactory { - + private ISessionInfo fSessionInfo1 = null; private ISessionInfo fSessionInfo2 = null; private IDomainInfo fDomainInfo1 = null; @@ -51,7 +51,7 @@ public class ModelImplFactory { private IUstProviderInfo fUstProviderInfo2 = null; private IProbeEventInfo fProbeEventInfo1 = null; private IProbeEventInfo fProbeEventInfo2 = null; - + public ModelImplFactory() { fBaseEventInfo1 = new BaseEventInfo("event1"); fBaseEventInfo1.setEventType(TraceEventType.UNKNOWN); @@ -59,7 +59,7 @@ public class ModelImplFactory { fBaseEventInfo2 = new BaseEventInfo("event2"); fBaseEventInfo2.setEventType(TraceEventType.TRACEPOINT); fBaseEventInfo1.setLogLevel(TraceLogLevel.TRACE_DEBUG); - + fEventInfo1 = new EventInfo("event1"); fEventInfo1.setEventType(TraceEventType.TRACEPOINT); fEventInfo1.setState(TraceEnablement.ENABLED); @@ -67,7 +67,7 @@ public class ModelImplFactory { fEventInfo2 = new EventInfo("event2"); fEventInfo2.setEventType(TraceEventType.UNKNOWN); fEventInfo2.setState(TraceEnablement.DISABLED); - + fEventInfo3 = new EventInfo("event3"); fEventInfo3.setEventType(TraceEventType.TRACEPOINT); fEventInfo3.setState(TraceEnablement.DISABLED); @@ -101,14 +101,14 @@ public class ModelImplFactory { fChannelInfo2.setSubBufferSize(4L); fChannelInfo2.addEvent(fEventInfo2); fChannelInfo2.addEvent(fEventInfo3); - + fDomainInfo1 = new DomainInfo("test1"); fDomainInfo1.addChannel(fChannelInfo1); fDomainInfo2 = new DomainInfo("test2"); fDomainInfo2.addChannel(fChannelInfo1); fDomainInfo2.addChannel(fChannelInfo2); - + fSessionInfo1 = new SessionInfo("session1"); fSessionInfo1.setSessionPath("/home/user"); fSessionInfo1.setSessionState(TraceSessionState.ACTIVE); @@ -131,7 +131,7 @@ public class ModelImplFactory { fProbeEventInfo2.setOffset("0x100"); fProbeEventInfo2.setSymbol("init_post"); } - + public ISessionInfo getSessionInfo1() { return fSessionInfo1; } @@ -167,7 +167,7 @@ public class ModelImplFactory { public IEventInfo getEventInfo3() { return fEventInfo3; } - + public IBaseEventInfo getBaseEventInfo1() { return fBaseEventInfo1; } @@ -175,7 +175,7 @@ public class ModelImplFactory { public IBaseEventInfo getBaseEventInfo2() { return fBaseEventInfo2; } - + public IUstProviderInfo getUstProviderInfo1() { return fUstProviderInfo1; } @@ -183,7 +183,7 @@ public class ModelImplFactory { public IUstProviderInfo getUstProviderInfo2() { return fUstProviderInfo2; } - + public IProbeEventInfo getProbeEventInfo1() { return fProbeEventInfo1; } diff --git a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ProbeEventInfoTest.java b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ProbeEventInfoTest.java index 5b8fac676d..6719117617 100644 --- a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ProbeEventInfoTest.java +++ b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ProbeEventInfoTest.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl; @@ -22,7 +22,7 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ProbeEvent /** * The class BaseEventInfoTest contains test for the class {@link BaseEventInfo}. */ -@SuppressWarnings("nls") +@SuppressWarnings({"nls", "javadoc"}) public class ProbeEventInfoTest extends TestCase { // ------------------------------------------------------------------------ @@ -30,7 +30,7 @@ public class ProbeEventInfoTest extends TestCase { // ------------------------------------------------------------------------ private IProbeEventInfo fEventInfo1 = null; private IProbeEventInfo fEventInfo2 = null; - + // ------------------------------------------------------------------------ // Housekeeping // ------------------------------------------------------------------------ @@ -68,21 +68,21 @@ public class ProbeEventInfoTest extends TestCase { public void testBaseEventInfo() { ProbeEventInfo fixture = new ProbeEventInfo("event"); assertNotNull(fixture); - + TraceEventType result = fixture.getEventType(); - + assertEquals("event", fixture.getName()); assertEquals("unknown", result.getInName()); assertEquals("UNKNOWN", result.name()); assertEquals("UNKNOWN", result.toString()); assertEquals(3, result.ordinal()); - + TraceEnablement state = fixture.getState(); assertEquals("disabled", state.getInName()); assertEquals("DISABLED", state.name()); assertEquals("DISABLED", state.toString()); assertEquals(0, state.ordinal()); - + assertNull(fixture.getAddress()); assertNull(fixture.getOffset()); assertNull(fixture.getSymbol()); @@ -93,7 +93,7 @@ public class ProbeEventInfoTest extends TestCase { */ public void testEventInfoCopy() { ProbeEventInfo info = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); - + assertEquals(fEventInfo1.getName(), info.getName()); assertEquals(fEventInfo1.getEventType(), info.getEventType()); assertEquals(fEventInfo1.getState(), info.getState()); @@ -115,13 +115,13 @@ public class ProbeEventInfoTest extends TestCase { // Success } } - + /** - * Getter/Setter tests + * Getter/Setter tests */ public void testGetAndSetter() { ProbeEventInfo fixture = new ProbeEventInfo("event"); - + fixture.setAddress("0xc12344321"); String result = fixture.getAddress(); @@ -159,7 +159,7 @@ public class ProbeEventInfoTest extends TestCase { assertTrue("equals", !fEventInfo1.equals(fEventInfo2)); assertTrue("equals", !fEventInfo2.equals(fEventInfo1)); } - + public void testEqualsSymmetry() { ProbeEventInfo info1 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); ProbeEventInfo info2 = new ProbeEventInfo((ProbeEventInfo)fEventInfo2); @@ -170,7 +170,7 @@ public class ProbeEventInfoTest extends TestCase { assertTrue("equals", info2.equals(fEventInfo2)); assertTrue("equals", fEventInfo2.equals(info2)); } - + public void testEqualsTransivity() { ProbeEventInfo info1 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); ProbeEventInfo info2 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1); @@ -180,12 +180,12 @@ public class ProbeEventInfoTest extends TestCase { assertTrue("equals", info2.equals(info3)); assertTrue("equals", info1.equals(info3)); } - + public void testEqualsNull() { assertTrue("equals", !fEventInfo1.equals(null)); assertTrue("equals", !fEventInfo2.equals(null)); } - + // ------------------------------------------------------------------------ // hashCode // ------------------------------------------------------------------------ diff --git a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/SessionInfoTest.java b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/SessionInfoTest.java index 730214610e..69f937ef71 100644 --- a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/SessionInfoTest.java +++ b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/SessionInfoTest.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl; @@ -25,21 +25,21 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.SessionInf * The class ChannelInfoTest contains tests for the class {@link SessionInfo}. * */ -@SuppressWarnings("nls") +@SuppressWarnings({"nls", "javadoc"}) public class SessionInfoTest extends TestCase { // ------------------------------------------------------------------------ // Test data // ------------------------------------------------------------------------ private ISessionInfo fSessionInfo1 = null; private ISessionInfo fSessionInfo2 = null; - + private IDomainInfo fDomainInfo1 = null; private IDomainInfo fDomainInfo2 = null; // ------------------------------------------------------------------------ // Housekeeping // ------------------------------------------------------------------------ - + /** * Perform pre-test initialization. * @@ -70,7 +70,7 @@ public class SessionInfoTest extends TestCase { // ------------------------------------------------------------------------ // Tests // ------------------------------------------------------------------------ - + // ------------------------------------------------------------------------ // Constructors // ------------------------------------------------------------------------ @@ -82,7 +82,7 @@ public class SessionInfoTest extends TestCase { public void testSessionInfo() { ISessionInfo result = new SessionInfo("test"); assertNotNull(result); - + assertEquals("test", result.getName()); assertEquals("", result.getSessionPath()); TraceSessionState state = result.getSessionState(); @@ -95,7 +95,7 @@ public class SessionInfoTest extends TestCase { public void testSessionInfoCopy() { SessionInfo sessionInfo = new SessionInfo((SessionInfo)fSessionInfo1); - + assertEquals(sessionInfo.getName(), fSessionInfo1.getName()); assertEquals(sessionInfo.getSessionPath(), fSessionInfo1.getSessionPath()); assertEquals(sessionInfo.getSessionState(), fSessionInfo1.getSessionState()); @@ -123,27 +123,27 @@ public class SessionInfoTest extends TestCase { * */ public void testGetAndSetters() { - + // Note that addDomain() has been executed in setUp() // check get method here assertEquals(1, fSessionInfo1.getDomains().length); assertNotNull(fSessionInfo1.getDomains()[0]); assertEquals(fDomainInfo1, fSessionInfo1.getDomains()[0]); - + ISessionInfo session = new SessionInfo("session"); List list = new LinkedList(); list.add(fDomainInfo1); list.add(fDomainInfo2); session.setDomains(list); - + IDomainInfo[] result = session.getDomains(); assertEquals(2, result.length); assertEquals(fDomainInfo1, result[0]); assertEquals(fDomainInfo2, result[1]); - + session.setSessionPath("/home/user"); assertEquals("/home/user", session.getSessionPath()); - + session.setSessionState("active"); TraceSessionState state = session.getSessionState(); state = session.getSessionState(); @@ -151,7 +151,7 @@ public class SessionInfoTest extends TestCase { assertEquals("ACTIVE", state.name()); assertEquals("ACTIVE", state.toString()); assertEquals(1, state.ordinal()); - + session.setSessionState("inactive"); state = session.getSessionState(); assertEquals("inactive", state.getInName()); @@ -165,7 +165,7 @@ public class SessionInfoTest extends TestCase { assertEquals("INACTIVE", state.name()); assertEquals("INACTIVE", state.toString()); assertEquals(0, state.ordinal()); - + session.setSessionState(TraceSessionState.ACTIVE); state = session.getSessionState(); assertEquals("active", state.getInName()); @@ -200,7 +200,7 @@ public class SessionInfoTest extends TestCase { // add additional test code here assertEquals("[SessionInfo([TraceInfo(Name=session1)],State=ACTIVE,Domains=[DomainInfo([TraceInfo(Name=test1)],Channels=[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED)])],isKernel=false)])]", result); } - + // ------------------------------------------------------------------------ // equals // ------------------------------------------------------------------------ @@ -212,7 +212,7 @@ public class SessionInfoTest extends TestCase { assertTrue("equals", !fSessionInfo1.equals(fSessionInfo2)); assertTrue("equals", !fSessionInfo2.equals(fSessionInfo1)); } - + public void testEqualsSymmetry() { SessionInfo event1 = new SessionInfo((SessionInfo)fSessionInfo1); SessionInfo event2 = new SessionInfo((SessionInfo)fSessionInfo2); @@ -223,7 +223,7 @@ public class SessionInfoTest extends TestCase { assertTrue("equals", event2.equals(fSessionInfo2)); assertTrue("equals", fSessionInfo2.equals(event2)); } - + public void testEqualsTransivity() { SessionInfo channel1 = new SessionInfo((SessionInfo)fSessionInfo1); SessionInfo channel2 = new SessionInfo((SessionInfo)fSessionInfo1); @@ -233,12 +233,12 @@ public class SessionInfoTest extends TestCase { assertTrue("equals", channel2.equals(channel3)); assertTrue("equals", channel1.equals(channel3)); } - + public void testEqualsNull() throws Exception { assertTrue("equals", !fSessionInfo1.equals(null)); assertTrue("equals", !fSessionInfo2.equals(null)); } - + // ------------------------------------------------------------------------ // hashCode // ------------------------------------------------------------------------ diff --git a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/TraceInfoTest.java b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/TraceInfoTest.java index b1902f74fb..e60169c117 100644 --- a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/TraceInfoTest.java +++ b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/TraceInfoTest.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl; @@ -19,7 +19,7 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.TraceInfo; /** * The class TraceInfoTest contains test for the class {@link TraceInfo}. */ -@SuppressWarnings("nls") +@SuppressWarnings({"nls", "javadoc"}) public class TraceInfoTest extends TestCase { // ------------------------------------------------------------------------ @@ -27,8 +27,8 @@ public class TraceInfoTest extends TestCase { // ------------------------------------------------------------------------ private ITraceInfo fTraceInfo1 = null; private ITraceInfo fTraceInfo2 = null; - - + + // ------------------------------------------------------------------------ // Housekeeping // ------------------------------------------------------------------------ @@ -65,7 +65,7 @@ public class TraceInfoTest extends TestCase { public void testTraceInfo() { TraceInfo fixture = new TraceInfo("event"); assertNotNull(fixture); - + assertEquals("event", fixture.getName()); } @@ -82,13 +82,13 @@ public class TraceInfoTest extends TestCase { // Success } } - + /** * Test Copy Constructor */ public void testTraceInfoCopy() { TraceInfo info = new TraceInfo((TraceInfo)fTraceInfo1); - + assertEquals(fTraceInfo1.getName(), info.getName()); } @@ -105,7 +105,7 @@ public class TraceInfoTest extends TestCase { // Success } } - + /** * Run the void setEventType(String) method test. * @@ -126,7 +126,7 @@ public class TraceInfoTest extends TestCase { // add additional test code here assertEquals("[TraceInfo(Name=event1)]", result); } - + // ------------------------------------------------------------------------ // equals // ------------------------------------------------------------------------ @@ -138,7 +138,7 @@ public class TraceInfoTest extends TestCase { assertTrue("equals", !fTraceInfo1.equals(fTraceInfo2)); assertTrue("equals", !fTraceInfo2.equals(fTraceInfo1)); } - + public void testEqualsSymmetry() { TraceInfo info1 = new TraceInfo((TraceInfo)fTraceInfo1); TraceInfo info2 = new TraceInfo((TraceInfo)fTraceInfo2); @@ -149,7 +149,7 @@ public class TraceInfoTest extends TestCase { assertTrue("equals", info2.equals(fTraceInfo2)); assertTrue("equals", fTraceInfo2.equals(info2)); } - + public void testEqualsTransivity() { TraceInfo info1 = new TraceInfo((TraceInfo)fTraceInfo1); TraceInfo info2 = new TraceInfo((TraceInfo)fTraceInfo1); @@ -159,12 +159,12 @@ public class TraceInfoTest extends TestCase { assertTrue("equals", info2.equals(info3)); assertTrue("equals", info1.equals(info3)); } - + public void testEqualsNull() { assertTrue("equals", !fTraceInfo1.equals(null)); assertTrue("equals", !fTraceInfo2.equals(null)); } - + // ------------------------------------------------------------------------ // hashCode // ------------------------------------------------------------------------ diff --git a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/UstProviderInfoTest.java b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/UstProviderInfoTest.java index b1d979e283..ada9f1ceac 100644 --- a/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/UstProviderInfoTest.java +++ b/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/UstProviderInfoTest.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl; @@ -25,21 +25,21 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.UstProvide * The class ChannelInfoTest contains tests for the class {@link UstProviderInfo}. * */ -@SuppressWarnings("nls") +@SuppressWarnings({"nls", "javadoc"}) public class UstProviderInfoTest extends TestCase { // ------------------------------------------------------------------------ // Test data // ------------------------------------------------------------------------ private IUstProviderInfo fUstProviderInfo1 = null; private IUstProviderInfo fUstProviderInfo2 = null; - + private IBaseEventInfo fEventInfo1 = null; private IBaseEventInfo fEventInfo2 = null; - + // ------------------------------------------------------------------------ // Housekeeping // ------------------------------------------------------------------------ - + /** * Perform pre-test initialization. * @@ -70,7 +70,7 @@ public class UstProviderInfoTest extends TestCase { // ------------------------------------------------------------------------ // Tests // ------------------------------------------------------------------------ - + // ------------------------------------------------------------------------ // Constructors // ------------------------------------------------------------------------ @@ -82,7 +82,7 @@ public class UstProviderInfoTest extends TestCase { public void testUstProviderInfo() { IUstProviderInfo result = new UstProviderInfo("test"); assertNotNull(result); - + assertEquals("test", result.getName()); assertEquals(0, result.getPid()); assertEquals(0, result.getEvents().length); @@ -90,11 +90,11 @@ public class UstProviderInfoTest extends TestCase { public void testUstProviderInfoCopy() { IUstProviderInfo providerInf = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); - + assertEquals(fUstProviderInfo1.getName(), providerInf.getName()); assertEquals(fUstProviderInfo1.getPid(), providerInf.getPid()); assertEquals(fUstProviderInfo1.getEvents().length, providerInf.getEvents().length); - + IBaseEventInfo[] orignalEvents = fUstProviderInfo1.getEvents(); IBaseEventInfo[] resultEvents = providerInf.getEvents(); for (int i = 0; i < orignalEvents.length; i++) { @@ -120,7 +120,7 @@ public class UstProviderInfoTest extends TestCase { public void testGetAndSetters() { IUstProviderInfo fixture = new UstProviderInfo("test"); fixture.setPid(2468); - + // add an event IBaseEventInfo event = new BaseEventInfo("event"); fixture.addEvent(event); @@ -132,7 +132,7 @@ public class UstProviderInfoTest extends TestCase { assertEquals(1, result.length); assertNotNull(result[0]); assertTrue(event.equals(result[0])); - + assertEquals(2468, fixture.getPid()); } @@ -147,11 +147,11 @@ public class UstProviderInfoTest extends TestCase { events.add(fEventInfo1); events.add(fEventInfo2); fixture.setEvents(events); - + IBaseEventInfo[] infos = fixture.getEvents(); - + assertEquals(events.size(), infos.length); - + for (int i = 0; i < infos.length; i++) { assertEquals(events.get(i), infos[i]); } @@ -173,7 +173,7 @@ public class UstProviderInfoTest extends TestCase { String result = fUstProviderInfo2.toString(); assertEquals("[EventInfo([TraceInfo(Name=myUST2)],PID=2345,Events=[BaseEventInfo([TraceInfo(Name=event1)],type=UNKNOWN,level=TRACE_DEBUG)][BaseEventInfo([TraceInfo(Name=event2)],type=TRACEPOINT,level=TRACE_DEBUG)])]", result); } - + // ------------------------------------------------------------------------ // equals // ------------------------------------------------------------------------ @@ -185,7 +185,7 @@ public class UstProviderInfoTest extends TestCase { assertTrue("equals", !fUstProviderInfo1.equals(fUstProviderInfo2)); assertTrue("equals", !fUstProviderInfo2.equals(fUstProviderInfo1)); } - + public void testEqualsSymmetry() { UstProviderInfo event1 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); UstProviderInfo event2 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo2); @@ -196,7 +196,7 @@ public class UstProviderInfoTest extends TestCase { assertTrue("equals", event2.equals(fUstProviderInfo2)); assertTrue("equals", fUstProviderInfo2.equals(event2)); } - + public void testEqualsTransivity() { UstProviderInfo UstProvider1 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); UstProviderInfo UstProvider2 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1); @@ -206,12 +206,12 @@ public class UstProviderInfoTest extends TestCase { assertTrue("equals", UstProvider2.equals(UstProvider3)); assertTrue("equals", UstProvider1.equals(UstProvider3)); } - + public void testEqualsNull() throws Exception { assertTrue("equals", !fUstProviderInfo1.equals(null)); assertTrue("equals", !fUstProviderInfo2.equals(null)); } - + // ------------------------------------------------------------------------ // hashCode // ------------------------------------------------------------------------ diff --git a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/ISessionInfo.java b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/ISessionInfo.java index 3850c60102..dbbfb566ee 100644 --- a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/ISessionInfo.java +++ b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/ISessionInfo.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.internal.lttng2.core.control.model; @@ -17,7 +17,7 @@ import java.util.List; *

* Interface for retrieval of trace session information. *

- * + * * @author Bernd Hufmann */ public interface ISessionInfo extends ITraceInfo { @@ -31,38 +31,38 @@ public interface ISessionInfo extends ITraceInfo { * @param state - state to set. */ public void setSessionState(TraceSessionState state); - + /** * Sets the event state to the value specified by the given name. * @param stateName - state to set. */ public void setSessionState(String stateName); - + /** * @return path string where session is located. */ public String getSessionPath(); - + /** * Sets the path string (where session is located) to the given value. * @param path - session path to set. */ public void setSessionPath(String path); - + /** * @return all domain information as array. */ public IDomainInfo[] getDomains(); - + /** * Sets all domain information specified by given list. * @param domains - all domain information to set. */ public void setDomains(List domains); - + /** * Adds a single domain information. - * @param domain - domain information to add. + * @param domainInfo domain information to add. */ public void addDomain(IDomainInfo domainInfo); } diff --git a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/ITraceInfo.java b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/ITraceInfo.java index b8d677d36e..57ea7d8288 100644 --- a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/ITraceInfo.java +++ b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/ITraceInfo.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.internal.lttng2.core.control.model; @@ -15,7 +15,7 @@ package org.eclipse.linuxtools.internal.lttng2.core.control.model; *

* Interface for retrieve trace comon information. *

- * + * * @author Bernd Hufmann */ public interface ITraceInfo { @@ -23,11 +23,13 @@ public interface ITraceInfo { * @return the name of the information element. */ public String getName(); - + /** * Sets the name of the information element. + * * @param name + * The name to assign */ public void setName(String name); - + } diff --git a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/LogLevelType.java b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/LogLevelType.java index 3c38e27391..1cc3d7924b 100644 --- a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/LogLevelType.java +++ b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/LogLevelType.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation *********************************************************************/ package org.eclipse.linuxtools.internal.lttng2.core.control.model; @@ -15,17 +15,20 @@ package org.eclipse.linuxtools.internal.lttng2.core.control.model; *

* Type of log Level enumeration. *

- * + * * @author Bernd Hufmann */ public enum LogLevelType { - + // ------------------------------------------------------------------------ // Enum definition // ------------------------------------------------------------------------ - LOGLEVEL, // range of log levels [0,logLevel] - LOGLEVEL_ONLY, // single log level - LOGLEVEL_NONE; // no log level -}; + /** range of log levels [0,logLevel] */ + LOGLEVEL, + /** single log level */ + LOGLEVEL_ONLY, + /** no log level */ + LOGLEVEL_NONE; +} diff --git a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TargetNodeState.java b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TargetNodeState.java index c127174eb6..ae1cfa7bca 100644 --- a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TargetNodeState.java +++ b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TargetNodeState.java @@ -1,26 +1,30 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.internal.lttng2.core.control.model; /** *

- * Enumeration for the node connection state. + * Enumeration for the node connection state. *

- * + * * @author Bernd Hufmann */ public enum TargetNodeState { - DISCONNECTED, - DISCONNECTING, - CONNECTED, - CONNECTING; + /** State when disconnected */ + DISCONNECTED, + /** State while disconnecting */ + DISCONNECTING, + /** State when connected */ + CONNECTED, + /** State while connecting */ + CONNECTING; } diff --git a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceEnablement.java b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceEnablement.java index a8a50d1f2e..c9eab3e097 100644 --- a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceEnablement.java +++ b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceEnablement.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.internal.lttng2.core.control.model; @@ -15,7 +15,7 @@ package org.eclipse.linuxtools.internal.lttng2.core.control.model; *

* Enumeration for enabled/disabled states. *

- * + * * @author Bernd Hufmann */ public enum TraceEnablement { @@ -23,21 +23,23 @@ public enum TraceEnablement { // ------------------------------------------------------------------------ // Enum definition // ------------------------------------------------------------------------ + /** Tracing is disabled */ DISABLED("disabled"), //$NON-NLS-1$ + /** Tracing is enabled */ ENABLED("enabled"); //$NON-NLS-1$ // ------------------------------------------------------------------------ // Attributes // ------------------------------------------------------------------------ /** - * Name of enum + * Name of enum */ private final String fInName; // ------------------------------------------------------------------------ // Constuctors // ------------------------------------------------------------------------ - + /** * Private constructor * @param name the name of state @@ -55,5 +57,4 @@ public enum TraceEnablement { public String getInName() { return fInName; } -}; - +} diff --git a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceEventType.java b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceEventType.java index 0650831a96..67b84b10b7 100644 --- a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceEventType.java +++ b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceEventType.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.internal.lttng2.core.control.model; @@ -15,13 +15,17 @@ package org.eclipse.linuxtools.internal.lttng2.core.control.model; *

* Trace event type enumeration. *

- * + * * @author Bernd Hufmann */ -public enum TraceEventType { +public enum TraceEventType { + /** Event type: tracepoint */ TRACEPOINT("tracepoint"), //$NON-NLS-1$ + /** Event type: syscall */ SYSCALL("syscall"), //$NON-NLS-1$ + /** Event type: probe */ PROBE("probe"), //$NON-NLS-1$ + /** Event type unknown */ UNKNOWN("unknown"); //$NON-NLS-1$ private final String fInName; @@ -30,8 +34,13 @@ public enum TraceEventType { fInName = name; } + /** + * Get the type's name + * + * @return The type's name + */ public String getInName() { return fInName; } -}; +} diff --git a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceLogLevel.java b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceLogLevel.java index 894989b203..27e7ba2d5b 100644 --- a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceLogLevel.java +++ b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceLogLevel.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation *********************************************************************/ package org.eclipse.linuxtools.internal.lttng2.core.control.model; @@ -15,44 +15,60 @@ package org.eclipse.linuxtools.internal.lttng2.core.control.model; *

* Log Level enumeration. *

- * + * * @author Bernd Hufmann */ @SuppressWarnings("nls") public enum TraceLogLevel { - + // ------------------------------------------------------------------------ // Enum definition // ------------------------------------------------------------------------ - TRACE_EMERG("TRACE_EMERG"), // 0 - TRACE_ALERT("TRACE_ALERT"), // 1 - TRACE_CRIT("TRACE_CRIT"), // 2 - TRACE_ERR("TRACE_ERR"), // 3 - TRACE_WARNING("TRACE_WARNING"), // 4 - TRACE_NOTICE("TRACE_NOTICE"), // 5 - TRACE_INFO("TRACE_INFO"), // 6 - TRACE_DEBUG_SYSTEM("TRACE_DEBUG_SYSTEM"), // 7 - TRACE_DEBUG_PROGRAM("TRACE_DEBUG_PROGRAM"), // 8 - TRACE_DEBUG_PROCESS("TRACE_DEBUG_PROCESS"), // 9 - TRACE_DEBUG_MODULE("TRACE_DEBUG_MODULE"), // 10 - TRACE_DEBUG_UNIT("TRACE_DEBUG_UNIT"), // 11 - TRACE_DEBUG_FUNCTION("TRACE_DEBUG_FUNCTION"), //12 - TRACE_DEBUG_LINE("TRACE_DEBUG_LINE"), //13 - TRACE_DEBUG("TRACE_DEBUG"), // 14 - LEVEL_UNKNOWN("LEVEL_UNKNOWN"); // 15 + /** Log level 0 */ + TRACE_EMERG("TRACE_EMERG"), + /** Log level 1 */ + TRACE_ALERT("TRACE_ALERT"), + /** Log level 2 */ + TRACE_CRIT("TRACE_CRIT"), + /** Log level 3 */ + TRACE_ERR("TRACE_ERR"), + /** Log level 4 */ + TRACE_WARNING("TRACE_WARNING"), + /** Log level 5 */ + TRACE_NOTICE("TRACE_NOTICE"), + /** Log level 6 */ + TRACE_INFO("TRACE_INFO"), + /** Log level 7 */ + TRACE_DEBUG_SYSTEM("TRACE_DEBUG_SYSTEM"), + /** Log level 8 */ + TRACE_DEBUG_PROGRAM("TRACE_DEBUG_PROGRAM"), + /** Log level 9 */ + TRACE_DEBUG_PROCESS("TRACE_DEBUG_PROCESS"), + /** Log level 10 */ + TRACE_DEBUG_MODULE("TRACE_DEBUG_MODULE"), + /** Log level 11 */ + TRACE_DEBUG_UNIT("TRACE_DEBUG_UNIT"), + /** Log level 12 */ + TRACE_DEBUG_FUNCTION("TRACE_DEBUG_FUNCTION"), + /** Log level 13 */ + TRACE_DEBUG_LINE("TRACE_DEBUG_LINE"), + /** Log level 14 */ + TRACE_DEBUG("TRACE_DEBUG"), + /** Log level 15 */ + LEVEL_UNKNOWN("LEVEL_UNKNOWN"); // ------------------------------------------------------------------------ // Attributes // ------------------------------------------------------------------------ /** - * Name of enum. + * Name of enum. */ private final String fInName; // ------------------------------------------------------------------------ // Constuctors // ------------------------------------------------------------------------ - + /** * Private constructor * @param name the name of state @@ -70,6 +86,4 @@ public enum TraceLogLevel { public String getInName() { return fInName; } -}; - - +} diff --git a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceSessionState.java b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceSessionState.java index 3f1f0d18a8..2bd1f38e0b 100644 --- a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceSessionState.java +++ b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/TraceSessionState.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation *********************************************************************/ package org.eclipse.linuxtools.internal.lttng2.core.control.model; @@ -15,29 +15,31 @@ package org.eclipse.linuxtools.internal.lttng2.core.control.model; *

* Session state enumeration. *

- * + * * @author Bernd Hufmann */ public enum TraceSessionState { - + // ------------------------------------------------------------------------ // Enum definition // ------------------------------------------------------------------------ + /** Trace session inactive */ INACTIVE("inactive"), //$NON-NLS-1$ + /** Trace session active */ ACTIVE("active"); //$NON-NLS-1$ // ------------------------------------------------------------------------ // Attributes // ------------------------------------------------------------------------ /** - * Name of enum. + * Name of enum. */ private final String fInName; // ------------------------------------------------------------------------ // Constuctors // ------------------------------------------------------------------------ - + /** * Private constructor * @param name the name of state @@ -55,5 +57,4 @@ public enum TraceSessionState { public String getInName() { return fInName; } -}; - +} diff --git a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/ChannelInfo.java b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/ChannelInfo.java index 1eb5520263..4a3ae9ca43 100644 --- a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/ChannelInfo.java +++ b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/ChannelInfo.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.internal.lttng2.core.control.model.impl; @@ -22,9 +22,9 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement /** *

* Implementation of the trace channel interface (IChannelInfo) to store channel - * related data. + * related data. *

- * + * * @author Bernd Hufmann */ public class ChannelInfo extends TraceInfo implements IChannelInfo { @@ -63,9 +63,9 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo { /** * The events information of the channel. */ - private List fEvents = new ArrayList(); + private final List fEvents = new ArrayList(); + - // ------------------------------------------------------------------------ // Constructors // ------------------------------------------------------------------------ @@ -229,7 +229,7 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo { public void setState(TraceEnablement state) { fState = state; } - + /* * (non-Javadoc) * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IChannelInfo#setState(java.lang.String) @@ -243,7 +243,7 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo { fState = TraceEnablement.ENABLED; } } - + /* * (non-Javadoc) * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IChannelInfo#getEvents() @@ -260,7 +260,7 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo { @Override public void setEvents(List events) { for (Iterator iterator = events.iterator(); iterator.hasNext();) { - IEventInfo eventInfo = (IEventInfo) iterator.next(); + IEventInfo eventInfo = iterator.next(); fEvents.add(eventInfo); } } @@ -273,7 +273,7 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo { public void addEvent(IEventInfo channel) { fEvents.add(channel); } - + /* * (non-Javadoc) * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceInfo#hashCode() @@ -291,7 +291,7 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo { result = prime * result + (int) (fSubBufferSize ^ (fSubBufferSize >>> 32)); result = prime * result + (int) (fSwitchTimer ^ (fSwitchTimer >>> 32)); return result; - } + } /* * (non-Javadoc) @@ -343,7 +343,7 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo { } return true; } - + /* * (non-Javadoc) * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceInfo#toString() @@ -373,7 +373,7 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo { output.append("None"); } else { for (Iterator iterator = fEvents.iterator(); iterator.hasNext();) { - IEventInfo event = (IEventInfo) iterator.next(); + IEventInfo event = iterator.next(); output.append(event.toString()); } } diff --git a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/DomainInfo.java b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/DomainInfo.java index 31681db2c2..854f7d688f 100644 --- a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/DomainInfo.java +++ b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/DomainInfo.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.internal.lttng2.core.control.model.impl; @@ -21,9 +21,9 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo; /** *

* Implementation of the trace domain interface (IDomainInfo) to store domain - * related data. + * related data. *

- * + * * @author Bernd Hufmann */ public class DomainInfo extends TraceInfo implements IDomainInfo { @@ -34,7 +34,7 @@ public class DomainInfo extends TraceInfo implements IDomainInfo { /** * The channels information of the domain. */ - private List fChannels = new ArrayList(); + private final List fChannels = new ArrayList(); private boolean fIsKernel = false; // ------------------------------------------------------------------------ @@ -63,7 +63,7 @@ public class DomainInfo extends TraceInfo implements IDomainInfo { } fIsKernel = other.fIsKernel; } - + /* * (non-Javadoc) * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IDomainInfo#isKernel() @@ -72,7 +72,7 @@ public class DomainInfo extends TraceInfo implements IDomainInfo { public boolean isKernel() { return fIsKernel; } - + /* * (non-Javadoc) * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IDomainInfo#setIsKernel(boolean) @@ -101,7 +101,7 @@ public class DomainInfo extends TraceInfo implements IDomainInfo { @Override public void setChannels(List channels) { for (Iterator iterator = channels.iterator(); iterator.hasNext();) { - IChannelInfo channelInfo = (IChannelInfo) iterator.next(); + IChannelInfo channelInfo = iterator.next(); fChannels.add(channelInfo); } } @@ -114,7 +114,7 @@ public class DomainInfo extends TraceInfo implements IDomainInfo { public void addChannel(IChannelInfo channel) { fChannels.add(channel); } - + /* * (non-Javadoc) * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceInfo#hashCode() @@ -172,7 +172,7 @@ public class DomainInfo extends TraceInfo implements IDomainInfo { output.append("None"); } else { for (Iterator iterator = fChannels.iterator(); iterator.hasNext();) { - IChannelInfo channel = (IChannelInfo) iterator.next(); + IChannelInfo channel = iterator.next(); output.append(channel.toString()); } } @@ -181,5 +181,5 @@ public class DomainInfo extends TraceInfo implements IDomainInfo { output.append(")]"); return output.toString(); } - + } diff --git a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/SessionInfo.java b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/SessionInfo.java index 7261251ef6..0878a5b421 100644 --- a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/SessionInfo.java +++ b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/SessionInfo.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.internal.lttng2.core.control.model.impl; @@ -22,9 +22,9 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionSta /** *

* Implementation of the trace session interface (ISessionInfo) to store session - * related data. + * related data. *

- * + * * @author Bernd Hufmann */ public class SessionInfo extends TraceInfo implements ISessionInfo { @@ -36,14 +36,14 @@ public class SessionInfo extends TraceInfo implements ISessionInfo { * The trace session state. */ private TraceSessionState fState = TraceSessionState.INACTIVE; - /** + /** * The trace session path for storing traces. */ private String fSessionPath = ""; //$NON-NLS-1$ /** * The domains information of this session. */ - private List fDomains = new ArrayList(); + private final List fDomains = new ArrayList(); // ------------------------------------------------------------------------ // Constructors @@ -64,7 +64,7 @@ public class SessionInfo extends TraceInfo implements ISessionInfo { super(other); fState = other.fState; fSessionPath = other.fSessionPath; - + for (Iterator iterator = other.fDomains.iterator(); iterator.hasNext();) { IDomainInfo domain = iterator.next(); if (domain instanceof DomainInfo) { @@ -74,7 +74,7 @@ public class SessionInfo extends TraceInfo implements ISessionInfo { } } } - + // ------------------------------------------------------------------------ // Accessors // ------------------------------------------------------------------------ @@ -108,7 +108,7 @@ public class SessionInfo extends TraceInfo implements ISessionInfo { fState = TraceSessionState.ACTIVE; } } - + /* * (non-Javadoc) * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ISessionInfo#getSessionPath() @@ -143,7 +143,7 @@ public class SessionInfo extends TraceInfo implements ISessionInfo { @Override public void setDomains(List domains) { for (Iterator iterator = domains.iterator(); iterator.hasNext();) { - IDomainInfo domainInfo = (IDomainInfo) iterator.next(); + IDomainInfo domainInfo = iterator.next(); fDomains.add(domainInfo); } } @@ -159,7 +159,7 @@ public class SessionInfo extends TraceInfo implements ISessionInfo { public void addDomain(IDomainInfo domainInfo) { fDomains.add(domainInfo); } - + /* * (non-Javadoc) * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceInfo#hashCode() @@ -224,7 +224,7 @@ public class SessionInfo extends TraceInfo implements ISessionInfo { output.append(fState); output.append(",Domains="); for (Iterator iterator = fDomains.iterator(); iterator.hasNext();) { - IDomainInfo domain = (IDomainInfo) iterator.next(); + IDomainInfo domain = iterator.next(); output.append(domain.toString()); } output.append(")]"); diff --git a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/TraceInfo.java b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/TraceInfo.java index e5f1234cad..604f03264b 100644 --- a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/TraceInfo.java +++ b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/TraceInfo.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.internal.lttng2.core.control.model.impl; @@ -18,7 +18,7 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.ITraceInfo; * Implementation of the base trace information interface (ITraceInfo) to * store common data. *

- * + * * @author Bernd Hufmann */ public class TraceInfo implements ITraceInfo { @@ -52,9 +52,8 @@ public class TraceInfo implements ITraceInfo { public TraceInfo(TraceInfo other) { if (other == null) { throw new IllegalArgumentException(); - } else { - fName = String.valueOf(other.fName); } + fName = String.valueOf(other.fName); } // ------------------------------------------------------------------------ @@ -77,7 +76,7 @@ public class TraceInfo implements ITraceInfo { public void setName(String name) { fName = name; } - + /* * (non-Javadoc) * @see java.lang.Object#hashCode() @@ -114,7 +113,7 @@ public class TraceInfo implements ITraceInfo { return false; } return true; - } + } /* * (non-Javadoc) * @see java.lang.Object#toString() diff --git a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/UstProviderInfo.java b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/UstProviderInfo.java index 1f166d5514..8ac03fbb9d 100644 --- a/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/UstProviderInfo.java +++ b/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/UstProviderInfo.java @@ -1,12 +1,12 @@ /********************************************************************** * Copyright (c) 2012 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: + * + * Contributors: * Bernd Hufmann - Initial API and implementation **********************************************************************/ package org.eclipse.linuxtools.internal.lttng2.core.control.model.impl; @@ -20,10 +20,10 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.IUstProviderInf /** *

- * Implementation of the Ust Provider interface (IUstProviderInfo) to store UST - * provider related data. + * Implementation of the Ust Provider interface (IUstProviderInfo) to store UST + * provider related data. *

- * + * * @author Bernd Hufmann */ public class UstProviderInfo extends TraceInfo implements IUstProviderInfo { @@ -38,8 +38,8 @@ public class UstProviderInfo extends TraceInfo implements IUstProviderInfo { /** * List of event information. */ - private List fEvents = new ArrayList(); - + private final List fEvents = new ArrayList(); + // ------------------------------------------------------------------------ // Constructors // ------------------------------------------------------------------------ @@ -50,7 +50,7 @@ public class UstProviderInfo extends TraceInfo implements IUstProviderInfo { public UstProviderInfo(String name) { super(name); } - + /** * Copy constructor * @param other - the instance to copy @@ -67,7 +67,7 @@ public class UstProviderInfo extends TraceInfo implements IUstProviderInfo { } } } - + // ------------------------------------------------------------------------ // Accessors // ------------------------------------------------------------------------ @@ -106,7 +106,7 @@ public class UstProviderInfo extends TraceInfo implements IUstProviderInfo { @Override public void setEvents(List events) { for (Iterator iterator = events.iterator(); iterator.hasNext();) { - IBaseEventInfo eventInfo = (IBaseEventInfo) iterator.next(); + IBaseEventInfo eventInfo = iterator.next(); fEvents.add(eventInfo); } } @@ -165,7 +165,7 @@ public class UstProviderInfo extends TraceInfo implements IUstProviderInfo { } return true; } - + /* * (non-Javadoc) * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceInfo#toString() @@ -183,7 +183,7 @@ public class UstProviderInfo extends TraceInfo implements IUstProviderInfo { output.append("None"); } else { for (Iterator iterator = fEvents.iterator(); iterator.hasNext();) { - IBaseEventInfo event = (IBaseEventInfo) iterator.next(); + IBaseEventInfo event = iterator.next(); output.append(event.toString()); } } @@ -191,5 +191,5 @@ public class UstProviderInfo extends TraceInfo implements IUstProviderInfo { return output.toString(); } - + } -- 2.34.1