tmf: Update tmf.core unit tests to JUnit4
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core.tests / src / org / eclipse / linuxtools / tmf / core / tests / event / TmfEventTypeManagerTest.java
index b5a8da94c96764f561b55fee322af64e4117257a..1095fec4dc0ca1a06eadfcadea0a63c0378ec86d 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,24 +8,29 @@
  *
  * Contributors:
  *   Francois Chouinard - Initial API and implementation
+ *   Alexandre Montplaisir - Port to JUnit4
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.core.tests.event;
 
-import java.util.Arrays;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
 
-import junit.framework.TestCase;
+import java.util.Arrays;
 
 import org.eclipse.linuxtools.tmf.core.event.ITmfEventType;
 import org.eclipse.linuxtools.tmf.core.event.TmfEventField;
 import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
 import org.eclipse.linuxtools.tmf.core.event.TmfEventTypeManager;
+import org.junit.Test;
 
 /**
  * Test suite for the TmfEventTypeManager class.
  */
-@SuppressWarnings("nls")
-public class TmfEventTypeManagerTest extends TestCase {
+@SuppressWarnings({"nls", "javadoc"})
+public class TmfEventTypeManagerTest {
 
     // ------------------------------------------------------------------------
     // Variables
@@ -53,34 +58,11 @@ public class TmfEventTypeManagerTest extends TestCase {
     private final TmfEventType fType2 = new TmfEventType(fContext2, fTypeId3, TmfEventField.makeRoot(fLabels2));
     private final TmfEventType fType3 = new TmfEventType(fContext2, fTypeId4, TmfEventField.makeRoot(fLabels1));
 
-    // ------------------------------------------------------------------------
-    // Housekeeping
-    // ------------------------------------------------------------------------
-
-    /**
-     * @param name the test name
-     */
-    public TmfEventTypeManagerTest(final String name) {
-        super(name);
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
-
     // ------------------------------------------------------------------------
     // Getters
     // ------------------------------------------------------------------------
 
-    /**
-     *
-     */
+    @Test
     public void testGetContexts() {
         fInstance.clear();
         fInstance.add(fContext1, fType0);
@@ -95,9 +77,7 @@ public class TmfEventTypeManagerTest extends TestCase {
         assertEquals("getContexts", fContext2, contexts[1]);
     }
 
-    /**
-     *
-     */
+    @Test
     public void testGetTypes() {
         fInstance.clear();
         fInstance.add(fContext1, fType0);
@@ -124,9 +104,7 @@ public class TmfEventTypeManagerTest extends TestCase {
         }
     }
 
-    /**
-     *
-     */
+    @Test
     public void testGetType() {
         fInstance.clear();
         fInstance.add(fContext1, fType0);
@@ -157,9 +135,7 @@ public class TmfEventTypeManagerTest extends TestCase {
     // Operations
     // ------------------------------------------------------------------------
 
-    /**
-     *
-     */
+    @Test
     public void testClear() {
         fInstance.clear();
         assertEquals("clear", 0, fInstance.getContexts().length);
@@ -168,9 +144,7 @@ public class TmfEventTypeManagerTest extends TestCase {
         assertEquals("clear", "TmfEventTypeManager [fEventTypes={}]", fInstance.toString());
     }
 
-    /**
-     *
-     */
+    @Test
     public void testClearContext() {
         fInstance.clear();
         fInstance.add(fContext1, fType0);
@@ -202,9 +176,7 @@ public class TmfEventTypeManagerTest extends TestCase {
         }
     }
 
-    /**
-     *
-     */
+    @Test
     public void testBasicAdd() {
         fInstance.clear();
         fInstance.add(fContext1, fType0);
@@ -224,9 +196,7 @@ public class TmfEventTypeManagerTest extends TestCase {
         assertNotSame("add", fType0, type);
     }
 
-    /**
-     *
-     */
+    @Test
     public void testAdd() {
         fInstance.clear();
         fInstance.add(fContext1, fType0);
@@ -277,9 +247,7 @@ public class TmfEventTypeManagerTest extends TestCase {
     // Object
     // ------------------------------------------------------------------------
 
-    /**
-     *
-     */
+    @Test
     public void testToString() {
         fInstance.clear();
         assertEquals("toString", "TmfEventTypeManager [fEventTypes={}]", fInstance.toString());
This page took 0.025596 seconds and 5 git commands to generate.