From: Leif Åstrand Date: Fri, 7 Feb 2014 12:23:18 +0000 (+0200) Subject: Use consistent date output in serializer test (#13073) X-Git-Tag: 7.2.0.beta1~168 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5e993486f1196971596ee0add0c73dd9603d9068;p=vaadin-framework.git Use consistent date output in serializer test (#13073) Change-Id: I32e9377d5ef8a8e88a8126ece78f0b8750cfa2ea --- diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerTest.java index 1184be79d4..d4849ce667 100644 --- a/uitest/src/com/vaadin/tests/serialization/SerializerTest.java +++ b/uitest/src/com/vaadin/tests/serialization/SerializerTest.java @@ -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)); } }); diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java index 518c222bc3..d093a30ea7 100644 --- a/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java +++ b/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java @@ -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]",