org.javaseis.io.test
Class JTestSeisLock

java.lang.Object
  extended by TestCase
      extended by org.javaseis.io.test.JTestSeisLock

public class JTestSeisLock
extends TestCase

Test the file capability for locking the properties files when new extents are added.

Author:
steve

Nested Class Summary
(package private)  class JTestSeisLock.Helper
           
 
Field Summary
(package private)  java.lang.String _path
           
 
Constructor Summary
JTestSeisLock()
           
 
Method Summary
protected  void setUp()
           
 void testAsynchronous()
          Use multple threads to simulate locking/unlocking of the file from multple nodes in the same job or multiple jobs.
 void testSynchronous()
          Lock and increment a counter in a properties file in a single thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_path

java.lang.String _path
Constructor Detail

JTestSeisLock

public JTestSeisLock()
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Throws:
java.lang.Exception

testAsynchronous

public void testAsynchronous()
                      throws java.lang.Exception
Use multple threads to simulate locking/unlocking of the file from multple nodes in the same job or multiple jobs. There are differences between running in a single vm vrs multiple vm's but this can be tested in a unit test. There is a class LockTest2 that can be run by hand to test multiple vm's

Throws:
java.lang.Exception

testSynchronous

public void testSynchronous()
                     throws SeisException,
                            java.lang.Exception
Lock and increment a counter in a properties file in a single thread.

Throws:
SeisException
java.lang.Exception