aboutsummaryrefslogtreecommitdiffstats
path: root/src/junit/com/jogamp/common/util/locks/TestSingletonServerSocket01.java
diff options
context:
space:
mode:
authorSven Gothel <sgothel@jausoft.com>2014-10-03 05:49:57 +0200
committerSven Gothel <sgothel@jausoft.com>2014-10-03 05:49:57 +0200
commit773d96584b4edc13eb6ff689eaf891aab09aa5a4 (patch)
treeb670122688f8c6f327664f600fc13d2f54f906f7 /src/junit/com/jogamp/common/util/locks/TestSingletonServerSocket01.java
parentdb12572b4f674884c3f7ad8f7e15ba9e97cf865a (diff)
SingletonTestCase -> SingletonJunitCase: Accomodate ClassLoader lifecycle of static fields; Change name to avoid testing itself.
Diffstat (limited to 'src/junit/com/jogamp/common/util/locks/TestSingletonServerSocket01.java')
-rw-r--r--src/junit/com/jogamp/common/util/locks/TestSingletonServerSocket01.java11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/junit/com/jogamp/common/util/locks/TestSingletonServerSocket01.java b/src/junit/com/jogamp/common/util/locks/TestSingletonServerSocket01.java
index 82ca89b..b37e600 100644
--- a/src/junit/com/jogamp/common/util/locks/TestSingletonServerSocket01.java
+++ b/src/junit/com/jogamp/common/util/locks/TestSingletonServerSocket01.java
@@ -32,27 +32,24 @@ import java.io.IOException;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
-
import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
+import com.jogamp.junit.util.SingletonJunitCase;
+
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class TestSingletonServerSocket01 {
- // public static final String SINGLE_INSTANCE_LOCK_FILE = "UITestCase.lock";
- public static final int SINGLE_INSTANCE_LOCK_PORT = 59999;
- public static final long SINGLE_INSTANCE_LOCK_TO = 3*60*1000; // wait up to 3 min
- public static final long SINGLE_INSTANCE_LOCK_POLL = 1000; // poll every 1s
private static volatile SingletonInstance singletonInstance;
@BeforeClass
public static void oneTimeSetUp() {
// one-time initialization code
- singletonInstance = SingletonInstance.createServerSocket(SINGLE_INSTANCE_LOCK_POLL, SINGLE_INSTANCE_LOCK_PORT);
+ singletonInstance = SingletonInstance.createServerSocket(SingletonJunitCase.SINGLE_INSTANCE_LOCK_POLL, SingletonJunitCase.SINGLE_INSTANCE_LOCK_PORT);
}
@Test
public void testJVMShutdown() {
- Assert.assertTrue("Could not lock single instance: "+singletonInstance.getName(), singletonInstance.tryLock(SINGLE_INSTANCE_LOCK_TO));
+ Assert.assertTrue("Could not lock single instance: "+singletonInstance.getName(), singletonInstance.tryLock(SingletonJunitCase.SINGLE_INSTANCE_LOCK_TO));
singletonInstance.unlock();
}