From 53e0e8ace455ebe07fc3c932c16d114dd7013e44 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 5 Dec 2011 08:58:19 +0000 Subject: [PATCH] Refactored test to avoid depending on JDK DateTimeInstance, which is different in Java5 and Java6 svn changeset:22222/svn branch:6.7 --- .../tests/components/datefield/CustomDateFormat.html | 2 +- .../tests/components/datefield/CustomDateFormat.java | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormat.html b/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormat.html index 5561fd37cb..ed92afe378 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormat.html +++ b/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormat.html @@ -19,7 +19,7 @@ assertValue vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormat::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPopupCalendar[0]/domChild[0] - 1. tammikuuta 2010 0:00:00 UTC+2 + 1. tammikuuta 2010 klo 0.00.00 diff --git a/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormat.java b/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormat.java index 8b4bca5fde..c2afb4cba3 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormat.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormat.java @@ -1,7 +1,5 @@ package com.vaadin.tests.components.datefield; -import java.text.DateFormat; -import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Locale; @@ -22,13 +20,8 @@ public class CustomDateFormat extends TestBase { df.setLocale(locale); df.setWidth("300px"); - DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, - DateFormat.LONG, locale); - - if (dateFormat instanceof SimpleDateFormat) { - String pattern = ((SimpleDateFormat) dateFormat).toPattern(); - df.setDateFormat(pattern); - } + String pattern = "d. MMMM'ta 'yyyy 'klo 'H.mm.ss"; + df.setDateFormat(pattern); df.setValue(cal.getTime()); -- 2.39.5