lttng: Port unit tests to JUnit4
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui.tests / src / org / eclipse / linuxtools / lttng2 / ui / tests / control / model / component / TraceControlKernelSessionTests.java
index 6000c30fa4c30a6890de0ea1f72810e580d99727..b60f0f55d5ebec32e61026cc3d974650524440f6 100644 (file)
@@ -1,5 +1,5 @@
 /**********************************************************************
- * 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
@@ -8,18 +8,22 @@
  *
  * 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;
@@ -48,41 +52,31 @@ import org.eclipse.rse.core.model.ISystemProfile;
 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
     // ------------------------------------------------------------------------
@@ -92,9 +86,7 @@ public class TraceControlKernelSessionTests extends TestCase {
      *
      * @throws Exception
      *         if the initialization fails for some reason
-     *
      */
-    @Override
     @Before
     public void setUp() throws Exception {
         fFacility = TraceControlTestFacility.getInstance();
@@ -106,20 +98,19 @@ public class TraceControlKernelSessionTests extends TestCase {
 
     /**
      * 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);
This page took 0.028738 seconds and 5 git commands to generate.