diff options
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/test/java/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/RemoveFromParentLockingTest.java | 13 |
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); } } |