diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-08-31 12:02:51 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-08-31 19:00:00 +0300 |
commit | 8679f49c5e036d39d34a9fca8a907c4d19df21c9 (patch) | |
tree | 9979d5cf330043523e7d68221133bbcd5b3300f5 /server/tests/src/com | |
parent | cf9ab5aea84d2be1686c5f46edd9522cd0750baf (diff) | |
download | vaadin-framework-8679f49c5e036d39d34a9fca8a907c4d19df21c9.tar.gz vaadin-framework-8679f49c5e036d39d34a9fca8a907c4d19df21c9.zip |
Refactor UI bootstrap (#9443)
Diffstat (limited to 'server/tests/src/com')
-rw-r--r-- | server/tests/src/com/vaadin/tests/server/component/root/CustomUIClassLoader.java | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/server/tests/src/com/vaadin/tests/server/component/root/CustomUIClassLoader.java b/server/tests/src/com/vaadin/tests/server/component/root/CustomUIClassLoader.java index 906d6ccebd..89da55a31f 100644 --- a/server/tests/src/com/vaadin/tests/server/component/root/CustomUIClassLoader.java +++ b/server/tests/src/com/vaadin/tests/server/component/root/CustomUIClassLoader.java @@ -10,7 +10,6 @@ import org.easymock.EasyMock; import com.vaadin.Application; import com.vaadin.Application.ApplicationStartEvent; -import com.vaadin.UIRequiresMoreInformationException; import com.vaadin.server.DefaultUIProvider; import com.vaadin.server.DeploymentConfiguration; import com.vaadin.server.WrappedRequest; @@ -56,8 +55,11 @@ public class CustomUIClassLoader extends TestCase { application.start(new ApplicationStartEvent(null, createConfigurationMock(), null)); - UI uI = application.getUIForRequest(createRequestMock(null)); - assertTrue(uI instanceof MyUI); + DefaultUIProvider uiProvider = new DefaultUIProvider(); + Class<? extends UI> uiClass = uiProvider.getUIClass(application, + createRequestMock(null)); + + assertEquals(MyUI.class, uiClass); } private static DeploymentConfiguration createConfigurationMock() { @@ -101,9 +103,11 @@ public class CustomUIClassLoader extends TestCase { application.start(new ApplicationStartEvent(null, createConfigurationMock(), null)); - UI uI = application - .getUIForRequest(createRequestMock(loggingClassLoader)); - assertTrue(uI instanceof MyUI); + DefaultUIProvider uiProvider = new DefaultUIProvider(); + Class<? extends UI> uiClass = uiProvider.getUIClass(application, + createRequestMock(loggingClassLoader)); + + assertEquals(MyUI.class, uiClass); assertEquals(1, loggingClassLoader.requestedClasses.size()); assertEquals(MyUI.class.getName(), loggingClassLoader.requestedClasses.get(0)); @@ -112,10 +116,6 @@ public class CustomUIClassLoader extends TestCase { private Application createStubApplication() { return new Application() { - { - addUIProvider(new DefaultUIProvider()); - } - @Override public String getProperty(String name) { if (name.equals(UI_PARAMETER)) { @@ -124,14 +124,6 @@ public class CustomUIClassLoader extends TestCase { return super.getProperty(name); } } - - @Override - public UI getUIForRequest(WrappedRequest request) - throws UIRequiresMoreInformationException { - // Always create a new root for testing (can't directly use - // getRoot as it's protected) - return getUI(request); - } }; } } |