-
Notifications
You must be signed in to change notification settings - Fork 728
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent AlwaysLockedVaadinSession from being GCed during test
Change-Id: Id6e2e6c7e013e8c667f658d5877c5db7d072106b
- Loading branch information
Showing
1 changed file
with
3 additions
and
13 deletions.
There are no files selected for viewing
16 changes: 3 additions & 13 deletions
16
server/tests/src/com/vaadin/tests/util/AlwaysLockedVaadinSession.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |