Merge branch 'master' into lttng-luna
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core.tests / src / org / eclipse / linuxtools / tmf / core / tests / ctfadaptor / CtfLocationTest.java
index 087c22fd8b101ddb907b1191be157a00c21b123f..9ae5053614eddece7f252509fc0a428fab647e7c 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
@@ -17,10 +17,9 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocation;
-import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocationData;
-import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
-import org.junit.After;
+import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocationInfo;
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -35,44 +34,24 @@ public class CtfLocationTest {
 
     private CtfLocation fixture;
 
-    /**
-     * Launch the test.
-     *
-     * @param args
-     *            the command line arguments
-     */
-    public static void main(String[] args) {
-        new org.junit.runner.JUnitCore().run(CtfLocationTest.class);
-    }
-
     /**
      * Perform pre-test initialization.
      */
     @Before
     public void setUp() {
-        fixture = new CtfLocation(new CtfLocationData(1, 0));
-        fixture.setLocation(new CtfLocationData(1, 0));
-    }
-
-    /**
-     * Perform post-test clean-up.
-     */
-    @After
-    public void tearDown() {
-        // Add additional tear down code here
+        fixture = new CtfLocation(new CtfLocationInfo(1, 0));
     }
 
-
     /**
      * Run the CtfLocation(Long) constructor test.
      */
     @Test
     public void testCtfLocation_long() {
-        CtfLocationData location = new CtfLocationData(1, 0);
+        CtfLocationInfo location = new CtfLocationInfo(1, 0);
         CtfLocation result = new CtfLocation(location);
 
         assertNotNull(result);
-        assertEquals(Long.valueOf(1), (Long)result.getLocation().getTimestamp());
+        assertEquals(Long.valueOf(1), (Long)result.getLocationInfo().getTimestamp());
     }
 
     /**
@@ -84,18 +63,7 @@ public class CtfLocationTest {
         CtfLocation result = new CtfLocation(timestamp);
 
         assertNotNull(result);
-        assertEquals(new Long(0L), (Long)result.getLocation().getTimestamp());
-    }
-
-    /**
-     * Run the CtfLocation clone() method test.
-     */
-    @Test
-    public void testClone() {
-        CtfLocation result = fixture.clone();
-
-        assertNotNull(result);
-        assertEquals(Long.valueOf(1), (Long)result.getLocation().getTimestamp());
+        assertEquals(new Long(0L), (Long)result.getLocationInfo().getTimestamp());
     }
 
     /**
@@ -103,10 +71,10 @@ public class CtfLocationTest {
      */
     @Test
     public void testGetLocation() {
-        CtfLocationData location = fixture.getLocation();
+        CtfLocationInfo location = fixture.getLocationInfo();
         Long result = location.getTimestamp();
         assertNotNull(result);
-        assertEquals("1", result.toString()); //$NON-NLS-1$
+        assertEquals("1", result.toString());
         assertEquals((byte) 1, result.byteValue());
         assertEquals((short) 1, result.shortValue());
         assertEquals(1, result.intValue());
@@ -120,8 +88,8 @@ public class CtfLocationTest {
      */
     @Test
     public void testSetLocation() {
-        CtfLocationData location = new CtfLocationData(1337, 7331);
-        fixture.setLocation(location);
+        CtfLocationInfo location = new CtfLocationInfo(1337, 7331);
+        fixture = new CtfLocation(location);
     }
 
     /**
@@ -129,8 +97,8 @@ public class CtfLocationTest {
      */
     @Test
     public void testToString_valid(){
-        CtfLocation fixture2 = new CtfLocation(new CtfLocationData(1337, 7331));
-        assertEquals("CtfLocation: Element [1337/7331]",fixture2.toString()); //$NON-NLS-1$
+        CtfLocation fixture2 = new CtfLocation(new CtfLocationInfo(1337, 7331));
+        assertEquals("CtfLocation [fLocationInfo=Element [1337/7331]]", fixture2.toString());
     }
 
     /**
@@ -138,7 +106,7 @@ public class CtfLocationTest {
      */
     @Test
     public void testToString_invalid(){
-        CtfLocation fixture2 = new CtfLocation(new CtfLocationData(-1, -1));
-        assertEquals("CtfLocation: INVALID",fixture2.toString()); //$NON-NLS-1$
+        CtfLocation fixture2 = new CtfLocation(new CtfLocationInfo(-1, -1));
+        assertEquals("CtfLocation [INVALID]", fixture2.toString());
     }
 }
This page took 0.025513 seconds and 5 git commands to generate.