diff options
author | Leif Åstrand <leif@vaadin.com> | 2013-06-07 14:12:41 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2013-06-07 14:12:41 +0300 |
commit | 808b65581554dad8b670538b1830a8f90b3db5db (patch) | |
tree | f2323317e420e7c76b17994660cdbbd0f78145b4 /uitest/src/com/vaadin/tests/components/datefield/DynamicallyChangeDateRange.java | |
parent | fe8d330c3c9f2ae2c0ace28fa5c34e5b2b131112 (diff) | |
parent | b0574f7b33c4d3d437c8c11cd53389e5522f6999 (diff) | |
download | vaadin-framework-808b65581554dad8b670538b1830a8f90b3db5db.tar.gz vaadin-framework-808b65581554dad8b670538b1830a8f90b3db5db.zip |
Merge changes from origin/7.1
2772641 OSGi support for vaadin-push (#11691)
42c4b20 Use "\0" instead of "|" as a push message delimiter (#11692)
778de06 Derive current servlet/portlet from the current service (#11779)
f8fb8b7 Upgrade to Atmosphere 1.0.13 (#11861)
fea4c5e Don't build and publish sources for package without source files
6a7683b Disable Atmosphere version number check (#11890)
ebb92e6 Improve error message if vaadinPush.js failed to load (#11673)
70131cd Extracted common code for number conveters to abstract super class (#11900)
0b63506 Fixed order of parameters in javadoc (#11158)
6bf83a4 Modified the logic in setPropertyDatasource which determines if a new converter is needed (#11863)
53a9c11 Fix TestingPushConnection.init signature (#11673)
05ef43f Updated client-compiler to depend on client-compiler-deps 1.0.2 #11879
9686323 Added isInitialStateChange to StateChangeEvent (#10477)
7cced5e Fixed test which had never passed
ada3311 Avoid creating an instance of every view while searching for the correct view (#11722)
5b35dd9 Added text file encoding and line delimiter info (#11907)
f8c4f99 Prevent spurious "Could not determine ApplicationConnection" error when using the debug window
8a42394 Fixed locators in test (aria div conflict)
6de01ac Fix text / javascript mismatch issue in Chrome (#11275)
f7f1e3e Added Java Date to Sql Date converter to better support sql dates (#11224)
2882cf9 Added Serializable where missing and ignore classes which do not need Serializable
4d7f190 Make access() enqueue the runnable if the session is locked (#11897)
4c2b86d Stop using PlaceHolder widgets in VTabsheet (#11026)
87018cd Add missing license header
cb1f63b Send window mode changes to the server immediately (#11737)
e52df7c Added ComponentConnector.isAttached (#11928)
2b5ba96 Define how CurrentInstance works with access() (#11897)
d345838 Remove ThreadLocal references from CurrentInstance (#11914)
bb7b404 Remove outdated testing (#11897)
f64d944 Merge "event not reported as target when context clicking in month view" to Vaadin 7.1 (#10217)
51c9fb5 Fix debug window SEVERE style, add styles for FINE, FINER and FINEST (#11891)
3b888fe Support nested SASS imports (#11909)
b2137f5 Ensure calendar panel is updated when range changes (#11940)
f8319eb Avoid deadlock checking in runPendingAccessTasks() (#11897)
51a98a3 Moved enums to avoid running them as tests
7c613d1 Exclude parsers from checkstyle as they are generated
35f3532 Fixes current text being overwritten in server update on RTA #11741
a744d21 Remove UI.runSafely and VaadinSession.runSafely (#11901)
84edd19 Make test independent of browser language (#11940)
a3ad62d Updated to custom build of Smartsprites 0.2.10 which includes a fix for SMARTSPRITES-36 (#9959)
a9afca6 Moved Locale data handling to LocaleService (#11378)
5e548ae Fixed javadoc compilation error
91182e2 Extract ProgressBar and deprecate ProgressIndicator (#11925)
a5b8209 Add primary style name support for ProgressBar/Indicator (#9913)
86b3689 Make ProgressInidcatorConnector use VProgressIndicator (#11925)
29fcadc Flush the output writer in case of SSE transport as well (#11955)
5e26b0b Fix streaming issue with iOS6 (#11934)
1b274c4 Limit sub window minimum size (#11510)
46cc08b Remove workarounds for broken Timer.cancel in IE (#11872)
d850db6 Add XML formatting instructions (#11956)
9a3dc4e Formatted XML files using defined rules (#11956)
57b7335 Fixed spelling mistake in API #11741
587e10b Fix stale info in javadoc for accessSynchronously (#11897)
36fd94a Remove IE6/IE7 permutation (#11954)
cccff37 Do not log legacy warnings in JUnit tests (#11963)
0f9b689 Throw exception if VaadinService has not been initialized (#11961)
1ed0980 Move ApplicationConnection.setOverlayContainerLabel to VOverlay (#11965)
0014563 Extracted dialog style to a separate block (#11734)
b82e60b Add missing dialog maximize/restore icons for Runo (#11734)
0d046d6 Add a separate debug window section for profiler output (#11950)
03830ae Ignore style resource that has already been added (#11667)
84bf5a7 Enabled drag & drop to Calendar #11048
6c36784 Merge commit '34e6c60a5a746c0306c3a84ae8d6c21dfd84d878' into 7.1
a82d57e Merge changes from origin/7.0
666dbb5 Use window.console instead of just console in vaadinPush to appease IE (#11980)
93751c1 Use correct day names when formatting dates (#6207)
19d0082 Fixed javadoc references
e6e752d Correctly decode summaries containing quotes (#11769)
54ed269 Log stack trace using fine when logging toString warnings
8d655f6 Move VaadinSession.runPendingAccessTasks to VaadinService (#11964)
b1ab27a Update broadcaster tutorial code
e63edcc Update deprecation javadoc for VaadinSession.getBrowser()
132eee5 Add @VaadinServletConfiguration (#11970)
aa99259 Send connector debug (highlight) using RPC (#11536)
6d4582e Change analyze layouts to use RPC (#11536)
6f912b1 Rename tests so they are run during build (Abstract* is ignored)
ebd4a5c Added missing rpc interface (#11536)
edca409 Allow customizing client-side push config on server side (#11867)
b0574f7 Add transport parameter to @Push (#11966)
Change-Id: I4670c783fec829f81890e2d645d93dd40860b909
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/datefield/DynamicallyChangeDateRange.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/datefield/DynamicallyChangeDateRange.java | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/datefield/DynamicallyChangeDateRange.java b/uitest/src/com/vaadin/tests/components/datefield/DynamicallyChangeDateRange.java new file mode 100644 index 0000000000..fb0fb2a546 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/datefield/DynamicallyChangeDateRange.java @@ -0,0 +1,93 @@ +package com.vaadin.tests.components.datefield; + +import java.util.Date; +import java.util.Locale; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.DateField; +import com.vaadin.ui.InlineDateField; +import com.vaadin.ui.PopupDateField; +import com.vaadin.ui.VerticalLayout; + +/** + * Main UI class + */ +@SuppressWarnings("serial") +public class DynamicallyChangeDateRange extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + setLocale(Locale.ENGLISH); + final VerticalLayout layout = new VerticalLayout(); + layout.setMargin(true); + setContent(layout); + + final PopupDateField df = new PopupDateField(); + df.setValue(new Date(2012 - 1900, 5 - 1, 12)); + setRange(df, 5); + layout.addComponent(df); + + final InlineDateField df2 = new InlineDateField(); + df2.setValue(new Date(2012 - 1900, 11 - 1, 16)); + + setRange(df2, 5); + // layout.addComponent(df2); + + Button button1 = new Button("Set Range Now+/-5d"); + button1.addClickListener(new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + setRange(df, 5); + setRange(df2, 5); + } + }); + layout.addComponent(button1); + + Button button2 = new Button("Set Range Now+/-10d"); + button2.addClickListener(new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + setRange(df, 10); + setRange(df2, 10); + } + }); + layout.addComponent(button2); + } + + /** + * @since + * @param df + * @param i + */ + private void setRange(DateField df, int days) { + df.setRangeStart(new Date(df.getValue().getTime() - days * 24 * 60 * 60 + * 1000)); + df.setRangeEnd(new Date(df.getValue().getTime() + days * 24 * 60 * 60 + * 1000)); + + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Verifies that the allowed date range can be updated dynamically"; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 11940; + } + +}
\ No newline at end of file |