]> source.dussan.org Git - vaadin-framework.git/commitdiff
Use consistent date output in serializer test (#13073)
authorLeif Åstrand <leif@vaadin.com>
Fri, 7 Feb 2014 12:23:18 +0000 (14:23 +0200)
committerVaadin Code Review <review@vaadin.com>
Mon, 10 Feb 2014 15:42:58 +0000 (15:42 +0000)
Change-Id: I32e9377d5ef8a8e88a8126ece78f0b8750cfa2ea

uitest/src/com/vaadin/tests/serialization/SerializerTest.java
uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java

index 1184be79d4a0d13b411dff97ea4f9b6581f0e864..d4849ce6679c8862c1ab52eaf9481e5ccc680bc2 100644 (file)
@@ -16,6 +16,7 @@
 
 package com.vaadin.tests.serialization;
 
+import java.text.DateFormat;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
@@ -23,9 +24,11 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+import java.util.TimeZone;
 
 import com.vaadin.annotations.Widgetset;
 import com.vaadin.server.VaadinRequest;
@@ -321,7 +324,11 @@ public class SerializerTest extends AbstractTestUI {
 
             @Override
             public void sendDate(Date date) {
-                log.log("sendDate: " + date.toString());
+                DateFormat format = DateFormat.getDateTimeInstance(
+                        DateFormat.LONG, DateFormat.FULL,
+                        new Locale("en", "fi"));
+                format.setTimeZone(TimeZone.getTimeZone("UTC"));
+                log.log("sendDate: " + format.format(date));
             }
 
         });
index 518c222bc35fbba43a190c442ef25382e7e4d3e7..d093a30ea7e8f01ef0a1e2808776cc20bd81e51d 100644 (file)
@@ -27,9 +27,9 @@ public class SerializerTestTest extends MultiBrowserTest {
         openTestURL();
         int logRow = 0;
 
-        Assert.assertEquals("sendDate: Fri May 31 11:12:13 CEST 2013",
+        Assert.assertEquals("sendDate: May 31, 2013 8:12:13 AM UTC",
                 getLogRow(logRow++));
-        Assert.assertEquals("sendDate: Thu Jan 01 01:00:00 CET 1970",
+        Assert.assertEquals("sendDate: January 1, 1970 12:00:00 AM UTC",
                 getLogRow(logRow++));
         Assert.assertEquals(
                 "sendEnum: PREFORMATTED, [HTML, RAW], [PREFORMATTED, XML]",