diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-09-05 15:42:02 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-09-05 15:42:02 +0300 |
commit | de3ac989c85451767510917822463353bcab71cd (patch) | |
tree | 48a991db5d3a700e99e37d53df4fa7902bbb780b /uitest/src/com/vaadin/tests/application | |
parent | 8bdaf8732e660d1b9595c9d503999022320b0314 (diff) | |
download | vaadin-framework-de3ac989c85451767510917822463353bcab71cd.tar.gz vaadin-framework-de3ac989c85451767510917822463353bcab71cd.zip |
Change LegacyApplication to be a UIProvider (#9402)
Diffstat (limited to 'uitest/src/com/vaadin/tests/application')
4 files changed, 26 insertions, 56 deletions
diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.html b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.html index 47e766e76a..ea8c0c93b6 100644 --- a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.html +++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.html @@ -18,7 +18,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td> + <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[1]</td> <td>UI id: 0</td> </tr> <tr> @@ -28,7 +28,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td> + <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[1]</td> <td>UI id: 0</td> </tr> <tr> @@ -43,10 +43,9 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td> + <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[1]</td> <td>UI id: 0</td> </tr> - </tbody></table> </body> </html> diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java index 8962f5de9a..13ceceab6c 100644 --- a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java +++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java @@ -1,35 +1,18 @@ package com.vaadin.tests.application; -import com.vaadin.Application; import com.vaadin.annotations.PreserveOnRefresh; -import com.vaadin.server.AbstractUIProvider; import com.vaadin.server.WrappedRequest; -import com.vaadin.tests.components.AbstractTestApplication; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Label; -import com.vaadin.ui.UI; -public class RefreshStatePreserve extends AbstractTestApplication { - @PreserveOnRefresh - public static class RefreshStateUI extends UI { - @Override - public void init(WrappedRequest request) { - getContent().addComponent( - new Label("window.name: " - + request.getBrowserDetails().getWindowName())); - getContent().addComponent(new Label("UI id: " + getUIId())); - } - } +@PreserveOnRefresh +public class RefreshStatePreserve extends AbstractTestUI { @Override - public void init() { - super.init(); - addUIProvider(new AbstractUIProvider() { - @Override - public Class<? extends UI> getUIClass(Application application, - WrappedRequest request) { - return RefreshStateUI.class; - } - }); + protected void setup(WrappedRequest request) { + addComponent(new Label("window.name: " + + request.getBrowserDetails().getWindowName())); + addComponent(new Label("UI id: " + getUIId())); } @Override diff --git a/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.html b/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.html index b7fbca4c04..0d3a746152 100644 --- a/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.html +++ b/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.html @@ -29,7 +29,7 @@ <tr> <td>assertText</td> <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_15</td> - <td>1. null app in class init</td> + <td>1. some app in class init</td> </tr> <tr> <td>assertText</td> @@ -39,7 +39,7 @@ <tr> <td>assertText</td> <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_13</td> - <td>3. null app in app constructor</td> + <td>3. some app in app constructor</td> </tr> <tr> <td>assertText</td> @@ -49,7 +49,7 @@ <tr> <td>assertText</td> <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_11</td> - <td>5. this app in app init</td> + <td>5. some app in app init</td> </tr> <tr> <td>assertText</td> @@ -59,7 +59,7 @@ <tr> <td>assertText</td> <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_9</td> - <td>7. this app in root init</td> + <td>7. some app in root init</td> </tr> <tr> <td>assertText</td> @@ -69,7 +69,7 @@ <tr> <td>assertText</td> <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_7</td> - <td>9. this app in root paint</td> + <td>9. some app in root paint</td> </tr> <tr> <td>assertText</td> @@ -79,7 +79,7 @@ <tr> <td>assertText</td> <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_5</td> - <td>11. this app in background thread</td> + <td>11. some app in background thread</td> </tr> <tr> <td>assertText</td> @@ -89,7 +89,7 @@ <tr> <td>assertText</td> <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_3</td> - <td>13. this app in resource handler</td> + <td>13. some app in resource handler</td> </tr> <tr> <td>assertText</td> @@ -99,7 +99,7 @@ <tr> <td>assertText</td> <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_1</td> - <td>15. this app in button listener</td> + <td>15. some app in button listener</td> </tr> <tr> <td>assertText</td> diff --git a/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java b/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java index bad5b53478..1eda9e54fe 100644 --- a/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java +++ b/uitest/src/com/vaadin/tests/application/ThreadLocalInstances.java @@ -1,24 +1,24 @@ package com.vaadin.tests.application; import com.vaadin.Application; -import com.vaadin.server.AbstractUIProvider; import com.vaadin.server.DownloadStream; import com.vaadin.server.PaintException; import com.vaadin.server.WrappedRequest; -import com.vaadin.tests.components.AbstractTestApplication; +import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.tests.integration.FlagSeResource; import com.vaadin.tests.util.Log; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Embedded; import com.vaadin.ui.UI; +import com.vaadin.ui.UI.LegacyWindow; -public class ThreadLocalInstances extends AbstractTestApplication { +public class ThreadLocalInstances extends AbstractTestCase { private static final Application staticInitApplication = Application .getCurrent(); private static final UI staticInitRoot = UI.getCurrent(); - private final UI mainWindow = new UI() { + private final LegacyWindow mainWindow = new LegacyWindow() { boolean paintReported = false; @Override @@ -71,25 +71,13 @@ public class ThreadLocalInstances extends AbstractTestApplication { } @Override - public void init() { + protected void init() { reportCurrentStatus("app init"); - addUIProvider(new AbstractUIProvider() { - @Override - public UI createInstance(Application application, - Class<? extends UI> type, WrappedRequest request) { - return mainWindow; - } - - @Override - public Class<? extends UI> getUIClass(Application application, - WrappedRequest request) { - return mainWindow.getClass(); - } - }); + setMainWindow(mainWindow); } @Override - protected String getTestDescription() { + protected String getDescription() { return "Tests the precence of Application.getCurrentApplication() and UI.getCurrentRoot() from different contexts"; } @@ -113,7 +101,7 @@ public class ThreadLocalInstances extends AbstractTestApplication { } else if (value == reference) { return "this"; } else { - return value.toString(); + return "some"; } } |