aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/tests')
-rw-r--r--uitest/src/com/vaadin/tests/application/RefreshFragmentChange.html37
-rw-r--r--uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java16
2 files changed, 52 insertions, 1 deletions
diff --git a/uitest/src/com/vaadin/tests/application/RefreshFragmentChange.html b/uitest/src/com/vaadin/tests/application/RefreshFragmentChange.html
new file mode 100644
index 0000000000..147e67f19d
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/application/RefreshFragmentChange.html
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.application.RefreshStatePreserve?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::PID_SLog_row_0</td>
+ <td>1. Initial fragment: null</td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.application.RefreshStatePreserve#asdf</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::PID_SLog_row_0</td>
+ <td>2. Fragment changed to asdf</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 c99e384f81..f4d7f2a4e4 100644
--- a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java
+++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java
@@ -1,18 +1,32 @@
package com.vaadin.tests.application;
import com.vaadin.annotations.PreserveOnRefresh;
+import com.vaadin.server.Page.FragmentChangedEvent;
+import com.vaadin.server.Page.FragmentChangedListener;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.tests.util.Log;
import com.vaadin.ui.Label;
@PreserveOnRefresh
public class RefreshStatePreserve extends AbstractTestUI {
+ private Log log = new Log(5);
+
@Override
protected void setup(VaadinRequest request) {
// Internal parameter sent by vaadinBootstrap.js,
addComponent(new Label("window.name: " + request.getParameter("wn")));
addComponent(new Label("UI id: " + getUIId()));
+ addComponent(log);
+
+ log.log("Initial fragment: " + getPage().getFragment());
+ getPage().addFragmentChangedListener(new FragmentChangedListener() {
+ @Override
+ public void fragmentChanged(FragmentChangedEvent event) {
+ log.log("Fragment changed to " + event.getFragment());
+ }
+ });
}
@Override
@@ -24,4 +38,4 @@ public class RefreshStatePreserve extends AbstractTestUI {
protected Integer getTicketNumber() {
return Integer.valueOf(8068);
}
-}
+} \ No newline at end of file