]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test case for Custom date formats (#5465)
authorArtur Signell <artur.signell@itmill.com>
Fri, 20 Aug 2010 05:55:55 +0000 (05:55 +0000)
committerArtur Signell <artur.signell@itmill.com>
Fri, 20 Aug 2010 05:55:55 +0000 (05:55 +0000)
svn changeset:14552/svn branch:6.4

tests/src/com/vaadin/tests/components/datefield/CustomDateFormats.html [new file with mode: 0644]
tests/src/com/vaadin/tests/components/datefield/CustomDateFormats.java [new file with mode: 0644]

diff --git a/tests/src/com/vaadin/tests/components/datefield/CustomDateFormats.html b/tests/src/com/vaadin/tests/components/datefield/CustomDateFormats.html
new file mode 100644 (file)
index 0000000..e77a263
--- /dev/null
@@ -0,0 +1,372 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">\r
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+<link rel="selenium.base" href="http://artur-laptop.office.itmill.com:8888/" />\r
+<title>New Test</title>\r
+</head>\r
+<body>\r
+<table cellpadding="1" cellspacing="1" border="1">\r
+<thead>\r
+<tr><td rowspan="1" colspan="3">New Test</td></tr>\r
+</thead><tbody>\r
+<tr>\r
+       <td>open</td>\r
+       <td>/run/com.vaadin.tests.components.datefield.CustomDateFormats?restartApplication</td>\r
+       <td></td>\r
+</tr>\r
+<!--fr_FR-->\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 02 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 févr. 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 février 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>01 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[16]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>001 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[19]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 10</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[22]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 10</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[25]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 10</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[28]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[31]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 Février 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[34]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 Février 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[37]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>01/02/10</td>\r
+</tr>\r
+<tr>\r
+       <td>select</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VNativeSelect[0]/domChild[0]</td>\r
+       <td>label=zh</td>\r
+</tr>\r
+<!--zh-->\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 02 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 二月 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 二月 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>01 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[16]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>001 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[19]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 10</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[22]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 10</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[25]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 10</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[28]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[31]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>2010年2月1日</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[34]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>2010-2-1</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[37]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>10-2-1</td>\r
+</tr>\r
+<tr>\r
+       <td>select</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VNativeSelect[0]/domChild[0]</td>\r
+       <td>label=en_US</td>\r
+</tr>\r
+<!--en_US-->\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 02 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 Feb 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 February 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>01 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[16]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>001 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[19]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 10</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[22]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 10</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[25]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 10</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[28]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[31]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>February 1, 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[34]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>Feb 1, 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[37]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>2/1/10</td>\r
+</tr>\r
+<tr>\r
+       <td>select</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VNativeSelect[0]/domChild[0]</td>\r
+       <td>label=en_GB</td>\r
+</tr>\r
+<!--en_GB-->\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 02 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 Feb 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 February 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>01 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[16]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>001 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[19]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 10</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[22]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 10</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[25]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 10</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[28]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[31]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>01 February 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[34]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>01-Feb-2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[37]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>01/02/10</td>\r
+</tr>\r
+<tr>\r
+       <td>select</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VNativeSelect[0]/domChild[0]</td>\r
+       <td>label=fi_FI</td>\r
+</tr>\r
+<!--fi_FI-->\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 02 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 helmi 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 helmikuu 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>01 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[16]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>001 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[19]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 10</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[22]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 10</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[25]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 10</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[28]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1 2 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[31]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1. helmikuuta 2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[34]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1.2.2010</td>\r
+</tr>\r
+<tr>\r
+       <td>assertValue</td>\r
+       <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[37]/VPopupCalendar[0]/domChild[0]</td>\r
+       <td>1.2.2010</td>\r
+</tr>\r
+<!---->\r
+</tbody></table>\r
+</body>\r
+</html>\r
diff --git a/tests/src/com/vaadin/tests/components/datefield/CustomDateFormats.java b/tests/src/com/vaadin/tests/components/datefield/CustomDateFormats.java
new file mode 100644 (file)
index 0000000..35cc477
--- /dev/null
@@ -0,0 +1,149 @@
+package com.vaadin.tests.components.datefield;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.Calendar;\r
+import java.util.Locale;\r
+\r
+import com.vaadin.data.Item;\r
+import com.vaadin.data.Property;\r
+import com.vaadin.data.Property.ValueChangeEvent;\r
+import com.vaadin.tests.components.TestBase;\r
+import com.vaadin.ui.Component;\r
+import com.vaadin.ui.DateField;\r
+import com.vaadin.ui.GridLayout;\r
+import com.vaadin.ui.Label;\r
+import com.vaadin.ui.NativeSelect;\r
+\r
+public class CustomDateFormats extends TestBase {\r
+\r
+    private static final Object CAPTION = "C";\r
+\r
+    private Component customFormats = null;\r
+\r
+    @Override\r
+    protected void setup() {\r
+        final NativeSelect s = new NativeSelect("Locale");\r
+        s.setImmediate(true);\r
+        s.setNullSelectionAllowed(false);\r
+        s.addContainerProperty(CAPTION, String.class, "");\r
+        addLocale(Locale.FRANCE, s);\r
+        addLocale(Locale.CHINESE, s);\r
+        addLocale(Locale.US, s);\r
+        addLocale(Locale.UK, s);\r
+        addLocale(new Locale("fi", "FI"), s);\r
+\r
+        s.addListener(new Property.ValueChangeListener() {\r
+\r
+            public void valueChange(ValueChangeEvent event) {\r
+                setDateFieldLocale((Locale) s.getValue());\r
+            }\r
+        });\r
+        addComponent(s);\r
+        s.setValue(Locale.FRANCE);\r
+    }\r
+\r
+    private void addLocale(Locale locale, NativeSelect s) {\r
+        Item i = s.addItem(locale);\r
+        i.getItemProperty(CAPTION).setValue(locale.toString());\r
+\r
+    }\r
+\r
+    protected void setDateFieldLocale(Locale value) {\r
+        Component n = getCustomFormats(value);\r
+        if (customFormats == null) {\r
+            addComponent(n);\r
+        } else {\r
+            replaceComponent(customFormats, n);\r
+        }\r
+        customFormats = n;\r
+\r
+    }\r
+\r
+    private GridLayout getCustomFormats(Locale locale) {\r
+        GridLayout gridLayout = createGridLayout();\r
+\r
+        addDateFields(gridLayout, locale);\r
+\r
+        return gridLayout;\r
+    }\r
+\r
+    private GridLayout createGridLayout() {\r
+        GridLayout gridLayout = new GridLayout(3, 4);\r
+        gridLayout.setMargin(true);\r
+        gridLayout.addComponent(new Label("FORMAT"), 0, 0);\r
+        gridLayout.addComponent(new Label("DATEFIELD"), 1, 0);\r
+        gridLayout.addComponent(new Label("EXPECTED"), 2, 0);\r
+\r
+        return gridLayout;\r
+    }\r
+\r
+    private void addDateFields(GridLayout gridLayout, Locale locale) {\r
+        addDateField(gridLayout, "d M yyyy", locale);\r
+        addDateField(gridLayout, "d MM yyyy", locale);\r
+        addDateField(gridLayout, "d MMM yyyy", locale);\r
+        addDateField(gridLayout, "d MMMM yyyy", locale);\r
+\r
+        addDateField(gridLayout, "dd M yyyy", locale);\r
+        addDateField(gridLayout, "ddd M yyyy", locale);\r
+\r
+        addDateField(gridLayout, "d M y", locale);\r
+        addDateField(gridLayout, "d M yy", locale);\r
+        addDateField(gridLayout, "d M yyy", locale);\r
+        addDateField(gridLayout, "d M yyyy", locale);\r
+\r
+        addDateField(gridLayout, getDatePattern(locale, DateFormat.LONG),\r
+                locale);\r
+        addDateField(gridLayout, getDatePattern(locale, DateFormat.MEDIUM),\r
+                locale);\r
+        addDateField(gridLayout, getDatePattern(locale, DateFormat.SHORT),\r
+                locale);\r
+\r
+    }\r
+\r
+    private String getDatePattern(Locale locale, int dateStyle) {\r
+        DateFormat dateFormat = DateFormat.getDateInstance(dateStyle, locale);\r
+\r
+        if (dateFormat instanceof SimpleDateFormat) {\r
+            String pattern = ((SimpleDateFormat) dateFormat).toPattern();\r
+            return pattern;\r
+        }\r
+        return null;\r
+\r
+    }\r
+\r
+    private void addDateField(GridLayout gridLayout, String pattern,\r
+            Locale locale) {\r
+\r
+        SimpleDateFormat dateFormat = new SimpleDateFormat(pattern, locale);\r
+        Calendar cal = Calendar.getInstance();\r
+        cal.set(2010, 1, 1);\r
+\r
+        DateField df = new DateField();\r
+        df.setResolution(DateField.RESOLUTION_DAY);\r
+        df.setLocale(locale);\r
+        df.setWidth("300px");\r
+        df.setDateFormat(pattern);\r
+\r
+        df.setValue(cal.getTime());\r
+\r
+        Label patternLabel = new Label(pattern);\r
+        patternLabel.setWidth(null);\r
+        Label expectedLabel = new Label(dateFormat.format(cal.getTime()));\r
+        expectedLabel.setWidth(null);\r
+\r
+        gridLayout.addComponent(patternLabel);\r
+        gridLayout.addComponent(df);\r
+        gridLayout.addComponent(expectedLabel);\r
+    }\r
+\r
+    @Override\r
+    protected String getDescription() {\r
+        return "Test that DateField renders custom date formats the same way as SimpleDateFormat formats them";\r
+    }\r
+\r
+    @Override\r
+    protected Integer getTicketNumber() {\r
+        return 5465;\r
+    }\r
+}
\ No newline at end of file