diff options
author | Leif Åstrand <leif@vaadin.com> | 2013-06-11 13:21:09 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2013-06-11 13:26:00 +0300 |
commit | 5793a1c3a2da2c9771bd1721483a4689100d4bc3 (patch) | |
tree | 80033110c7525d1f11c16bd4349d3c70eafaeb5b /server/tests | |
parent | a0182a017b97847f88338a6e721e98327ca0d20b (diff) | |
download | vaadin-framework-5793a1c3a2da2c9771bd1721483a4689100d4bc3.tar.gz vaadin-framework-5793a1c3a2da2c9771bd1721483a4689100d4bc3.zip |
Make VaadinServlet use enclosing UI class by default (#12039)
Change-Id: Ica2b9b9d82ef6d683cb51f3478a07e57cbfa28e5
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/src/com/vaadin/server/VaadinServletConfigurationTest.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/server/tests/src/com/vaadin/server/VaadinServletConfigurationTest.java b/server/tests/src/com/vaadin/server/VaadinServletConfigurationTest.java index 80cb1d7b0c..d347534f5c 100644 --- a/server/tests/src/com/vaadin/server/VaadinServletConfigurationTest.java +++ b/server/tests/src/com/vaadin/server/VaadinServletConfigurationTest.java @@ -32,10 +32,17 @@ import org.junit.Test; import com.vaadin.annotations.VaadinServletConfiguration; import com.vaadin.server.DeploymentConfiguration.LegacyProperyToStringMode; import com.vaadin.server.VaadinServletConfigurationTest.MockUI; +import com.vaadin.server.VaadinServletConfigurationTest.MockUI.ServletInUI; import com.vaadin.ui.UI; public class VaadinServletConfigurationTest { public static class MockUI extends UI { + + public static class ServletInUI extends VaadinServlet { + // This servlet should automatically be configured to use the + // enclosing UI class + } + @Override protected void init(VaadinRequest request) { // Do nothing @@ -43,6 +50,18 @@ public class VaadinServletConfigurationTest { } @Test + public void testEnclosingUIClass() throws Exception { + ServletInUI servlet = new MockUI.ServletInUI(); + servlet.init(new MockServletConfig()); + + Class<? extends UI> uiClass = new DefaultUIProvider() + .getUIClass(new UIClassSelectionEvent(new VaadinServletRequest( + EasyMock.createMock(HttpServletRequest.class), servlet + .getService()))); + Assert.assertEquals(MockUI.class, uiClass); + } + + @Test public void testValuesFromAnnotation() throws ServletException { TestServlet servlet = new TestServlet(); servlet.init(new MockServletConfig()); |