Skip to content

Commit

Permalink
Prevent AlwaysLockedVaadinSession from being GCed during test
Browse files Browse the repository at this point in the history
Change-Id: Id6e2e6c7e013e8c667f658d5877c5db7d072106b
  • Loading branch information
Artur- authored and Vaadin Code Review committed Feb 5, 2015
1 parent ac658de commit 0ad0caa
Showing 1 changed file with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
package com.vaadin.tests.util;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

import com.vaadin.server.MockVaadinSession;
import com.vaadin.server.VaadinService;
import com.vaadin.server.VaadinSession;

public class AlwaysLockedVaadinSession extends VaadinSession {

private ReentrantLock lock;
public class AlwaysLockedVaadinSession extends MockVaadinSession {

public AlwaysLockedVaadinSession(VaadinService service) {
super(service);
lock = new ReentrantLock();
lock.lock();
lock();
}

@Override
public Lock getLockInstance() {
return lock;
}
}

0 comments on commit 0ad0caa

Please sign in to comment.