Fix test case for local time zone
authorPatrick Tasse <patrick.tasse@gmail.com>
Tue, 19 Feb 2013 23:09:22 +0000 (18:09 -0500)
committerPatrick Tasse <patrick.tasse@gmail.com>
Wed, 20 Feb 2013 15:32:48 +0000 (10:32 -0500)
Change-Id: I2e9115810a48ddc1f685c844a8ae7e349d9b13db
Reviewed-on: https://git.eclipse.org/r/9545
Tested-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
IP-Clean: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Tested-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/CtfTmfTimestampTest.java

index 6385e8260764e55fa89bc9c63d679767724f1c56..04812bda30a5ba2cf7c9d1c894b2f0a6f8abe9f4 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
@@ -9,6 +9,7 @@
  * Contributors:
  *   Matthew Khouzam - Initial generation with CodePro tools
  *   Alexandre Montplaisir - Clean up, consolidate redundant tests
+ *   Patrick Tasse - Fix for local time zone
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.core.tests.ctfadaptor;
@@ -16,6 +17,10 @@ package org.eclipse.linuxtools.tmf.core.tests.ctfadaptor;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTimestamp;
 import org.junit.Test;
 
@@ -26,6 +31,7 @@ import org.junit.Test;
  * @author ematkho
  * @version 1.0
  */
+@SuppressWarnings({"nls"})
 public class CtfTmfTimestampTest {
 
     /**
@@ -34,11 +40,13 @@ public class CtfTmfTimestampTest {
     @Test
     public void testCtfTmfTimestamp() {
         long timestamp = 1L;
+        DateFormat df = new SimpleDateFormat("HH:mm:ss.SSS");
+        Date d = new Date(timestamp / 1000000);
 
         CtfTmfTimestamp result = new CtfTmfTimestamp(timestamp);
 
         assertNotNull(result);
-        //assertEquals("00:00:00.000 000 001", result.toString()); //$NON-NLS-1$
+        assertEquals(df.format(d) + " 000 001", result.toString()); //$NON-NLS-1$
         assertEquals(0, result.getPrecision());
         assertEquals(-9, result.getScale());
         assertEquals(1L, result.getValue());
This page took 0.026704 seconds and 5 git commands to generate.