]> source.dussan.org Git - vaadin-framework.git/commitdiff
Prevent AlwaysLockedVaadinSession from being GCed during test
authorArtur Signell <artur@vaadin.com>
Thu, 5 Feb 2015 09:22:01 +0000 (11:22 +0200)
committerVaadin Code Review <review@vaadin.com>
Thu, 5 Feb 2015 09:51:59 +0000 (09:51 +0000)
Change-Id: Id6e2e6c7e013e8c667f658d5877c5db7d072106b

server/tests/src/com/vaadin/tests/util/AlwaysLockedVaadinSession.java

index 9b0b524b6a9b0fb52ebab84dd64b66195ea6c54c..89d3449b1239faaedc23a64ca5e8d549a1f64917 100644 (file)
@@ -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;
-    }
 }