tmf: Disable NLS warnings in tests
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core.tests / src / org / eclipse / linuxtools / tmf / core / tests / ctfadaptor / CtfTmfTimestampTest.java
index 15400a8209b999a7817debbd675d5d1127d43d78..2f9b446d5fd8e840c811867cc6062abe7db1ef9a 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;
 
@@ -28,26 +33,19 @@ import org.junit.Test;
  */
 public class CtfTmfTimestampTest {
 
-    /**
-     * Launch the test.
-     *
-     * @param args the command line arguments
-     */
-    public static void main(String[] args) {
-        new org.junit.runner.JUnitCore().run(CtfTmfTimestampTest.class);
-    }
-
     /**
      * Run the CtfTmfTimestamp(long) constructor test.
      */
     @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());
         assertEquals(0, result.getPrecision());
         assertEquals(-9, result.getScale());
         assertEquals(1L, result.getValue());
This page took 0.029641 seconds and 5 git commands to generate.