summaryrefslogtreecommitdiffstats
path: root/server/tests
diff options
context:
space:
mode:
authorMatti Tahvonen <matti@vaadin.com>2015-06-04 13:38:27 +0300
committerMarkus Koivisto <markus@vaadin.com>2015-10-09 07:14:25 +0000
commita0637c8feb47dc4d83ce976a7c1db769238a6c95 (patch)
treeb1893c2ff4b82e9261a2e2de747bb9d5719eb1f4 /server/tests
parent025f3b2b2581c64b86b93cda26305eaa7fffc8cc (diff)
downloadvaadin-framework-a0637c8feb47dc4d83ce976a7c1db769238a6c95.tar.gz
vaadin-framework-a0637c8feb47dc4d83ce976a7c1db769238a6c95.zip
Correct the place where attach events are fired (#16348)
Change-Id: Ib0679cf893edda3206b858938c0684a242500cfb
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/src/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java41
1 files changed, 27 insertions, 14 deletions
diff --git a/server/tests/src/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java b/server/tests/src/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java
index 68964dbfd1..28c5be29cb 100644
--- a/server/tests/src/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java
+++ b/server/tests/src/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java
@@ -58,7 +58,15 @@ public class AttachDetachListenersTest {
@Test
public void attachListeners_setSessionLast() {
- setupAttachListeners();
+ attachListener.attach(eventEquals(new AttachEvent(component)));
+ attachListener.attach(eventEquals(new AttachEvent(content)));
+ attachListener.attach(eventEquals(new AttachEvent(ui)));
+
+ control.replay();
+
+ ui.addAttachListener(attachListener);
+ content.addAttachListener(attachListener);
+ component.addAttachListener(attachListener);
ui.setContent(content);
content.addComponent(component);
@@ -69,7 +77,15 @@ public class AttachDetachListenersTest {
@Test
public void attachListeners_setSessionFirst() {
- setupAttachListeners();
+ attachListener.attach(eventEquals(new AttachEvent(ui)));
+ attachListener.attach(eventEquals(new AttachEvent(content)));
+ attachListener.attach(eventEquals(new AttachEvent(component)));
+
+ control.replay();
+
+ ui.addAttachListener(attachListener);
+ content.addAttachListener(attachListener);
+ component.addAttachListener(attachListener);
ui.setSession(session);
ui.setContent(content);
@@ -80,7 +96,15 @@ public class AttachDetachListenersTest {
@Test
public void attachListeners_setSessionBetween() {
- setupAttachListeners();
+ attachListener.attach(eventEquals(new AttachEvent(content)));
+ attachListener.attach(eventEquals(new AttachEvent(ui)));
+ attachListener.attach(eventEquals(new AttachEvent(component)));
+
+ control.replay();
+
+ ui.addAttachListener(attachListener);
+ content.addAttachListener(attachListener);
+ component.addAttachListener(attachListener);
ui.setContent(content);
ui.setSession(session);
@@ -168,15 +192,4 @@ public class AttachDetachListenersTest {
ui.setSession(session);
}
- private void setupAttachListeners() {
- attachListener.attach(eventEquals(new AttachEvent(ui)));
- attachListener.attach(eventEquals(new AttachEvent(content)));
- attachListener.attach(eventEquals(new AttachEvent(component)));
-
- control.replay();
-
- ui.addAttachListener(attachListener);
- content.addAttachListener(attachListener);
- component.addAttachListener(attachListener);
- }
}