diff options
author | Artur <artur@vaadin.com> | 2017-01-02 11:10:33 +0200 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2017-01-02 11:10:33 +0200 |
commit | 86ed6cc475d9e9ee79fee4f2340c271ffa5c702e (patch) | |
tree | 94ee81c7c0747a53cc526d93ac5614a59326de90 /uitest | |
parent | 04febccaad259f78916cce6c447707dc3e1eb83d (diff) | |
download | vaadin-framework-86ed6cc475d9e9ee79fee4f2340c271ffa5c702e.tar.gz vaadin-framework-86ed6cc475d9e9ee79fee4f2340c271ffa5c702e.zip |
Call error handler for exceptions in UI.init() (#8055)
Fixes #4995
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/ui/UIInitException.java | 10 | ||||
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/components/ui/UIInitExceptionTest.java | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/ui/UIInitException.java b/uitest/src/main/java/com/vaadin/tests/components/ui/UIInitException.java index d5f26ade29..fa25d7e837 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/ui/UIInitException.java +++ b/uitest/src/main/java/com/vaadin/tests/components/ui/UIInitException.java @@ -1,12 +1,22 @@ package com.vaadin.tests.components.ui; +import com.vaadin.server.ErrorHandler; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Label; public class UIInitException extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { + setErrorHandler(new ErrorHandler() { + @Override + public void error(com.vaadin.server.ErrorEvent event) { + addComponent(new Label("An exception occurred: " + + event.getThrowable().getMessage())); + + } + }); throw new RuntimeException("Catch me if you can"); } diff --git a/uitest/src/test/java/com/vaadin/tests/components/ui/UIInitExceptionTest.java b/uitest/src/test/java/com/vaadin/tests/components/ui/UIInitExceptionTest.java index c1d6aaa55b..064132d4c7 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/ui/UIInitExceptionTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/ui/UIInitExceptionTest.java @@ -3,9 +3,9 @@ package com.vaadin.tests.components.ui; import org.junit.Assert; import org.junit.Test; -import com.vaadin.tests.tb3.MultiBrowserTest; +import com.vaadin.tests.tb3.SingleBrowserTest; -public class UIInitExceptionTest extends MultiBrowserTest { +public class UIInitExceptionTest extends SingleBrowserTest { @Test public void testExceptionOnUIInit() throws Exception { openTestURL(); |