From cde98fde1350ec68fa7a9d607a1d4f38d662bdf0 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 25 Feb 2011 15:29:03 +0000 Subject: Test should now pass in all environments (locale problems fixed) svn changeset:17478/svn branch:6.5 --- .../tests/components/datefield/DateFieldEmptyValid.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/src/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java b/tests/src/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java index 736fdc87a6..aca1c84ca3 100644 --- a/tests/src/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java +++ b/tests/src/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java @@ -1,6 +1,7 @@ package com.vaadin.tests.components.datefield; -import java.sql.Date; +import java.text.DateFormat; +import java.util.Date; import java.util.Locale; import com.vaadin.data.Property.ValueChangeEvent; @@ -22,6 +23,9 @@ public class DateFieldEmptyValid extends TestBase { private MyDateField df; + private DateFormat formatter = DateFormat.getDateTimeInstance( + DateFormat.LONG, DateFormat.LONG, new Locale("en", "US")); + public class MyDateField extends PopupDateField { @Override public boolean isEmpty() { @@ -115,7 +119,13 @@ public class DateFieldEmptyValid extends TestBase { } private void checkEmpty() { - log.log("DateField value is now " + df.getValue()); + Object value = df.getValue(); + if (value instanceof Date) { + value = formatter.format(df.getValue()); + } + + log.log("DateField value is now " + value); + // log.log("DateField value is now " + df.getValue()); log.log("isEmpty: " + df.isEmpty() + ", isValid: " + df.isValid()); } -- cgit v1.2.3