summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2010-03-12 14:07:04 +0000
committerArtur Signell <artur.signell@itmill.com>2010-03-12 14:07:04 +0000
commit62edab4f4a3cdf7f90c88bec4094efa231c86089 (patch)
tree466f0a553598212aed53f32fc7ceb7d8e0ba0a96 /tests
parentb924ba2d32d57098433dbb07b111a642b2c37e19 (diff)
downloadvaadin-framework-62edab4f4a3cdf7f90c88bec4094efa231c86089.tar.gz
vaadin-framework-62edab4f4a3cdf7f90c88bec4094efa231c86089.zip
Test case for #3935
svn changeset:11824/svn branch:6.3
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/vaadin/tests/components/datefield/DateFieldLocale.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/datefield/DateFieldLocale.java b/tests/src/com/vaadin/tests/components/datefield/DateFieldLocale.java
new file mode 100644
index 0000000000..4857461242
--- /dev/null
+++ b/tests/src/com/vaadin/tests/components/datefield/DateFieldLocale.java
@@ -0,0 +1,47 @@
+package com.vaadin.tests.components.datefield;
+
+import java.util.Date;
+import java.util.Locale;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.DateField;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+
+public class DateFieldLocale extends TestBase {
+
+ @Override
+ public void setup() {
+ final DateField dateField = new DateField("DateField");
+ dateField.setLocale(new Locale("fi", "FI"));
+ dateField.setCaption(dateField.getLocale().toString());
+ dateField.setValue(new Date());
+ dateField.setResolution(DateField.RESOLUTION_DAY);
+
+ addComponent(new Button("Change locale", new ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ if (dateField.getLocale().getCountry().equalsIgnoreCase("fi")) {
+ dateField.setLocale(new Locale("zh", "CN"));
+ } else {
+ dateField.setLocale(new Locale("fi", "FI"));
+ }
+ dateField.setCaption(dateField.getLocale().toString());
+ }
+ }));
+
+ addComponent(dateField);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Click change locale to switch between Finnish and Chinese locale for the DateField. The date string should be updated in addition to the caption.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 3935;
+ }
+
+}