diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-10-16 16:46:45 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-10-16 16:46:45 +0300 |
commit | ebd86a653a5d646e7d41da4ac7a42a0add1e2fcb (patch) | |
tree | cca84debb9f62d84e7d72e0c26b8b1f765141758 /uitest/src/com | |
parent | ed8f82e6ab390a4139af8440896ee9574a734894 (diff) | |
download | vaadin-framework-ebd86a653a5d646e7d41da4ac7a42a0add1e2fcb.tar.gz vaadin-framework-ebd86a653a5d646e7d41da4ac7a42a0add1e2fcb.zip |
Don't let /APP requests continue to the BootstrapHandler (#9553)7.0.0.beta5
* Change ApplicationConstants.APP_REQUEST_PATH to not include an ending
slash so it can be used by the new check as well.
Change-Id: If613e339b0e1ef4fd9e4f07d7567cd381678b912
Diffstat (limited to 'uitest/src/com')
-rw-r--r-- | uitest/src/com/vaadin/tests/requesthandlers/AppResource404.html | 24 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/requesthandlers/AppResource404.java | 13 |
2 files changed, 29 insertions, 8 deletions
diff --git a/uitest/src/com/vaadin/tests/requesthandlers/AppResource404.html b/uitest/src/com/vaadin/tests/requesthandlers/AppResource404.html index da050b3aaa..16f3db6a1a 100644 --- a/uitest/src/com/vaadin/tests/requesthandlers/AppResource404.html +++ b/uitest/src/com/vaadin/tests/requesthandlers/AppResource404.html @@ -38,7 +38,7 @@ </tr> <tr> <td>assertTextPresent</td> - <td>RequestURI=/run/com.vaadin.tests.requesthandlers.AppResource404/APP/12341234/</td> + <td>/APP/connector/0/4/asdfasdf can not be found</td> <td></td> </tr> <tr> @@ -47,18 +47,28 @@ <td></td> </tr> <tr> - <td>click</td> - <td>vaadin=runcomvaadintestsrequesthandlersAppResource404::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td>mouseClickAndWait</td> + <td>vaadin=runcomvaadintestsrequesthandlersAppResource404::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VLink[0]/domChild[0]/domChild[0]</td> + <td>97,5</td> +</tr> +<tr> + <td>assertTextPresent</td> + <td>/APP can not be found</td> + <td></td> +</tr> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.requesthandlers.AppResource404</td> <td></td> </tr> <tr> <td>mouseClickAndWait</td> - <td>vaadin=runcomvaadintestsrequesthandlersAppResource404::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLink[0]/domChild[0]/domChild[0]</td> - <td>47,9</td> + <td>vaadin=runcomvaadintestsrequesthandlersAppResource404::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VLink[0]/domChild[0]/domChild[0]</td> + <td>99,7</td> </tr> <tr> - <td>assertTextPresent</td> - <td>RequestURI=/run/com.vaadin.tests.requesthandlers.AppResource404/APP/1//com/vaadin/tests/integration/se.gif</td> + <td>assertTextNotPresent</td> + <td>can not be found</td> <td></td> </tr> </tbody></table> diff --git a/uitest/src/com/vaadin/tests/requesthandlers/AppResource404.java b/uitest/src/com/vaadin/tests/requesthandlers/AppResource404.java index ebccba74fb..dfd664c9cf 100644 --- a/uitest/src/com/vaadin/tests/requesthandlers/AppResource404.java +++ b/uitest/src/com/vaadin/tests/requesthandlers/AppResource404.java @@ -1,6 +1,9 @@ package com.vaadin.tests.requesthandlers; +import javax.servlet.http.HttpServletRequest; + import com.vaadin.server.ExternalResource; +import com.vaadin.server.VaadinServletService; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.integration.FlagSeResource; import com.vaadin.ui.Link; @@ -13,9 +16,17 @@ public class AppResource404 extends TestBase { final FlagSeResource resource = new FlagSeResource(); resource.setCacheTime(0); + HttpServletRequest request = VaadinServletService + .getCurrentServletRequest(); + String baseUrl = request.getContextPath() + request.getServletPath(); + addComponent(new Link("Existing resource", resource)); addComponent(new Link("Non-existing resource", new ExternalResource( - getURL().toString() + "APP/12341234/"))); + baseUrl + "/APP/connector/0/4/asdfasdf"))); + addComponent(new Link("/APP url that should give 404", + new ExternalResource(baseUrl + "/APP"))); + addComponent(new Link("/APPLE url that should go to UI providers", + new ExternalResource(baseUrl + "/APPLE"))); } @Override |