aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldLocaleTest.java
diff options
context:
space:
mode:
authorPatrik Lindström <patrik@vaadin.com>2013-07-03 00:04:35 +0300
committerPatrik Lindström <patrik@vaadin.com>2013-07-04 14:03:38 +0300
commitae565a229325f1289348c2c0e3dc02f14ed6f549 (patch)
tree873ab41a1f9077dc59555b9213ecb2cfc22d3490 /uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldLocaleTest.java
parent9a9b0a518000d2c765917e83ccf798dfa3e4c72a (diff)
downloadvaadin-framework-ae565a229325f1289348c2c0e3dc02f14ed6f549.tar.gz
vaadin-framework-ae565a229325f1289348c2c0e3dc02f14ed6f549.zip
Fix bug in PopupDateField where locale was retained incorrectly if
changed while popup was open (#12153) Change-Id: Ib4bebab8c6e75e7f1af7cfc5198ab6516e94a45e
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldLocaleTest.java')
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldLocaleTest.java53
1 files changed, 53 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldLocaleTest.java b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldLocaleTest.java
new file mode 100644
index 0000000000..f12a3dda58
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldLocaleTest.java
@@ -0,0 +1,53 @@
+package com.vaadin.tests.components.datefield;
+
+import java.util.Calendar;
+import java.util.Locale;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.DateField;
+import com.vaadin.ui.PopupDateField;
+
+public class PopupDateFieldLocaleTest extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ // Set a specific time for the PopupDateField
+ Calendar cal = Calendar.getInstance();
+ cal.set(Calendar.YEAR, 2000);
+ cal.set(Calendar.DAY_OF_YEAR, 1);
+ cal.set(Calendar.HOUR_OF_DAY, 1);
+ cal.set(Calendar.MINUTE, 1);
+ cal.set(Calendar.SECOND, 1);
+ cal.set(Calendar.MILLISECOND, 1);
+
+ final PopupDateField pdf = new PopupDateField();
+ pdf.setLocale(Locale.ENGLISH);
+ pdf.setValue(cal.getTime());
+ pdf.setImmediate(true);
+ pdf.setResolution(DateField.RESOLUTION_SEC);
+ addComponent(pdf);
+
+ pdf.addValueChangeListener(new ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ pdf.setLocale(Locale.FRENCH);
+ }
+ });
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Changing the locale while the popupdatefield is visible can "
+ + "result in the locale remaining at the previous value; the locale "
+ + "is only changed once the current month is changed.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 12135;
+ }
+
+} \ No newline at end of file