Browse Source

Fix server test RemoveFromParentLockingTest

Change-Id: Ib3af43a1b6945db00194775fbb2a91b4b495ee9b
tags/7.7.0.alpha1
elmot 8 years ago
parent
commit
d494f822bb

+ 9
- 4
server/src/test/java/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/RemoveFromParentLockingTest.java View File

@@ -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);
}
}


Loading…
Cancel
Save