]> source.dussan.org Git - vaadin-framework.git/commitdiff
Refactored test to avoid depending on JDK DateTimeInstance, which is different in...
authorArtur Signell <artur.signell@itmill.com>
Mon, 5 Dec 2011 08:58:19 +0000 (08:58 +0000)
committerArtur Signell <artur.signell@itmill.com>
Mon, 5 Dec 2011 08:58:19 +0000 (08:58 +0000)
svn changeset:22222/svn branch:6.7

tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormat.html
tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormat.java

index 5561fd37cb048e3fd8ef44cbdd56b9e856c1c050..ed92afe37843245a3e6e70c2a980afd6ae083abc 100644 (file)
@@ -19,7 +19,7 @@
 <tr>
        <td>assertValue</td>
        <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormat::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPopupCalendar[0]/domChild[0]</td>
-       <td>1. tammikuuta 2010 0:00:00 UTC+2</td>
+       <td>1. tammikuuta 2010 klo 0.00.00</td>
 </tr>
 
 </tbody></table>
index 8b4bca5fde9c269a709ea39f2fea5f112d0ee31a..c2afb4cba31ceda8369744e07d47be587ce22706 100644 (file)
@@ -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());