Refs bug 393449.
Change-Id: I84d3f62d0e1dd1b8bd1d0ad00f3347cc86df6ad2
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/10056
Tested-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
IP-Clean: Patrick Tasse <patrick.tasse@gmail.com>
/*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Francois Chouinard - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
*******************************************************************************/
package org.eclipse.linuxtools.lttng2.core.tests;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertTrue;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
/**
- * <b><u>ActivatorTest</u></b>
- * <p>
- * Test suite for the Activator class
- * <p>
+ * Test stubs for the Activator.
*/
-@SuppressWarnings("javadoc")
-public class ActivatorTest extends TestCase {
-
- // ------------------------------------------------------------------------
- // JUnit
- // ------------------------------------------------------------------------
-
- @BeforeClass
- public static void setUpBeforeClass() {
- }
-
- @AfterClass
- public static void tearDownAfterClass() {
- }
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- @Override
- public void setUp() throws Exception {
- }
-
- /**
- * @throws java.lang.Exception
- */
- @After
- @Override
- public void tearDown() throws Exception {
- }
+public class ActivatorTest {
// ------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------
/**
- * Test method for {@link org.eclipse.linuxtools.lttng2.core.Activator#Activator()}.
+ * Test method for {@link org.eclipse.linuxtools.internal.lttng2.core.Activator#Activator()}.
*/
@Test
public void testActivator() {
}
/**
- * Test method for {@link org.eclipse.linuxtools.lttng2.core.Activator#getDefault()}.
+ * Test method for {@link org.eclipse.linuxtools.internal.lttng2.core.Activator#getDefault()}.
*/
@Test
public void testGetDefault() {
}
/**
- * Test method for {@link org.eclipse.linuxtools.lttng2.core.Activator#start(org.osgi.framework.BundleContext)}.
+ * Test method for {@link org.eclipse.linuxtools.internal.lttng2.core.Activator#start(org.osgi.framework.BundleContext)}.
*/
@Test
public void testStartBundleContext() {
}
/**
- * Test method for {@link org.eclipse.linuxtools.lttng2.core.Activator#stop(org.osgi.framework.BundleContext)}.
+ * Test method for {@link org.eclipse.linuxtools.internal.lttng2.core.Activator#stop(org.osgi.framework.BundleContext)}.
*/
@Test
public void testStopBundleContext() {
/*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Francois Chouinard - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
*******************************************************************************/
package org.eclipse.linuxtools.lttng2.core.tests;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
/**
- * <b><u>AllTests</u></b>
- * <p>
+ * Run all the tests in the lttng2.core plugin.
*/
-@SuppressWarnings("javadoc")
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ ActivatorTest.class,
+ org.eclipse.linuxtools.lttng2.core.tests.control.model.impl.AllTests.class
+})
public class AllTests {
- public static Test suite() {
- TestSuite suite = new TestSuite(AllTests.class.getName());
- // $JUnit-BEGIN$
-
- // Plug-in
- suite.addTestSuite(ActivatorTest.class);
- suite.addTest(org.eclipse.linuxtools.lttng2.core.tests.control.model.impl.AllTests.suite());
-
- // $JUnit-END$
- return suite;
- }
}
/*******************************************************************************
- * Copyright (c) 2011 Ericsson
+ * Copyright (c) 2011, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
*******************************************************************************/
+
package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
-@SuppressWarnings("javadoc")
+/**
+ * Runner for the LTTng2.core unit tests
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ BaseEventInfoTest.class,
+ ChannelInfoTest.class,
+ DomainInfoTest.class,
+ EventInfoTest.class,
+ FieldInfoTest.class,
+ ProbeEventInfoTest.class,
+ SessionInfoTest.class,
+ TraceInfoTest.class,
+ UstProviderInfoTest.class
+})
public class AllTests {
- public static Test suite() {
-
- TestSuite suite = new TestSuite(AllTests.class.getName());
- //$JUnit-BEGIN$
- suite.addTestSuite(FieldInfoTest.class);
- suite.addTestSuite(BaseEventInfoTest.class);
- suite.addTestSuite(DomainInfoTest.class);
- suite.addTestSuite(EventInfoTest.class);
- suite.addTestSuite(ProbeEventInfoTest.class);
- suite.addTestSuite(ChannelInfoTest.class);
- suite.addTestSuite(SessionInfoTest.class);
- suite.addTestSuite(TraceInfoTest.class);
- suite.addTestSuite(UstProviderInfoTest.class);
- //$JUnit-END$
- return suite;
- }
}
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;
+import static org.junit.Assert.*;
+
import java.util.LinkedList;
import java.util.List;
-import junit.framework.TestCase;
-
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IFieldInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BaseEventInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.FieldInfo;
+import org.junit.Before;
+import org.junit.Test;
/**
- * The class <code>BaseEventInfoTest</code> contains test for the class <code>{@link BaseEventInfo}</code>.
+ * The class <code>BaseEventInfoTest</code> contains test for the class
+ * <code>{@link BaseEventInfo}</code>.
*/
-@SuppressWarnings({"nls", "javadoc"})
-public class BaseEventInfoTest extends TestCase {
+@SuppressWarnings("nls")
+public class BaseEventInfoTest {
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
+
private IBaseEventInfo fEventInfo1 = null;
private IBaseEventInfo fEventInfo2 = null;
// ------------------------------------------------------------------------
/**
* Perform pre-test initialization.
- *
- * @throws Exception if the initialization fails for some reason
- *
*/
- @Override
- public void setUp() throws Exception {
- super.setUp();
+ @Before
+ public void setUp() {
ModelImplFactory factory = new ModelImplFactory();
fEventInfo1 = factory.getBaseEventInfo1();
fEventInfo2 = factory.getBaseEventInfo2();
}
- /**
- * Perform post-test clean-up.
- *
- * @throws Exception if the clean-up fails for some reason
- *
- */
- @Override
- public void tearDown() throws Exception {
- }
-
// ------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------
/**
* Run the BaseEventInfo() constructor test.
- *
*/
+ @Test
public void testBaseEventInfo() {
BaseEventInfo fixture = new BaseEventInfo("event");
assertNotNull(fixture);
/**
* Test Copy Constructor
*/
+ @Test
public void testEventInfoCopy() {
BaseEventInfo info = new BaseEventInfo((BaseEventInfo)fEventInfo1);
/**
* Test Copy Constructor
*/
+ @Test
public void testEventCopy2() {
try {
BaseEventInfo info = null;
/**
* Run the TraceEventType getEventType() method test.
- *
- * @throws Exception
- *
*/
+ @Test
public void testGetEventType_1() {
BaseEventInfo fixture = new BaseEventInfo("event");
fixture.setEventType("unknown");
/**
* Run the void setEventType(TraceEventType) method test.
- *
*/
+ @Test
public void testSetEventType_2() {
BaseEventInfo fixture = new BaseEventInfo("event");
fixture.setEventType(TraceEventType.TRACEPOINT);
/**
* Run the void setLogLevel(TraceLogLevel) method test.
* Run the TraceLogLevel getLogLevel() method test
- *
*/
+ @Test
public void testSetLogLevel1() {
BaseEventInfo fixture = new BaseEventInfo("event");
fixture.setEventType(TraceEventType.TRACEPOINT);
/**
* Run the void setLogLevel(String) method test.
* Run the TraceLogLevel getLogLevel() method test
- *
*/
+ @Test
public void testSetLogLevel2() {
BaseEventInfo fixture = new BaseEventInfo("event");
fixture.setEventType(TraceEventType.TRACEPOINT);
/**
* test filter expression
*/
+ @Test
public void testSetFields() {
BaseEventInfo info = new BaseEventInfo((BaseEventInfo)fEventInfo2);
info.setFilterExpression("stringfield==test");
/**
* test add field
*/
+ @Test
public void testAddField() {
BaseEventInfo info = new BaseEventInfo((BaseEventInfo)fEventInfo2);
/**
* test set fields
*/
+ @Test
public void testFields() {
BaseEventInfo info = new BaseEventInfo((BaseEventInfo)fEventInfo2);
/**
* Run the String toString() method test.
- *
*/
+ @Test
public void testToString_1() {
BaseEventInfo fixture = new BaseEventInfo("event");
fixture.setName("testName");
// equals
// ------------------------------------------------------------------------
+ /**
+ * Test the .equals() method.
+ */
+ @Test
public void testEqualsReflexivity() {
assertTrue("equals", fEventInfo1.equals(fEventInfo1));
assertTrue("equals", fEventInfo2.equals(fEventInfo2));
assertTrue("equals", !fEventInfo2.equals(fEventInfo1));
}
+ /**
+ * Test the .equals() method.
+ */
+ @Test
public void testEqualsSymmetry() {
BaseEventInfo info1 = new BaseEventInfo((BaseEventInfo)fEventInfo1);
BaseEventInfo info2 = new BaseEventInfo((BaseEventInfo)fEventInfo2);
assertTrue("equals", fEventInfo2.equals(info2));
}
+ /**
+ * Test the .equals() method.
+ */
+ @Test
public void testEqualsTransivity() {
BaseEventInfo info1 = new BaseEventInfo((BaseEventInfo)fEventInfo1);
BaseEventInfo info2 = new BaseEventInfo((BaseEventInfo)fEventInfo1);
assertTrue("equals", info1.equals(info3));
}
+ /**
+ * Test the .equals() method.
+ */
+ @Test
public void testEqualsNull() {
assertTrue("equals", !fEventInfo1.equals(null));
assertTrue("equals", !fEventInfo2.equals(null));
// hashCode
// ------------------------------------------------------------------------
+ /**
+ * Test the hashCode() method.
+ */
+ @Test
public void testHashCode() {
BaseEventInfo info1 = new BaseEventInfo((BaseEventInfo)fEventInfo1);
BaseEventInfo info2 = new BaseEventInfo((BaseEventInfo)fEventInfo2);
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;
+import static org.junit.Assert.*;
+
import java.util.LinkedList;
import java.util.List;
-import junit.framework.TestCase;
-
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IEventInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.EventInfo;
+import org.junit.Before;
+import org.junit.Test;
/**
- * The class <code>ChannelInfoTest</code> contains tests for the class <code>{@link ChannelInfo}</code>.
- *
+ * The class <code>ChannelInfoTest</code> contains tests for the class
+ * <code>{@link ChannelInfo}</code>.
*/
-@SuppressWarnings({"nls", "javadoc"})
-public class ChannelInfoTest extends TestCase {
+@SuppressWarnings("nls")
+public class ChannelInfoTest {
+
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
+
private IChannelInfo fChannelInfo1 = null;
private IChannelInfo fChannelInfo2 = null;
/**
* Perform pre-test initialization.
- *
- * @throws Exception
- * if the initialization fails for some reason
- *
*/
- @Override
+ @Before
public void setUp() {
ModelImplFactory factory = new ModelImplFactory();
fChannelInfo1 = factory.getChannel1();
fChannelInfo2 = factory.getChannel2();
}
- /**
- * Perform post-test clean-up.
- *
- * @throws Exception
- * if the clean-up fails for some reason
- *
- */
- @Override
- public void tearDown() {
- }
-
// ------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------
/**
* Run the ChannelInfo() constructor test.
- *
*/
+ @Test
public void testChannelInfo() {
ChannelInfo result = new ChannelInfo("test");
assertNotNull(result);
assertEquals(0, result.getSwitchTimer());
}
+ /**
+ * Test copy constructor.
+ */
+ @Test
public void testChannelInfoCopy() {
ChannelInfo channelInfo = new ChannelInfo((ChannelInfo)fChannelInfo1);
}
}
+ /**
+ * Test copy constructor with a null value.
+ */
+ @Test
public void testChannelCopy2() {
try {
ChannelInfo channel = null;
/**
* Run the IEventInfo[] getEvents() method test.
- *
*/
+ @Test
public void testAddAndGetEvents_1() {
ChannelInfo fixture = new ChannelInfo("test");
fixture.setSwitchTimer(1L);
/**
* Run the long getNumberOfSubBuffers() method test.
- *
*/
+ @Test
public void testGetAndSetters() {
ChannelInfo fixture = new ChannelInfo("test");
fixture.setSwitchTimer(2L);
/**
* Run the void setEvents(List<IEventInfo>) method test.
- *
*/
+ @Test
public void testSetEvents_1() {
ChannelInfo fixture = new ChannelInfo("test");
fixture.setSwitchTimer(1L);
}
}
+ /**
+ * Run the String toString() method test.
+ */
+ @Test
public void testToString_1() {
ChannelInfo fixture = new ChannelInfo("channel");
fixture.setSwitchTimer(1L);
}
/**
- * Run the String toString() method test.
- *
+ * Run another String toString() method test.
*/
+ @Test
public void testToString_2() {
String result = fChannelInfo1.toString();
// equals
// ------------------------------------------------------------------------
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsReflexivity() {
assertTrue("equals", fChannelInfo1.equals(fChannelInfo1));
assertTrue("equals", fChannelInfo2.equals(fChannelInfo2));
assertTrue("equals", !fChannelInfo2.equals(fChannelInfo1));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsSymmetry() {
ChannelInfo event1 = new ChannelInfo((ChannelInfo)fChannelInfo1);
ChannelInfo event2 = new ChannelInfo((ChannelInfo)fChannelInfo2);
assertTrue("equals", fChannelInfo2.equals(event2));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsTransivity() {
ChannelInfo channel1 = new ChannelInfo((ChannelInfo)fChannelInfo1);
ChannelInfo channel2 = new ChannelInfo((ChannelInfo)fChannelInfo1);
assertTrue("equals", channel1.equals(channel3));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsNull() {
assertTrue("equals", !fChannelInfo1.equals(null));
assertTrue("equals", !fChannelInfo2.equals(null));
// hashCode
// ------------------------------------------------------------------------
+ /**
+ * Run the hashCode() method test.
+ */
+ @Test
public void testHashCode() {
ChannelInfo channel1 = new ChannelInfo((ChannelInfo)fChannelInfo1);
ChannelInfo channel2 = new ChannelInfo((ChannelInfo)fChannelInfo2);
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;
+import static org.junit.Assert.*;
+
import java.util.LinkedList;
import java.util.List;
-import junit.framework.TestCase;
-
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.DomainInfo;
+import org.junit.Before;
+import org.junit.Test;
/**
- * The class <code>ChannelInfoTest</code> contains tests for the class <code>{@link DomainInfo}</code>.
- *
+ * The class <code>ChannelInfoTest</code> contains tests for the class
+ * <code>{@link DomainInfo}</code>.
*/
-@SuppressWarnings({"nls", "javadoc"})
-public class DomainInfoTest extends TestCase {
+@SuppressWarnings("nls")
+public class DomainInfoTest {
+
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
+
private IDomainInfo fDomainInfo1 = null;
private IDomainInfo fDomainInfo2 = null;
private IChannelInfo fChannelInfo1 = null;
/**
* Perform pre-test initialization.
- *
- * @throws Exception
- * if the initialization fails for some reason
- *
*/
- @Override
+ @Before
public void setUp() {
// Get test instances from the factory
ModelImplFactory factory = new ModelImplFactory();
fDomainInfo2 = factory.getDomainInfo2();
}
- /**
- * Perform post-test clean-up.
- *
- * @throws Exception
- * if the clean-up fails for some reason
- *
- */
- @Override
- public void tearDown() {
- }
-
// ------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------
/**
* Run the ChannelInfo() constructor test.
- *
*/
+ @Test
public void testDomainInfo() {
DomainInfo result = new DomainInfo("test");
assertNotNull(result);
assertEquals(0, result.getChannels().length);
}
+ /**
+ * Test the copy constructor.
+ */
+ @Test
public void testDomainInfoCopy() {
DomainInfo channelInfo = new DomainInfo((DomainInfo)fDomainInfo1);
IChannelInfo[] orignalEvents = fDomainInfo1.getChannels();
}
}
+ /**
+ * Test the copy constructor.
+ */
+ @Test
public void testDomainlCopy2() {
try {
DomainInfo domain = null;
/**
* Run the long getNumberOfSubBuffers() method test.
- *
*/
+ @Test
public void testGetAndSetters() {
// Note that addChannel() has been executed in setUp()
assertEquals(fChannelInfo2, result[1]);
}
+ /**
+ * Run the String toString() method test.
+ */
+ @Test
public void testToString_1() {
DomainInfo fixture = new DomainInfo("domain");
/**
* Run the String toString() method test.
- *
*/
+ @Test
public void testToString_2() {
String result = fDomainInfo1.toString();
// equals
// ------------------------------------------------------------------------
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsReflexivity() {
assertTrue("equals", fDomainInfo1.equals(fDomainInfo1));
assertTrue("equals", fDomainInfo2.equals(fDomainInfo2));
assertTrue("equals", !fDomainInfo2.equals(fDomainInfo1));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsSymmetry() {
DomainInfo event1 = new DomainInfo((DomainInfo)fDomainInfo1);
DomainInfo event2 = new DomainInfo((DomainInfo)fDomainInfo2);
assertTrue("equals", fDomainInfo2.equals(event2));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsTransivity() {
DomainInfo channel1 = new DomainInfo((DomainInfo)fDomainInfo1);
DomainInfo channel2 = new DomainInfo((DomainInfo)fDomainInfo1);
assertTrue("equals", channel1.equals(channel3));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsNull() {
assertTrue("equals", !fDomainInfo1.equals(null));
assertTrue("equals", !fDomainInfo2.equals(null));
// hashCode
// ------------------------------------------------------------------------
+ /**
+ * Run the hashCode() method test.
+ */
+ @Test
public void testHashCode() {
DomainInfo channel1 = new DomainInfo((DomainInfo)fDomainInfo1);
DomainInfo channel2 = new DomainInfo((DomainInfo)fDomainInfo2);
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IEventInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.EventInfo;
+import org.junit.Before;
+import org.junit.Test;
/**
- * The class <code>BaseEventInfoTest</code> contains test for the class <code>{@link BaseEventInfo}</code>.
+ * The class <code>EventInfoTest</code> contains test for the class
+ * <code>{@link EventInfo}</code>.
*/
-@SuppressWarnings({"nls", "javadoc"})
-public class EventInfoTest extends TestCase {
+@SuppressWarnings("nls")
+public class EventInfoTest {
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
+
private IEventInfo fEventInfo1 = null;
private IEventInfo fEventInfo2 = null;
// ------------------------------------------------------------------------
// Housekeeping
// ------------------------------------------------------------------------
+
/**
* Perform pre-test initialization.
- *
- * @throws Exception if the initialization fails for some reason
- *
*/
- @Override
- public void setUp() throws Exception {
+ @Before
+ public void setUp() {
ModelImplFactory factory = new ModelImplFactory();
fEventInfo1 = factory.getEventInfo1();
fEventInfo2 = factory.getEventInfo2();
}
- /**
- * Perform post-test clean-up.
- *
- * @throws Exception if the clean-up fails for some reason
- *
- */
- @Override
- public void tearDown() throws Exception {
- }
-
// ------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------
/**
* Run the BaseEventInfo() constructor test.
- *
*/
+ @Test
public void testBaseEventInfo() {
EventInfo fixture = new EventInfo("event");
assertNotNull(fixture);
/**
* Test Copy Constructor
*/
+ @Test
public void testEventInfoCopy() {
EventInfo info = new EventInfo((EventInfo)fEventInfo1);
/**
* Test Copy Constructor
*/
+ @Test
public void testEventCopy2() {
try {
EventInfo info = null;
/**
* Getter/Setter tests
*/
+ @Test
public void testGetAndSetter() {
EventInfo fixture = new EventInfo("event");
/**
* Run the String toString() method test.
*/
+ @Test
public void testToString_1() {
EventInfo fixture = new EventInfo("event");
fixture.setName("testName");
// ------------------------------------------------------------------------
// equals
// ------------------------------------------------------------------------
+
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsReflexivity() {
assertTrue("equals", fEventInfo1.equals(fEventInfo1));
assertTrue("equals", fEventInfo2.equals(fEventInfo2));
assertTrue("equals", !fEventInfo2.equals(fEventInfo1));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsSymmetry() {
EventInfo info1 = new EventInfo((EventInfo)fEventInfo1);
EventInfo info2 = new EventInfo((EventInfo)fEventInfo2);
assertTrue("equals", fEventInfo2.equals(info2));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsTransivity() {
EventInfo info1 = new EventInfo((EventInfo)fEventInfo1);
EventInfo info2 = new EventInfo((EventInfo)fEventInfo1);
assertTrue("equals", info1.equals(info3));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsNull() {
assertTrue("equals", !fEventInfo1.equals(null));
assertTrue("equals", !fEventInfo2.equals(null));
// hashCode
// ------------------------------------------------------------------------
+ /**
+ * Run the hashCode() method test.
+ */
+ @Test
public void testHashCode() {
EventInfo info1 = new EventInfo((EventInfo)fEventInfo1);
EventInfo info2 = new EventInfo((EventInfo)fEventInfo2);
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;
-import junit.framework.TestCase;
+import static org.junit.Assert.*;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IFieldInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.FieldInfo;
+import org.junit.Before;
+import org.junit.Test;
/**
- * The class <code>FieldInfoTest</code> contains test for the class <code>{@link FieldInfo}</code>.
+ * The class <code>FieldInfoTest</code> contains test for the class
+ * <code>{@link FieldInfo}</code>.
*/
-@SuppressWarnings({"nls", "javadoc"})
-public class FieldInfoTest extends TestCase {
+@SuppressWarnings("nls")
+public class FieldInfoTest {
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
+
private IFieldInfo fFieldInfo1 = null;
private IFieldInfo fFieldInfo2 = null;
// ------------------------------------------------------------------------
// Housekeeping
// ------------------------------------------------------------------------
+
/**
* Perform pre-test initialization.
- *
- * @throws Exception if the initialization fails for some reason
- *
*/
- @Override
- public void setUp() throws Exception {
- super.setUp();
+ @Before
+ public void setUp() {
ModelImplFactory factory = new ModelImplFactory();
fFieldInfo1 = factory.getFieldInfo1();
fFieldInfo2 = factory.getFieldInfo2();
}
- /**
- * Perform post-test clean-up.
- *
- * @throws Exception if the clean-up fails for some reason
- *
- */
- @Override
- public void tearDown() throws Exception {
- }
-
// ------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------
/**
* Run the BaseEventInfo() constructor test.
- *
*/
+ @Test
public void testFiledInfo() {
FieldInfo fixture = new FieldInfo("field");
assertNotNull(fixture);
/**
* Test Copy Constructor
*/
+ @Test
public void testEventInfoCopy() {
FieldInfo info = new FieldInfo((FieldInfo)fFieldInfo1);
/**
* Test Copy Constructor
*/
+ @Test
public void testEventCopy2() {
try {
FieldInfo info = null;
/**
* Run the TraceEventType getEventType() method test.
- *
- * @throws Exception
- *
*/
+ @Test
public void testSetFieldType() {
FieldInfo info = new FieldInfo((FieldInfo)fFieldInfo1);
assertEquals("string", info.getFieldType());
}
+ /**
+ * Run the toString() method test.
+ */
+ @Test
public void testToString() {
String result = fFieldInfo1.toString();
// equals
// ------------------------------------------------------------------------
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsReflexivity() {
assertTrue("equals", fFieldInfo1.equals(fFieldInfo1));
assertTrue("equals", fFieldInfo2.equals(fFieldInfo2));
assertTrue("equals", !fFieldInfo2.equals(fFieldInfo1));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsSymmetry() {
FieldInfo info1 = new FieldInfo((FieldInfo)fFieldInfo1);
FieldInfo info2 = new FieldInfo((FieldInfo)fFieldInfo2);
assertTrue("equals", fFieldInfo2.equals(info2));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsTransivity() {
FieldInfo info1 = new FieldInfo((FieldInfo)fFieldInfo1);
FieldInfo info2 = new FieldInfo((FieldInfo)fFieldInfo1);
assertTrue("equals", info1.equals(info3));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsNull() {
assertTrue("equals", !fFieldInfo1.equals(null));
assertTrue("equals", !fFieldInfo2.equals(null));
// hashCode
// ------------------------------------------------------------------------
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testHashCode() {
FieldInfo info1 = new FieldInfo((FieldInfo)fFieldInfo1);
FieldInfo info2 = new FieldInfo((FieldInfo)fFieldInfo2);
* Contributors:
* Bernd Hufmann - Initial API and implementation
*******************************************************************************/
+
package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;
-import junit.framework.TestCase;
+import static org.junit.Assert.*;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IProbeEventInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ProbeEventInfo;
+import org.junit.Before;
+import org.junit.Test;
/**
- * The class <code>BaseEventInfoTest</code> contains test for the class <code>{@link BaseEventInfo}</code>.
+ * The class <code>ProbEventInfoTest</code> contains test for the class
+ * <code>{@link ProbeEventInfo}</code>.
*/
-@SuppressWarnings({"nls", "javadoc"})
-public class ProbeEventInfoTest extends TestCase {
+@SuppressWarnings("nls")
+public class ProbeEventInfoTest {
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
+
private IProbeEventInfo fEventInfo1 = null;
private IProbeEventInfo fEventInfo2 = null;
// ------------------------------------------------------------------------
/**
* Perform pre-test initialization.
- *
- * @throws Exception if the initialization fails for some reason
- *
*/
- @Override
- public void setUp() throws Exception {
+ @Before
+ public void setUp() {
ModelImplFactory factory = new ModelImplFactory();
fEventInfo1 = factory.getProbeEventInfo1();
fEventInfo2 = factory.getProbeEventInfo2();
}
- /**
- * Perform post-test clean-up.
- *
- * @throws Exception if the clean-up fails for some reason
- *
- */
- @Override
- public void tearDown() throws Exception {
- }
-
// ------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------
/**
* Run the BaseEventInfo() constructor test.
- *
*/
+ @Test
public void testBaseEventInfo() {
ProbeEventInfo fixture = new ProbeEventInfo("event");
assertNotNull(fixture);
/**
* Test Copy Constructor
*/
+ @Test
public void testEventInfoCopy() {
ProbeEventInfo info = new ProbeEventInfo((ProbeEventInfo)fEventInfo1);
/**
* Test Copy Constructor
*/
+ @Test
public void testEventCopy2() {
try {
ProbeEventInfo info = null;
/**
* Getter/Setter tests
*/
+ @Test
public void testGetAndSetter() {
ProbeEventInfo fixture = new ProbeEventInfo("event");
/**
* Run the String toString() method test.
*/
+ @Test
public void testToString_1() {
assertEquals("[ProbeEventInfo([EventInfo([BaseEventInfo([TraceInfo(Name=probeEvent1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED)],fAddress=0xc1231234)]", fEventInfo1.toString());
assertEquals("[ProbeEventInfo([EventInfo([BaseEventInfo([TraceInfo(Name=probeEvent2)],type=UNKNOWN,level=TRACE_DEBUG)],State=DISABLED)],fOffset=0x100,fSymbol=init_post)]", fEventInfo2.toString());
// ------------------------------------------------------------------------
// equals
// ------------------------------------------------------------------------
+
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsReflexivity() {
assertTrue("equals", fEventInfo1.equals(fEventInfo1));
assertTrue("equals", fEventInfo2.equals(fEventInfo2));
assertTrue("equals", !fEventInfo2.equals(fEventInfo1));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsSymmetry() {
ProbeEventInfo info1 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1);
ProbeEventInfo info2 = new ProbeEventInfo((ProbeEventInfo)fEventInfo2);
assertTrue("equals", fEventInfo2.equals(info2));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsTransivity() {
ProbeEventInfo info1 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1);
ProbeEventInfo info2 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1);
assertTrue("equals", info1.equals(info3));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsNull() {
assertTrue("equals", !fEventInfo1.equals(null));
assertTrue("equals", !fEventInfo2.equals(null));
// hashCode
// ------------------------------------------------------------------------
+ /**
+ * Run the hashCode() method test.
+ */
+ @Test
public void testHashCode() {
ProbeEventInfo info1 = new ProbeEventInfo((ProbeEventInfo)fEventInfo1);
ProbeEventInfo info2 = new ProbeEventInfo((ProbeEventInfo)fEventInfo2);
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;
+import static org.junit.Assert.*;
+
import java.util.LinkedList;
import java.util.List;
-import junit.framework.TestCase;
-
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IDomainInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.SessionInfo;
+import org.junit.Before;
+import org.junit.Test;
/**
- * The class <code>ChannelInfoTest</code> contains tests for the class <code>{@link SessionInfo}</code>.
- *
+ * The class <code>ChannelInfoTest</code> contains tests for the class
+ * <code>{@link SessionInfo}</code>.
*/
-@SuppressWarnings({"nls", "javadoc"})
-public class SessionInfoTest extends TestCase {
+@SuppressWarnings("nls")
+public class SessionInfoTest {
+
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
+
private ISessionInfo fSessionInfo1 = null;
private ISessionInfo fSessionInfo2 = null;
/**
* Perform pre-test initialization.
- *
- * @throws Exception
- * if the initialization fails for some reason
- *
*/
- @Override
+ @Before
public void setUp() {
ModelImplFactory factory = new ModelImplFactory();
fSessionInfo1 = factory.getSessionInfo1();
fDomainInfo2 = factory.getDomainInfo2();
}
- /**
- * Perform post-test clean-up.
- *
- * @throws Exception
- * if the clean-up fails for some reason
- *
- */
- @Override
- public void tearDown() {
- }
-
// ------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------
/**
* Run the ChannelInfo() constructor test.
- *
*/
+ @Test
public void testSessionInfo() {
ISessionInfo result = new SessionInfo("test");
assertNotNull(result);
assertEquals(0, result.getDomains().length);
}
+ /**
+ * Test copy constructor.
+ */
+ @Test
public void testSessionInfoCopy() {
SessionInfo sessionInfo = new SessionInfo((SessionInfo)fSessionInfo1);
}
}
+ /**
+ * Test copy constructor.
+ */
+ @Test
public void testSessionCopy2() {
try {
SessionInfo session = null;
/**
* Run the long getNumberOfSubBuffers() method test.
- *
*/
+ @Test
public void testGetAndSetters() {
// Note that addDomain() has been executed in setUp()
assertEquals(0, state.ordinal());
}
+ /**
+ * Run the String toString() method test.
+ */
+ @Test
public void testToString_1() {
ISessionInfo fixture = new SessionInfo("sessionName");
/**
* Run the String toString() method test.
- *
*/
+ @Test
public void testToString_2() {
String result = fSessionInfo1.toString();
// equals
// ------------------------------------------------------------------------
+ /**
+ * Run the {@link SessionInfo#equals} method test.
+ */
+ @Test
public void testEqualsReflexivity() {
assertTrue("equals", fSessionInfo1.equals(fSessionInfo1));
assertTrue("equals", fSessionInfo2.equals(fSessionInfo2));
assertTrue("equals", !fSessionInfo2.equals(fSessionInfo1));
}
+ /**
+ * Run the {@link SessionInfo#equals} method test.
+ */
+ @Test
public void testEqualsSymmetry() {
SessionInfo event1 = new SessionInfo((SessionInfo)fSessionInfo1);
SessionInfo event2 = new SessionInfo((SessionInfo)fSessionInfo2);
assertTrue("equals", fSessionInfo2.equals(event2));
}
+ /**
+ * Run the {@link SessionInfo#equals} method test.
+ */
+ @Test
public void testEqualsTransivity() {
SessionInfo channel1 = new SessionInfo((SessionInfo)fSessionInfo1);
SessionInfo channel2 = new SessionInfo((SessionInfo)fSessionInfo1);
assertTrue("equals", channel1.equals(channel3));
}
+ /**
+ * Run the {@link SessionInfo#equals} method test.
+ */
+ @Test
public void testEqualsNull() {
assertTrue("equals", !fSessionInfo1.equals(null));
assertTrue("equals", !fSessionInfo2.equals(null));
// hashCode
// ------------------------------------------------------------------------
+ /**
+ * Run the {@link SessionInfo#hashCode} method test.
+ */
+ @Test
public void testHashCode() {
SessionInfo channel1 = new SessionInfo((SessionInfo)fSessionInfo1);
SessionInfo channel2 = new SessionInfo((SessionInfo)fSessionInfo2);
assertTrue("hashCode", fSessionInfo1.hashCode() != channel2.hashCode());
assertTrue("hashCode", fSessionInfo2.hashCode() != channel1.hashCode());
- }}
\ No newline at end of file
+ }
+}
\ No newline at end of file
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;
-import junit.framework.TestCase;
+import static org.junit.Assert.*;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.ITraceInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.TraceInfo;
+import org.junit.Before;
+import org.junit.Test;
/**
- * The class <code>TraceInfoTest</code> contains test for the class <code>{@link TraceInfo}</code>.
+ * The class <code>TraceInfoTest</code> contains test for the class
+ * <code>{@link TraceInfo}</code>.
*/
-@SuppressWarnings({"nls", "javadoc"})
-public class TraceInfoTest extends TestCase {
+@SuppressWarnings("nls")
+public class TraceInfoTest {
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
+
private ITraceInfo fTraceInfo1 = null;
private ITraceInfo fTraceInfo2 = null;
// ------------------------------------------------------------------------
// Housekeeping
// ------------------------------------------------------------------------
+
/**
* Perform pre-test initialization.
- *
- * @throws Exception if the initialization fails for some reason
- *
*/
- @Override
- public void setUp() throws Exception {
+ @Before
+ public void setUp() {
fTraceInfo1 = new TraceInfo("event1");
fTraceInfo2 = new TraceInfo("event2");
}
- /**
- * Perform post-test clean-up.
- *
- * @throws Exception if the clean-up fails for some reason
- *
- */
- @Override
- public void tearDown() throws Exception {
- }
-
// ------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------
/**
* Run the BaseEventInfo() constructor test.
- *
*/
+ @Test
public void testTraceInfo() {
TraceInfo fixture = new TraceInfo("event");
assertNotNull(fixture);
/**
* Test Copy Constructor
*/
+ @Test
public void testTraceInfo2() {
try {
String name = null;
/**
* Test Copy Constructor
*/
+ @Test
public void testTraceInfoCopy() {
TraceInfo info = new TraceInfo((TraceInfo)fTraceInfo1);
/**
* Test Copy Constructor
*/
+ @Test
public void testTraceCopy2() {
try {
TraceInfo info = null;
/**
* Run the void setEventType(String) method test.
- *
*/
+ @Test
public void testSetName() {
TraceInfo fixture = new TraceInfo("event");
fixture.setName("newName");
/**
* Run the String toString() method test.
- *
*/
+ @Test
public void testToString_1() {
String result = fTraceInfo1.toString();
// equals
// ------------------------------------------------------------------------
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsReflexivity() {
assertTrue("equals", fTraceInfo1.equals(fTraceInfo1));
assertTrue("equals", fTraceInfo2.equals(fTraceInfo2));
assertTrue("equals", !fTraceInfo2.equals(fTraceInfo1));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsSymmetry() {
TraceInfo info1 = new TraceInfo((TraceInfo)fTraceInfo1);
TraceInfo info2 = new TraceInfo((TraceInfo)fTraceInfo2);
assertTrue("equals", info2.equals(fTraceInfo2));
assertTrue("equals", fTraceInfo2.equals(info2));
}
-
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsTransivity() {
TraceInfo info1 = new TraceInfo((TraceInfo)fTraceInfo1);
TraceInfo info2 = new TraceInfo((TraceInfo)fTraceInfo1);
assertTrue("equals", info2.equals(info3));
assertTrue("equals", info1.equals(info3));
}
-
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsNull() {
assertTrue("equals", !fTraceInfo1.equals(null));
assertTrue("equals", !fTraceInfo2.equals(null));
// hashCode
// ------------------------------------------------------------------------
+ /**
+ * Run the hashCode() method test.
+ */
+ @Test
public void testHashCode() {
TraceInfo info1 = new TraceInfo((TraceInfo)fTraceInfo1);
TraceInfo info2 = new TraceInfo((TraceInfo)fTraceInfo2);
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.core.tests.control.model.impl;
+import static org.junit.Assert.*;
+
import java.util.LinkedList;
import java.util.List;
-import junit.framework.TestCase;
-
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IUstProviderInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BaseEventInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.UstProviderInfo;
+import org.junit.Before;
+import org.junit.Test;
/**
- * The class <code>ChannelInfoTest</code> contains tests for the class <code>{@link UstProviderInfo}</code>.
- *
+ * The class <code>ChannelInfoTest</code> contains tests for the class
+ * <code>{@link UstProviderInfo}</code>.
*/
-@SuppressWarnings({"nls", "javadoc"})
-public class UstProviderInfoTest extends TestCase {
+@SuppressWarnings("nls")
+public class UstProviderInfoTest {
+
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
+
private IUstProviderInfo fUstProviderInfo1 = null;
private IUstProviderInfo fUstProviderInfo2 = null;
/**
* Perform pre-test initialization.
- *
- * @throws Exception
- * if the initialization fails for some reason
- *
*/
- @Override
+ @Before
public void setUp() {
ModelImplFactory factory = new ModelImplFactory();
fUstProviderInfo1 = factory.getUstProviderInfo1();
fEventInfo2 = factory.getBaseEventInfo2();
}
- /**
- * Perform post-test clean-up.
- *
- * @throws Exception
- * if the clean-up fails for some reason
- *
- */
- @Override
- public void tearDown() {
- }
-
// ------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------
/**
* Run the UstProviderInfo() constructor test.
- *
*/
+ @Test
public void testUstProviderInfo() {
IUstProviderInfo result = new UstProviderInfo("test");
assertNotNull(result);
assertEquals(0, result.getEvents().length);
}
+ /**
+ * Test the copy constructor.
+ */
+ @Test
public void testUstProviderInfoCopy() {
IUstProviderInfo providerInf = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1);
}
}
+ /**
+ * Test the copy constructor.
+ */
+ @Test
public void testUstProviderCopy2() {
try {
UstProviderInfo providerInfo = null;
/**
* Run the IEventInfo[] getEvents() method test.
- *
*/
+ @Test
public void testGetAndSetters() {
IUstProviderInfo fixture = new UstProviderInfo("test");
fixture.setPid(2468);
/**
* Run the void setEvents(List<IBaseEventInfo>) method test.
- *
*/
+ @Test
public void testSetEvents_1() {
UstProviderInfo fixture = new UstProviderInfo("test");
fixture.setPid(2468);
}
}
+ /**
+ * Run the String toString() method test.
+ */
+ @Test
public void testToString_1() {
UstProviderInfo fixture = new UstProviderInfo("test");
fixture.setPid(2468);
/**
* Run the String toString() method test.
- *
*/
+ @Test
public void testToString_2() {
String result = fUstProviderInfo2.toString();
assertEquals("[EventInfo([TraceInfo(Name=myUST2)],PID=2345,Events=[BaseEventInfo([TraceInfo(Name=event1)]," +
- "type=UNKNOWN,level=TRACE_DEBUG,Fields=[FieldInfo([TraceInfo(Name=intfield)],type=int[FieldInfo" +
- "([TraceInfo(Name=stringfield)],type=string,Filter=intField==10)][BaseEventInfo([TraceInfo(Name=event2)]," +
- "type=TRACEPOINT,level=TRACE_DEBUG)])]", result);
+ "type=UNKNOWN,level=TRACE_DEBUG,Fields=[FieldInfo([TraceInfo(Name=intfield)],type=int[FieldInfo" +
+ "([TraceInfo(Name=stringfield)],type=string,Filter=intField==10)][BaseEventInfo([TraceInfo(Name=event2)]," +
+ "type=TRACEPOINT,level=TRACE_DEBUG)])]", result);
}
// ------------------------------------------------------------------------
// equals
// ------------------------------------------------------------------------
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsReflexivity() {
assertTrue("equals", fUstProviderInfo1.equals(fUstProviderInfo1));
assertTrue("equals", fUstProviderInfo2.equals(fUstProviderInfo2));
assertTrue("equals", !fUstProviderInfo2.equals(fUstProviderInfo1));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsSymmetry() {
UstProviderInfo event1 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1);
UstProviderInfo event2 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo2);
assertTrue("equals", fUstProviderInfo2.equals(event2));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsTransivity() {
UstProviderInfo UstProvider1 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1);
UstProviderInfo UstProvider2 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1);
assertTrue("equals", UstProvider1.equals(UstProvider3));
}
+ /**
+ * Run the equals() method test.
+ */
+ @Test
public void testEqualsNull() {
assertTrue("equals", !fUstProviderInfo1.equals(null));
assertTrue("equals", !fUstProviderInfo2.equals(null));
// hashCode
// ------------------------------------------------------------------------
+ /**
+ * Run the hashCode() method test.
+ */
+ @Test
public void testHashCode() {
UstProviderInfo UstProvider1 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo1);
UstProviderInfo UstProvider2 = new UstProviderInfo((UstProviderInfo)fUstProviderInfo2);
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.core.runtime
-Export-Package: org.eclipse.linuxtools.internal.lttng2.core;x-internal:=true,
+Export-Package: org.eclipse.linuxtools.internal.lttng2.core;x-friends:="org.eclipse.linuxtools.lttng2.core.tests",
org.eclipse.linuxtools.internal.lttng2.core.control.model;x-friends:="org.eclipse.linuxtools.lttng2.ui",
org.eclipse.linuxtools.internal.lttng2.core.control.model.impl;x-friends:="org.eclipse.linuxtools.lttng2.ui"
import org.junit.runners.Suite;
/**
- * <b><u>AllTests</u></b>
- * <p>
+ * Runner for the lttng2.kernel unit tests.
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateInput;
import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
import org.eclipse.linuxtools.tmf.core.statesystem.IStateChangeInput;
-import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* Tests for the LTTng 2.0 kernel state provider
*
- * @author alexmont
- *
+ * @author Alexandre Montplaisir
*/
-@SuppressWarnings("javadoc")
public class CtfKernelStateInputTest {
static IStateChangeInput input;
+ /**
+ * Set-up.
+ *
+ * @throws TmfTraceException
+ * If we can't find the test traces
+ */
@BeforeClass
public static void initialize() throws TmfTraceException {
input = new CtfKernelStateInput(CtfTestFiles.getTestTrace());
}
- @AfterClass
- public static void cleanup() {
- //
- }
-
+ /**
+ * Test loading the state provider.
+ */
@Test
public void testOpening() {
long testStartTime;
assertEquals(testStartTime, CtfTestFiles.startTime);
}
- //FIXME re-enable once we offer history-less state systems again
-// @Test
-// public void testRunning() {
-// StateSystem ss = new StateSystem();
-// input.assignTargetStateSystem(ss);
-// input.run();
-// }
-
}
/*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
import org.junit.runners.Suite;
/**
- * The class <code>TestAll</code> builds a suite that can be used to run all of
- * the tests within its package as well as within any subpackages of its
- * package.
- *
- * @author ematkho
- * @version $Revision: 1.0 $
+ * Runner for the LTTng kernel state system tests.
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
package org.eclipse.linuxtools.lttng2.kernel.ui.tests;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertTrue;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
/**
- * <b><u>ActivatorTest</u></b>
- * <p>
* Test suite for the Activator class
- * <p>
*/
-@SuppressWarnings("javadoc")
-public class ActivatorTest extends TestCase {
-
- // ------------------------------------------------------------------------
- // JUnit
- // ------------------------------------------------------------------------
-
- @BeforeClass
- public static void setUpBeforeClass() {
- }
-
- @AfterClass
- public static void tearDownAfterClass() {
- }
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- @Override
- public void setUp() throws Exception {
- }
-
- /**
- * @throws java.lang.Exception
- */
- @After
- @Override
- public void tearDown() throws Exception {
- }
+public class ActivatorTest {
// ------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------
/**
- * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.ui.Activator#Activator()}.
+ * Test method for {@link org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator#Activator()}.
*/
@Test
public void testActivator() {
}
/**
- * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.ui.Activator#getDefault()}.
+ * Test method for {@link org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator#getDefault()}.
*/
@Test
public void testGetDefault() {
}
/**
- * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.ui.Activator#start(org.osgi.framework.BundleContext)}.
+ * Test method for {@link org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator#start}.
*/
@Test
public void testStartBundleContext() {
}
/**
- * Test method for {@link org.eclipse.linuxtools.lttng2.kernel.ui.Activator#stop(org.osgi.framework.BundleContext)}.
+ * Test method for {@link org.eclipse.linuxtools.internal.lttng2.kernel.ui.Activator#stop}.
*/
@Test
public void testStopBundleContext() {
/*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Francois Chouinard - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
*******************************************************************************/
package org.eclipse.linuxtools.lttng2.kernel.ui.tests;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
/**
- * <b><u>AllTests</u></b>
- * <p>
+ * Run the lttng2.ui unit tests.
*/
-@SuppressWarnings("javadoc")
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ ActivatorTest.class,
+})
public class AllTests {
- public static Test suite() {
- TestSuite suite = new TestSuite(AllTests.class.getName());
- // $JUnit-BEGIN$
-
- // Plug-in
- suite.addTestSuite(ActivatorTest.class);
-
- // $JUnit-END$
- return suite;
- }
}
package org.eclipse.linuxtools.lttng2.ui.tests;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertTrue;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
/**
- * <b><u>ActivatorTest</u></b>
- * <p>
* Test suite for the Activator class
- * <p>
*/
-@SuppressWarnings("javadoc")
-public class ActivatorTest extends TestCase {
-
- // ------------------------------------------------------------------------
- // JUnit
- // ------------------------------------------------------------------------
-
- @BeforeClass
- public static void setUpBeforeClass() {
- }
-
- @AfterClass
- public static void tearDownAfterClass() {
- }
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- @Override
- public void setUp() throws Exception {
- }
-
- /**
- * @throws java.lang.Exception
- */
- @After
- @Override
- public void tearDown() throws Exception {
- }
+public class ActivatorTest {
// ------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------
/**
- * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ui.Activator#Activator()}.
+ * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ui.Activator#Activator}.
*/
@Test
public void testActivator() {
}
/**
- * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ui.Activator#getDefault()}.
+ * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ui.Activator#getDefault}.
*/
@Test
public void testGetDefault() {
}
/**
- * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ui.Activator#start(org.osgi.framework.BundleContext)}.
+ * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ui.Activator#start}.
*/
@Test
public void testStartBundleContext() {
}
/**
- * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ui.Activator#stop(org.osgi.framework.BundleContext)}.
+ * Test method for {@link org.eclipse.linuxtools.internal.lttng2.ui.Activator#stop}.
*/
@Test
public void testStopBundleContext() {
/*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Francois Chouinard - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
*******************************************************************************/
package org.eclipse.linuxtools.lttng2.ui.tests;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
/**
- * <b><u>AllTests</u></b>
- * <p>
+ * Runner for the lttng2.ui unit tests.
*/
-@SuppressWarnings("javadoc")
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ ActivatorTest.class,
+ org.eclipse.linuxtools.lttng2.ui.tests.control.model.component.AllTests.class,
+ org.eclipse.linuxtools.lttng2.ui.tests.control.service.AllTests.class
+})
public class AllTests {
- public static Test suite() {
- TestSuite suite = new TestSuite(AllTests.class.getName());
- // $JUnit-BEGIN$
-
- // Plug-in
- suite.addTestSuite(ActivatorTest.class);
- suite.addTest(org.eclipse.linuxtools.lttng2.ui.tests.control.service.AllTests.suite());
- suite.addTest(org.eclipse.linuxtools.lttng2.ui.tests.control.model.component.AllTests.suite());
-
- // $JUnit-END$
- return suite;
- }
}
/*******************************************************************************
- * Copyright (c) 2011 Ericsson
+ * Copyright (c) 2011, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
*******************************************************************************/
+
package org.eclipse.linuxtools.lttng2.ui.tests.control.model.component;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
-@SuppressWarnings("javadoc")
+/**
+ * Runner for the control.model.component unit tests.
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ TraceControlComponentTest.class,
+ TraceControlKernelProviderTests.class,
+ TraceControlKernelSessionTests.class,
+ TraceControlPropertiesTest.class,
+ TraceControlTreeModelNoProvidersTest.class,
+ TraceControlTreeModelTest.class,
+ TraceControlUstProviderTests.class,
+ TraceControlUstSessionTests.class
+})
public class AllTests {
- public static Test suite() {
-
- TestSuite suite = new TestSuite(AllTests.class.getName());
- //$JUnit-BEGIN$
- suite.addTestSuite(TraceControlComponentTest.class);
- suite.addTestSuite(TraceControlTreeModelTest.class);
- suite.addTestSuite(TraceControlTreeModelNoProvidersTest.class);
- suite.addTestSuite(TraceControlKernelProviderTests.class);
- suite.addTestSuite(TraceControlUstProviderTests.class);
- suite.addTestSuite(TraceControlKernelSessionTests.class);
- suite.addTestSuite(TraceControlUstSessionTests.class);
- suite.addTestSuite(TraceControlPropertiesTest.class);
- //$JUnit-END$
- return new ModelImplTestSetup(suite);
- }
}
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.ui.tests.control.model.component;
+import static org.junit.Assert.*;
+
import java.util.LinkedList;
import java.util.List;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.Test;
/**
- * The class <code>TraceControlComponentTest</code> contains tests for the class <code>{@link TraceControlComponent}</code>.
- *
+ * The class <code>TraceControlComponentTest</code> contains tests for the class
+ * <code>{@link TraceControlComponent}</code>.
*/
@SuppressWarnings("nls")
-public class TraceControlComponentTest extends TestCase {
-
- // ------------------------------------------------------------------------
- // Test data
- // ------------------------------------------------------------------------
-
- // ------------------------------------------------------------------------
- // Static methods
- // ------------------------------------------------------------------------
-
- /**
- * Returns test setup used when executing test case stand-alone.
- * @return Test setup class
- */
- public static Test suite() {
- return new ModelImplTestSetup(new TestSuite(TraceControlComponentTest.class));
- }
-
- // ------------------------------------------------------------------------
- // Housekeeping
- // ------------------------------------------------------------------------
-
- /**
- * Perform pre-test initialization.
- *
- * @throws Exception
- * if the initialization fails for some reason
- *
- */
- @Override
- @Before
- public void setUp() throws Exception {
- }
-
- /**
- * Perform post-test clean-up.
- *
- * @throws Exception
- * if the clean-up fails for some reason
- *
- */
- @Override
- @After
- public void tearDown() throws Exception {
- }
+public class TraceControlComponentTest {
/**
* Run the TraceControlComponent(String) constructor test.
*/
+ @Test
public void testTraceControlComponent_1() {
String name = "node";
/**
* Run the TraceControlComponent(String,ITraceControlComponent) constructor test.
*/
+ @Test
public void testTraceControlComponent_2() {
String name = "node";
/**
* Run the void addChild(ITraceControlComponent) method test.
*/
+ @Test
public void testAddAndGetChild1() {
TraceControlComponent fixture = new TraceControlComponent("node", new TraceControlRoot());
fixture.setToolTip("This is the test node");
/**
* Run the void addChild(ITraceControlComponent) method test.
*/
+ @Test
public void testAddAndGetChild2() {
TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
fixture.setToolTip("");
/**
* Run the void addComponentListener(ITraceControlComponentChangedListener) method test.
*/
+ @Test
public void testAddComponentListener_1() {
TraceControlComponent fixture = new TraceControlComponent("", (ITraceControlComponent) null);
fixture.setToolTip("");
/**
* Run the boolean containsChild(String) method test.
*/
+ @Test
public void testContainsChild_1() {
TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
fixture.setToolTip("");
/**
* Run the boolean containsChild(String) method test.
*/
+ @Test
public void testContainsChild_2() {
TraceControlComponent fixture = new TraceControlComponent("name", new TraceControlRoot());
fixture.setToolTip("");
* Run the void fireCompenentRemoved(ITraceControlComponent,ITraceControlComponent) method test.
* Run the void fireCompenentChanged(ITraceControlComponent) method test
*/
+ @Test
public void testFireCompenentUpdated() {
ITraceControlComponent parent = new TraceControlRoot();
/**
* Run the Object getAdapter(Class) method test.
*/
+ @Test
public void testGetAdapter() {
TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
fixture.setToolTip("");
/**
* Run the ITraceControlComponent[] getChildren() method test.
*/
+ @Test
public void testGetChildren_1() {
TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
fixture.setToolTip("");
* @throws ExecutionException
* Would fail the test
*/
+ @Test
public void testGetAndSetControlService_1() throws ExecutionException {
TraceControlComponent parent = new TraceControlComponent("parent") {
/**
* Run the Image getImage() method test.
*/
+ @Test
public void testGetImage_1() {
TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
fixture.setToolTip("");
/**
* Run the boolean hasChildren() method test.
*/
+ @Test
public void testHasChildren_1() {
TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
fixture.setToolTip("");
/**
* Run the boolean hasChildren() method test.
*/
+ @Test
public void testHasChildren_2() {
TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
fixture.setToolTip("");
/**
* Run the void removeAllChildren() method test.
*/
+ @Test
public void testRemoveAllChildren_2() {
TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
fixture.setToolTip("");
/**
* Run the void removeChild(ITraceControlComponent) method test.
*/
+ @Test
public void testRemoveChild_1() {
TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
fixture.setToolTip("");
/**
* Run the void removeChild(ITraceControlComponent) method test.
*/
+ @Test
public void testRemoveChild_2() {
TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
fixture.setToolTip("");
/**
* Run the void removeComponentListener(ITraceControlComponentChangedListener) method test.
*/
+ @Test
public void testRemoveComponentListener_1() {
TraceControlComponent fixture = new TraceControlComponent("", (ITraceControlComponent) null);
fixture.setToolTip("");
/**
* Run the void removeComponentListener(ITraceControlComponentChangedListener) method test.
*/
+ @Test
public void testRemoveComponentListener_2() {
TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
fixture.setToolTip("");
/**
* Run the void setChildren(List<ITraceControlComponent>)/ITraceControlComponent[] getChildren() method test.
*/
+ @Test
public void testGetAndSetChildren() {
TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
fixture.setToolTip("");
/**
* Run the void String getName()/setName(String) method tests.
*/
+ @Test
public void testGetAndSetName() {
TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
fixture.setToolTip("");
/**
* Run the void ITraceControlComponent getParent()/setParent(ITraceControlComponent) method tests.
*/
+ @Test
public void testGetAndSetParent() {
TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
fixture.setToolTip("");
/**
* Run the void TargetNodeState getTargetNodeState()/etTargetNodeState(TargetNodeState) method tests.
*/
+ @Test
public void testGetAndSetTargetNodeState_1() {
TraceControlComponent parent = new TraceControlComponent("parent") {
private TargetNodeState fState;
/**
* Run the void setToolTip(String) method test.
*/
+ @Test
public void testGetSndSetToolTip() {
TraceControlComponent fixture = new TraceControlComponent("", new TraceControlRoot());
fixture.setToolTip("This is a tooltip");
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.ui.tests.control.model.component;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
import java.io.File;
import java.net.URL;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.junit.After;
import org.junit.Before;
+import org.junit.Test;
import org.osgi.framework.FrameworkUtil;
/**
- * The class <code>TraceControlKernelProviderTests</code> contains UST provider handling
- * test cases.
+ * The class <code>TraceControlKernelProviderTests</code> contains UST provider
+ * handling test cases.
*/
-@SuppressWarnings({"nls", "javadoc"})
-public class TraceControlKernelProviderTests extends TestCase {
+@SuppressWarnings("nls")
+public class TraceControlKernelProviderTests {
// ------------------------------------------------------------------------
// Constants
// ------------------------------------------------------------------------
+
private static final String TEST_STREAM = "CreateTreeTest.cfg";
private static final String SCEN_SCENARIO1_TEST = "Scenario1";
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
+
private TraceControlTestFacility fFacility;
private TestRemoteSystemProxy fProxy;
private String fTestFile;
- // ------------------------------------------------------------------------
- // Static methods
- // ------------------------------------------------------------------------
-
- /**
- * Returns test setup used when executing test case stand-alone.
- * @return Test setup class
- */
- public static Test suite() {
- return new ModelImplTestSetup(new TestSuite(TraceControlKernelProviderTests.class));
- }
-
// ------------------------------------------------------------------------
// Housekeeping
// ------------------------------------------------------------------------
*
* @throws Exception
* if the initialization fails for some reason
- *
*/
- @Override
@Before
public void setUp() throws Exception {
fFacility = TraceControlTestFacility.getInstance();
/**
* Perform post-test clean-up.
- *
- * @throws Exception
- * if the clean-up fails for some reason
- *
*/
- @Override
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
fFacility.waitForJobs();
}
/**
* Run the TraceControlComponent.
+ *
+ * @throws Exception
+ * Would fail the test
*/
+ @Test
public void testKernelProviderTree() throws Exception {
-
fProxy.setTestFile(fTestFile);
fProxy.setScenario(TraceControlTestFacility.SCEN_INIT_TEST);
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.ui.tests.control.model.component;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.junit.After;
import org.junit.Before;
+import org.junit.Test;
import org.osgi.framework.FrameworkUtil;
/**
- * The class <code>TraceControlKernelSessionTests</code> contains Kernel session/channel/event
- * handling test cases.
+ * The class <code>TraceControlKernelSessionTests</code> contains Kernel
+ * session/channel/event handling test cases.
*/
-
-@SuppressWarnings({"nls", "javadoc"})
-public class TraceControlKernelSessionTests extends TestCase {
+@SuppressWarnings("nls")
+public class TraceControlKernelSessionTests {
// ------------------------------------------------------------------------
// Constants
// ------------------------------------------------------------------------
+
private static final String TEST_STREAM = "CreateTreeTest.cfg";
private static final String SCEN_SCENARIO3_TEST = "Scenario3";
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
+
private TraceControlTestFacility fFacility;
private TestRemoteSystemProxy fProxy;
private String fTestFile;
- // ------------------------------------------------------------------------
- // Static methods
- // ------------------------------------------------------------------------
-
- /**
- * Returns test setup used when executing test case stand-alone.
- * @return Test setup class
- */
- public static Test suite() {
- return new ModelImplTestSetup(new TestSuite(TraceControlKernelSessionTests.class));
- }
-
// ------------------------------------------------------------------------
// Housekeeping
// ------------------------------------------------------------------------
*
* @throws Exception
* if the initialization fails for some reason
- *
*/
- @Override
@Before
public void setUp() throws Exception {
fFacility = TraceControlTestFacility.getInstance();
/**
* Perform post-test clean-up.
- *
- * @throws Exception
- * if the clean-up fails for some reason
- *
*/
- @Override
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
fFacility.waitForJobs();
}
/**
* Run the TraceControlComponent.
+ *
+ * @throws Exception
+ * Would fail the test
*/
+ @Test
public void testTraceSessionTree() throws Exception {
fProxy.setTestFile(fTestFile);
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.ui.tests.control.model.component;
+import static org.junit.Assert.*;
+
import java.io.File;
import java.net.URL;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.ui.views.properties.IPropertySource;
import org.junit.After;
-import org.junit.Before;
+import org.junit.Test;
import org.osgi.framework.FrameworkUtil;
-
/**
- * The class <code>TraceControlPropertiesTest</code> contains tests for the all property class</code>.
- *
+ * The class <code>TraceControlPropertiesTest</code> contains tests for the all
+ * property class</code>.
*/
@SuppressWarnings("nls")
-public class TraceControlPropertiesTest extends TestCase {
+public class TraceControlPropertiesTest {
// ------------------------------------------------------------------------
// Constants
// ------------------------------------------------------------------------
+
private static final String DIRECTORY = "testfiles";
private static final String TEST_STREAM = "ListInfoTest.cfg";
private static final String SCEN_LIST_INFO_TEST = "ListInfoTest";
-
- // ------------------------------------------------------------------------
- // Test data
- // ------------------------------------------------------------------------
-
- // ------------------------------------------------------------------------
- // Static methods
- // ------------------------------------------------------------------------
-
- /**
- * Returns test setup used when executing test case stand-alone.
- * @return Test setup class
- */
- public static Test suite() {
- return new ModelImplTestSetup(new TestSuite(TraceControlPropertiesTest.class));
- }
-
// ------------------------------------------------------------------------
// Housekeeping
// ------------------------------------------------------------------------
- /**
- * Perform pre-test initialization.
- *
- * @throws Exception
- * if the initialization fails for some reason
- *
- */
- @Override
- @Before
- public void setUp() throws Exception {
- }
-
/**
* Perform post-test clean-up.
- *
- * @throws Exception
- * if the clean-up fails for some reason
- *
*/
- @Override
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
TraceControlTestFacility.getInstance().waitForJobs();
}
* @throws Exception
* This will fail the test
*/
+ @Test
public void testComponentProperties() throws Exception {
TestRemoteSystemProxy proxy = new TestRemoteSystemProxy();
* Contributors:
* Bernd Hufmann - Initial API and implementation
*******************************************************************************/
+
package org.eclipse.linuxtools.lttng2.ui.tests.control.model.component;
import org.eclipse.core.commands.ExecutionException;
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.ui.tests.control.model.component;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertTrue;
+
import java.io.File;
import java.net.URL;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
import org.eclipse.swt.graphics.Image;
import org.junit.After;
import org.junit.Before;
+import org.junit.Test;
import org.osgi.framework.FrameworkUtil;
/**
* The class <code>TraceControlTreeModelNoProvidersTest</code> verifies that the
- * Tracer Control can handle the case where no kernel provider and only UST provider
- * are available.
+ * Tracer Control can handle the case where no kernel provider and only UST
+ * provider are available.
*/
@SuppressWarnings("nls")
-public class TraceControlTreeModelNoProvidersTest extends TestCase {
+public class TraceControlTreeModelNoProvidersTest {
// ------------------------------------------------------------------------
// Constants
private TestRemoteSystemProxy fProxy;
private String fTestFile;
- // ------------------------------------------------------------------------
- // Static methods
- // ------------------------------------------------------------------------
-
- /**
- * Returns test setup used when executing test case stand-alone.
- * @return Test setup class
- */
- public static Test suite() {
- return new ModelImplTestSetup(new TestSuite(TraceControlTreeModelNoProvidersTest.class));
- }
-
// ------------------------------------------------------------------------
// Housekeeping
// ------------------------------------------------------------------------
*
* @throws Exception
* if the initialization fails for some reason
- *
*/
- @Override
@Before
public void setUp() throws Exception {
fProxy = new TestRemoteSystemProxy();
/**
* Perform post-test clean-up.
- *
- * @throws Exception
- * if the clean-up fails for some reason
- *
*/
- @Override
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
TraceControlTestFacility.getInstance().waitForJobs();
}
* @throws Exception
* This will fail the test
*/
+ @Test
public void testTraceControlComponents() throws Exception {
fProxy.setTestFile(fTestFile);
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.ui.tests.control.model.component;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
import java.io.File;
import java.net.URL;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
import org.eclipse.swt.graphics.Image;
import org.junit.After;
import org.junit.Before;
+import org.junit.Test;
import org.osgi.framework.FrameworkUtil;
/**
- * The class <code>TraceControlTreeModelTest</code> contains tests for the tree component classes.
+ * The class <code>TraceControlTreeModelTest</code> contains tests for the tree
+ * component classes.
*/
@SuppressWarnings("nls")
-public class TraceControlTreeModelTest extends TestCase {
+public class TraceControlTreeModelTest {
// ------------------------------------------------------------------------
// Constants
private TestRemoteSystemProxy fProxy;
private String fTestFile;
- // ------------------------------------------------------------------------
- // Static methods
- // ------------------------------------------------------------------------
-
- /**
- * Returns test setup used when executing test case stand-alone.
- * @return Test setup class
- */
- public static Test suite() {
- return new ModelImplTestSetup(new TestSuite(TraceControlTreeModelTest.class));
- }
-
// ------------------------------------------------------------------------
// Housekeeping
// ------------------------------------------------------------------------
*
* @throws Exception
* if the initialization fails for some reason
- *
*/
- @Override
@Before
public void setUp() throws Exception {
fProxy = new TestRemoteSystemProxy();
/**
* Perform post-test clean-up.
- *
- * @throws Exception
- * if the clean-up fails for some reason
- *
*/
- @Override
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
TraceControlTestFacility.getInstance().waitForJobs();
}
* @throws Exception
* This will fail the test
*/
+ @Test
public void testTraceControlComponents() throws Exception {
fProxy.setTestFile(fTestFile);
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.ui.tests.control.model.component;
+import static org.junit.Assert.*;
+
import java.io.File;
import java.net.URL;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TargetNodeState;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.junit.After;
import org.junit.Before;
+import org.junit.Test;
import org.osgi.framework.FrameworkUtil;
/**
- * The class <code>TraceControlUstProviderTests</code> contains UST provider handling
- * test cases.
+ * The class <code>TraceControlUstProviderTests</code> contains UST provider
+ * handling test cases.
*/
@SuppressWarnings("nls")
-public class TraceControlUstProviderTests extends TestCase {
+public class TraceControlUstProviderTests {
// ------------------------------------------------------------------------
// Constants
// ------------------------------------------------------------------------
+
private static final String TEST_STREAM = "CreateTreeTest.cfg";
private static final String SCEN_SCENARIO2_TEST = "Scenario2";
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
+
private TraceControlTestFacility fFacility;
private TestRemoteSystemProxy fProxy;
private String fTestFile;
- // ------------------------------------------------------------------------
- // Static methods
- // ------------------------------------------------------------------------
-
- /**
- * Returns test setup used when executing test case stand-alone.
- * @return Test setup class
- */
- public static Test suite() {
- return new ModelImplTestSetup(new TestSuite(TraceControlUstProviderTests.class));
- }
-
// ------------------------------------------------------------------------
// Housekeeping
// ------------------------------------------------------------------------
*
* @throws Exception
* if the initialization fails for some reason
- *
*/
- @Override
@Before
public void setUp() throws Exception {
fFacility = TraceControlTestFacility.getInstance();
/**
* Perform post-test clean-up.
- *
- * @throws Exception
- * if the clean-up fails for some reason
- *
*/
- @Override
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
fFacility.waitForJobs();
}
* @throws Exception
* This will fail the test
*/
+ @Test
public void testUstProviderTree() throws Exception {
fProxy.setTestFile(fTestFile);
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.ui.tests.control.model.component;
+import static org.junit.Assert.*;
+
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.LogLevelType;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.junit.After;
import org.junit.Before;
+import org.junit.Test;
import org.osgi.framework.FrameworkUtil;
/**
- * The class <code>TraceControlUstSessionTests</code> contains UST session/channel/event
- * handling test cases.
+ * The class <code>TraceControlUstSessionTests</code> contains UST
+ * session/channel/event handling test cases.
*/
@SuppressWarnings("nls")
-public class TraceControlUstSessionTests extends TestCase {
+public class TraceControlUstSessionTests {
// ------------------------------------------------------------------------
// Constants
// ------------------------------------------------------------------------
+
private static final String TEST_STREAM = "CreateTreeTest.cfg";
private static final String SCEN_SCENARIO4_TEST = "Scenario4";
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
+
private TraceControlTestFacility fFacility;
private TestRemoteSystemProxy fProxy;
private String fTestFile;
- // ------------------------------------------------------------------------
- // Static methods
- // ------------------------------------------------------------------------
-
- /**
- * Returns test setup used when executing test case stand-alone.
- * @return Test setup class
- */
- public static Test suite() {
- return new ModelImplTestSetup(new TestSuite(TraceControlUstSessionTests.class));
- }
-
// ------------------------------------------------------------------------
// Housekeeping
// ------------------------------------------------------------------------
*
* @throws Exception
* if the initialization fails for some reason
- *
*/
- @Override
@Before
public void setUp() throws Exception {
fFacility = TraceControlTestFacility.getInstance();
/**
* Perform post-test clean-up.
- *
- * @throws Exception
- * if the clean-up fails for some reason
- *
*/
- @Override
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
fFacility.waitForJobs();
}
* @throws Exception
* This will fail the test
*/
+ @Test
public void testTraceSessionTree() throws Exception {
fProxy.setTestFile(fTestFile);
/*******************************************************************************
- * Copyright (c) 2011 Ericsson
+ * Copyright (c) 2011, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
*******************************************************************************/
+
package org.eclipse.linuxtools.lttng2.ui.tests.control.service;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
-@SuppressWarnings("javadoc")
+/**
+ * Runner for the control.service unit tests.
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ LTTngControlServiceTest.class
+})
public class AllTests {
- public static Test suite() {
- TestSuite suite = new TestSuite(AllTests.class.getName());
- //$JUnit-BEGIN$
- suite.addTestSuite(LTTngControlServiceTest.class);
- //$JUnit-END$
- return suite;
- }
}
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Alexandre Montplaisir - Port to JUnit4
**********************************************************************/
+
package org.eclipse.linuxtools.lttng2.ui.tests.control.service;
+import static org.junit.Assert.*;
+
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
-import junit.framework.TestCase;
-
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.LTTngControlService;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.LTTngControlServiceFactory;
+import org.junit.Before;
+import org.junit.Test;
import org.osgi.framework.FrameworkUtil;
+
/**
- * The class <code>LTTngControlServiceTest</code> contains test for the class <code>{@link LTTngControlService}</code>.
+ * The class <code>LTTngControlServiceTest</code> contains test for the class
+ * <code>{@link LTTngControlService}</code>.
*/
@SuppressWarnings({"nls", "javadoc"})
-public class LTTngControlServiceTest extends TestCase {
+public class LTTngControlServiceTest {
private static final String DIRECTORY = "testfiles";
private static final String TEST_STREAM = "LTTngServiceTest.cfg";
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
+
private CommandShellFactory fShellFactory;
private String fTestfile;
private LTTngToolsFileShell fShell;
private ILttngControlService fService;
-
- // ------------------------------------------------------------------------
- // Static methods
- // ------------------------------------------------------------------------
-
// ------------------------------------------------------------------------
// Housekeeping
// ------------------------------------------------------------------------
+
/**
* Perform pre-test initialization.
*
- * @throws Exception if the initialization fails for some reason
- *
+ * @throws Exception
+ * if the initialization fails for some reason
*/
- @Override
+ @Before
public void setUp() throws Exception {
- super.setUp();
fShellFactory = CommandShellFactory.getInstance();
URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
fService = new LTTngControlService(fShell);
}
- /**
- * Perform post-test clean-up.
- *
- * @throws Exception if the clean-up fails for some reason
- *
- */
- @Override
- public void tearDown() throws Exception {
- }
-
// ------------------------------------------------------------------------
// Test Cases
// ------------------------------------------------------------------------
+ @Test
public void testVersion() {
try {
fShell.setScenario(SCEN_LTTNG_VERSION);
}
}
+ @Test
public void testVersionWithPrompt() {
try {
fShell.setScenario(SCEN_LTTNG_VERSION_WITH_PROMPT);
}
}
+ @Test
public void testUnsupportedVersion() {
try {
fShell.setScenario(SCEN_LTTNG_UNSUPPORTED_VERSION);
}
}
+ @Test
public void testNoVersion() {
try {
fShell.setScenario(SCEN_LTTNG_NO_VERSION);
}
}
+ @Test
public void testLttngNotInstalled() {
try {
fShell.setScenario(SCEN_LTTNG_NOT_INSTALLED);
}
}
+ @Test
public void testGetSessionNames1() {
try {
fShell.setScenario(SCEN_NO_SESSION_AVAILABLE);
}
}
+ @Test
public void testGetSessionNames2() {
try {
fShell.setScenario(SCEN_GET_SESSION_NAMES1);
}
}
+ @Test
public void testGetSessionNotExist() {
try {
fShell.setScenario(SCEN_GET_SESSION_NAME_NOT_EXIST);
}
}
+ @Test
public void testGetSessionNameGarbage() {
try {
fShell.setScenario(SCEN_GET_SESSION_GARBAGE_OUT);
}
}
+ @Test
public void testGetSession1() {
try {
fShell.setScenario(SCEN_GET_SESSION1);
}
}
+ @Test
public void testGetKernelProviderNoKernel1() {
try {
fShell.setScenario(SCEN_LIST_WITH_NO_KERNEL1);
}
}
+ @Test
public void testGetKernelProviderNoKernel2() {
try {
fShell.setScenario(SCEN_LIST_WITH_NO_KERNEL2);
}
}
-
+ @Test
public void testGetUstProvider() {
try {
fShell.setScenario(SCEN_GET_UST_PROVIDER1);
}
}
+ @Test
public void testUstProvider2() {
try {
fShell.setScenario(SCEN_GET_UST_PROVIDER2);
}
}
+ @Test
public void testGetUstProvider3() {
try {
fShell.setScenario(SCEN_GET_UST_PROVIDER3);
}
}
+ @Test
public void testCreateSession() {
try {
fShell.setScenario(SCEN_CREATE_SESSION1);
}
}
+ @Test
public void testCreateSessionWithPrompt() {
try {
// First line has the shell prompt before the command output
}
}
-
+ @Test
public void testCreateSessionVariants() {
fShell.setScenario(SCEN_CREATE_SESSION_VARIANTS);
}
}
+ @Test
public void testDestroySession() {
try {
fShell.setScenario(SCEN_DESTROY_SESSION1);
}
}
+ @Test
public void testCreateChannel() {
try {
}
}
+ @Test
public void testDisableChannel() {
try {
}
}
+ @Test
public void testEnableChannel() {
try {
// }
// }
+ @Test
public void testEnableEvents() {
try {
// 1) session name, channel = null, 3 event names, kernel
}
}
+ @Test
public void testEnableSyscalls() {
try {
// 1) session name, channel = null, 3 event names, kernel
}
}
+ @Test
public void testDynamicProbe() {
try {
// 1) session name, channel = null, 3 event names, kernel
}
}
+ @Test
public void testEnableLogLevel() {
try {
// 1) session name, channel = null, 3 event names, kernel
}
}
+ @Test
public void testAddContext() {
try {
// 1) session name, channel = null, 3 event names, kernel
}
}
+ @Test
public void testAddContextFailure() {
// 1) session name, channel = null, 3 event names, kernel
}
}
+ @Test
public void testCalibrate() {
try {
fShell.setScenario(SCEN_CALIBRATE_HANDLING);
}
}
+ @Test
public void testCalibrateFailure() {
-
try {
fShell.setScenario(SCEN_CALIBRATE_HANDLING);
fService.calibrate(false, new NullProgressMonitor());