diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-09-27 11:40:17 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-09-27 11:40:17 +0300 |
commit | 367c7751a6ff9234fd47bc5a48e6ef9a4117a7a2 (patch) | |
tree | 5b3849bafb37b49c3dcc8616e064f60bd081dff0 /server/src/test/java/com/vaadin/ui/UIInitRefreshTest.java | |
parent | 69776b1d08d40bcdd89b9cc5b050e8db793ec06b (diff) | |
download | vaadin-framework-367c7751a6ff9234fd47bc5a48e6ef9a4117a7a2.tar.gz vaadin-framework-367c7751a6ff9234fd47bc5a48e6ef9a4117a7a2.zip |
Add option to use PushState instead of URI fragments in Navigator (#10042)
* Navigator now by default uses pushState and normal URLs
* added documentation for pushState and updated Navigator documentation
* improving docs etc, adding one TODO to be solved before merging
* pushState/replaceState no work better with changing titles
* Making uri fragment navigator work when not using specially mapped UI
* Revert to older default, add annotation for selecting
* Fix tests, add null checks
* Reorder if-clause, fix tests
* Revert unnecessary test change
* Use correct variable in UI, fix test clean up
* Updates to JavaDocs, fix some methods and tests
* Add comments, fix test ui, TODO for fallbacks
* Navigation documentation, JavaDocs, removed TODOs
* Documentation fixes
* Improve JavaDocs
* Fix link name in documentation
* Improve throws declaration in getLocation
* Change documentation about the PushState based navigation
* Add since tags
* Add since tags for UI
Diffstat (limited to 'server/src/test/java/com/vaadin/ui/UIInitRefreshTest.java')
-rw-r--r-- | server/src/test/java/com/vaadin/ui/UIInitRefreshTest.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/server/src/test/java/com/vaadin/ui/UIInitRefreshTest.java b/server/src/test/java/com/vaadin/ui/UIInitRefreshTest.java index c4a44d85a6..65bbc59a5b 100644 --- a/server/src/test/java/com/vaadin/ui/UIInitRefreshTest.java +++ b/server/src/test/java/com/vaadin/ui/UIInitRefreshTest.java @@ -15,17 +15,21 @@ */ package com.vaadin.ui; +import java.util.Locale; + import org.easymock.EasyMock; import org.easymock.IMocksControl; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import com.vaadin.server.DeploymentConfiguration; import com.vaadin.server.Page.BrowserWindowResizeEvent; import com.vaadin.server.Page.BrowserWindowResizeListener; import com.vaadin.server.Page.UriFragmentChangedEvent; import com.vaadin.server.Page.UriFragmentChangedListener; import com.vaadin.server.VaadinRequest; +import com.vaadin.server.VaadinSession; public class UIInitRefreshTest { @@ -87,6 +91,7 @@ public class UIInitRefreshTest { IMocksControl control = EasyMock.createNiceControl(); VaadinRequest initRequest = control.createMock(VaadinRequest.class); + EasyMock.expect(initRequest.getParameter("v-loc")) .andReturn("http://example.com/#foo"); EasyMock.expect(initRequest.getParameter("v-cw")).andReturn("100"); @@ -98,9 +103,18 @@ public class UIInitRefreshTest { EasyMock.expect(reinitRequest.getParameter("v-cw")).andReturn("200"); EasyMock.expect(reinitRequest.getParameter("v-ch")).andReturn("200"); + VaadinSession session = control.createMock(VaadinSession.class); + DeploymentConfiguration dc = control + .createMock(DeploymentConfiguration.class); + + EasyMock.expect(session.hasLock()).andStubReturn(true); + EasyMock.expect(session.getConfiguration()).andStubReturn(dc); + EasyMock.expect(session.getLocale()).andStubReturn(Locale.getDefault()); + control.replay(); UI ui = new TestUI(); + ui.setSession(session); ui.doInit(initRequest, 0, ""); Assert.assertTrue(initCalled); |