summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2015-06-24 23:28:22 +0300
committerHenri Sara <hesara@vaadin.com>2015-07-04 13:22:49 +0300
commita827e893579a646f518bfd0abd93bbb771d73b2e (patch)
treeceff5d8621055a4177b1674781b17c431de37f80 /uitest
parentf68f1d058d600f2802d60a72227514c66f2b2a51 (diff)
downloadvaadin-framework-a827e893579a646f518bfd0abd93bbb771d73b2e.tar.gz
vaadin-framework-a827e893579a646f518bfd0abd93bbb771d73b2e.zip
Pass critical notification details to the client (#18342)
Change-Id: I50fbbd0f3e6589d144b733c5f08f5a625acfc1e6
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/application/CriticalNotifications.java28
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();