/*******************************************************************************
- * 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.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
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);
assertEquals("getContexts", fContext2, contexts[1]);
}
- /**
- *
- */
+ @Test
public void testGetTypes() {
fInstance.clear();
fInstance.add(fContext1, fType0);
}
}
- /**
- *
- */
+ @Test
public void testGetType() {
fInstance.clear();
fInstance.add(fContext1, fType0);
// Operations
// ------------------------------------------------------------------------
- /**
- *
- */
+ @Test
public void testClear() {
fInstance.clear();
assertEquals("clear", 0, fInstance.getContexts().length);
assertEquals("clear", "TmfEventTypeManager [fEventTypes={}]", fInstance.toString());
}
- /**
- *
- */
+ @Test
public void testClearContext() {
fInstance.clear();
fInstance.add(fContext1, fType0);
}
}
- /**
- *
- */
+ @Test
public void testBasicAdd() {
fInstance.clear();
fInstance.add(fContext1, fType0);
assertNotSame("add", fType0, type);
}
- /**
- *
- */
+ @Test
public void testAdd() {
fInstance.clear();
fInstance.add(fContext1, fType0);
// Object
// ------------------------------------------------------------------------
- /**
- *
- */
+ @Test
public void testToString() {
fInstance.clear();
assertEquals("toString", "TmfEventTypeManager [fEventTypes={}]", fInstance.toString());