diff options
author | Artur Signell <artur@vaadin.com> | 2015-06-24 23:28:22 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2015-06-25 19:45:30 +0300 |
commit | 10e7a466bc936737b81005cb50d90c8bc8ca49bd (patch) | |
tree | 81dfcfafb2c8a14eab90a4bb12c0fdac48d7563a /uitest/src | |
parent | 7552e9c4aa3c5bb7e7a4e5cfe50f4829a7c452af (diff) | |
download | vaadin-framework-10e7a466bc936737b81005cb50d90c8bc8ca49bd.tar.gz vaadin-framework-10e7a466bc936737b81005cb50d90c8bc8ca49bd.zip |
Pass critical notification details to the client (#18342)
Change-Id: I3c4eace624453eb854a32fef5fe44d253b164f62
Diffstat (limited to 'uitest/src')
-rw-r--r-- | uitest/src/com/vaadin/tests/application/CriticalNotifications.java | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/uitest/src/com/vaadin/tests/application/CriticalNotifications.java b/uitest/src/com/vaadin/tests/application/CriticalNotifications.java index bde3fbaf6f..14b4cb62e9 100644 --- a/uitest/src/com/vaadin/tests/application/CriticalNotifications.java +++ b/uitest/src/com/vaadin/tests/application/CriticalNotifications.java @@ -26,16 +26,21 @@ import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.CheckBox; public class CriticalNotifications extends AbstractTestUI { private SystemMessages systemMessages; + private CheckBox includeDetails; @Override protected void setup(VaadinRequest request) { systemMessages = VaadinService.getCurrent().getSystemMessages( getLocale(), request); + includeDetails = new CheckBox("Include details"); + addComponent(includeDetails); + Button sessionExpired = new Button("Session expired"); addComponent(sessionExpired); sessionExpired.addClickListener(new ClickListener() { @@ -43,7 +48,8 @@ public class CriticalNotifications extends AbstractTestUI { public void buttonClick(ClickEvent event) { showCriticalNotification( systemMessages.getSessionExpiredCaption(), - systemMessages.getSessionExpiredMessage(), null, + systemMessages.getSessionExpiredMessage(), + getDetailsMessage(), systemMessages.getSessionExpiredURL()); } @@ -56,7 +62,8 @@ public class CriticalNotifications extends AbstractTestUI { public void buttonClick(ClickEvent event) { showCriticalNotification( systemMessages.getAuthenticationErrorCaption(), - systemMessages.getAuthenticationErrorMessage(), null, + systemMessages.getAuthenticationErrorMessage(), + getDetailsMessage(), systemMessages.getAuthenticationErrorURL()); } @@ -69,7 +76,8 @@ public class CriticalNotifications extends AbstractTestUI { public void buttonClick(ClickEvent event) { showCriticalNotification( systemMessages.getCommunicationErrorCaption(), - systemMessages.getCommunicationErrorMessage(), null, + systemMessages.getCommunicationErrorMessage(), + getDetailsMessage(), systemMessages.getCommunicationErrorURL()); } @@ -82,7 +90,8 @@ public class CriticalNotifications extends AbstractTestUI { public void buttonClick(ClickEvent event) { showCriticalNotification( systemMessages.getInternalErrorCaption(), - systemMessages.getInternalErrorMessage(), null, + systemMessages.getInternalErrorMessage(), + getDetailsMessage(), systemMessages.getInternalErrorURL()); } @@ -95,7 +104,8 @@ public class CriticalNotifications extends AbstractTestUI { public void buttonClick(ClickEvent event) { showCriticalNotification( systemMessages.getCookiesDisabledCaption(), - systemMessages.getCookiesDisabledMessage(), null, + systemMessages.getCookiesDisabledMessage(), + getDetailsMessage(), systemMessages.getCookiesDisabledURL()); } @@ -112,6 +122,14 @@ public class CriticalNotifications extends AbstractTestUI { }); } + protected String getDetailsMessage() { + if (includeDetails.getValue()) { + return "Some details for the error"; + } else { + return null; + } + } + protected void showCriticalNotification(String caption, String message, String details, String url) { VaadinService service = VaadinService.getCurrent(); |