]> source.dussan.org Git - vaadin-framework.git/commitdiff
Date/time issues are fixed in the tests.
authorDenis Anisimov <denis@vaadin.com>
Mon, 31 Oct 2016 07:10:02 +0000 (09:10 +0200)
committerDenis Anisimov <denis@vaadin.com>
Mon, 31 Oct 2016 07:10:02 +0000 (09:10 +0200)
- legacy DateField declarative format tests are fixed (day light saving
time is taken into account).
- CalendarMonthViewDndEvent UI because you are not supposed to work on
Sundays (when the test is broken).

Change-Id: If7ddf238a7fab104514211df4a12fa6d071f5af2

compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/datefield/LegacyDateFieldDeclarativeTest.java
uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarMonthViewDndEvent.java

index e9b7ac79598ca91ed0bf6553fa6cd1da923d4b96..d55825aa08d66b0cf55cd36d345f98d3617844ed 100644 (file)
@@ -46,7 +46,8 @@ public class LegacyDateFieldDeclarativeTest
     }
 
     private String getTimezoneDesign() {
-        String timeZone = new SimpleDateFormat("Z").format(new Date());
+        String timeZone = new SimpleDateFormat("Z")
+                .format(new Date(2014 - 1900, 5 - 1, 5));
         return String.format(
                 "<vaadin7-date-field range-start=\"2014-05-05 00:00:00%1$s\" range-end=\"2014-06-05 00:00:00%1$s\" date-out-of-range-message=\"Please select a sensible date\" date-format=\"yyyy-MM-dd\" lenient show-iso-week-numbers parse-error-message=\"You are doing it wrong\" time-zone=\"GMT+05:00\" value=\"2014-05-15 00:00:00%1$s\"/>",
                 timeZone);
index 09739f1f730f6406117291257151c2e168a11284..2300268f1a00816b7d5fc705ce971ea7a06bbf86 100644 (file)
@@ -40,6 +40,11 @@ public class CalendarMonthViewDndEvent extends AbstractReindeerTestUI {
     protected void setup(VaadinRequest request) {
         final Calendar calendar = new Calendar("Test calendar");
         final java.util.Calendar cal = getAdjustedCalendar();
+        if (cal.get(
+                java.util.Calendar.DAY_OF_WEEK) == java.util.Calendar.SUNDAY) {
+            // don't use Sunday: no space to move event on the left
+            cal.add(java.util.Calendar.DAY_OF_MONTH, 1);
+        }
 
         Date from = cal.getTime();