summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorelmot <elmot@vaadin.com>2016-03-31 19:06:23 +0300
committerelmot <elmot@vaadin.com>2016-04-01 09:32:19 +0300
commitd494f822bb18a94f2ae032d724336607b1c33c74 (patch)
tree23fadbe69ecfd1174b68eefbb2ff4372ae163943
parent4529f98b21b6c42f119f5f7f5a7e809d66427dd8 (diff)
downloadvaadin-framework-d494f822bb18a94f2ae032d724336607b1c33c74.tar.gz
vaadin-framework-d494f822bb18a94f2ae032d724336607b1c33c74.zip
Fix server test RemoveFromParentLockingTest
Change-Id: Ib3af43a1b6945db00194775fbb2a91b4b495ee9b
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/RemoveFromParentLockingTest.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/RemoveFromParentLockingTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/RemoveFromParentLockingTest.java
index 2334542676..c8db6ac292 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/RemoveFromParentLockingTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/RemoveFromParentLockingTest.java
@@ -18,7 +18,9 @@ package com.vaadin.tests.server.component.abstractsinglecomponentcontainer;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
+import org.junit.After;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.Test;
import com.vaadin.server.VaadinRequest;
@@ -28,6 +30,13 @@ import com.vaadin.ui.VerticalLayout;
public class RemoveFromParentLockingTest {
+ @Before
+ @After
+ public void cleanCurrentSession()
+ {
+ VaadinSession.setCurrent(null);
+ }
+
private static VerticalLayout createTestComponent() {
VaadinSession session = new VaadinSession(null) {
private final ReentrantLock lock = new ReentrantLock();
@@ -102,8 +111,6 @@ public class RemoveFromParentLockingTest {
"Cannot remove from parent when the session is not locked."
+ " Furthermore, there is another locked session, indicating that the component might be about to be moved from one session to another.",
e.getMessage());
- } finally {
- VaadinSession.setCurrent(null);
}
}
@@ -121,8 +128,6 @@ public class RemoveFromParentLockingTest {
notLockedComponent.addComponent(lockedComponent);
} catch (AssertionError e) {
// All is fine, don't care about the exact wording in this case
- } finally {
- VaadinSession.setCurrent(null);
}
}