sk.baka.tools.concurrent
Class AbstractLockingStorageTest

java.lang.Object
  extended by sk.baka.tools.concurrent.AbstractLockingStorageTest
Direct Known Subclasses:
InMemoryLockingStorageTest

public abstract class AbstractLockingStorageTest
extends Object

Performs testing of the locking storage.

Author:
Martin Vysny

Constructor Summary
AbstractLockingStorageTest()
           
 
Method Summary
 void createExecutor()
           
 void destroyExecutor()
           
 void doubleUnlock2ThrowsException()
           
 void doubleUnlockThrowsException()
           
protected  IValueProducer<Long,Serializable> newProducer()
           
protected abstract  ILockingStorage<Long,Serializable> newStorage(IValueProducer<Long,Serializable> producer)
           
 void simpleSingleThreadLocking()
           
 void testForConsistentObjectRetrievalWithASingleID()
           
 void testForConsistentObjectRetrievalWithEvenlyDistributedID()
           
 void testForConsistentObjectRetrievalWithOneIdPerRunnable()
           
 void testForCorrectLockingWithEvenlyDistributedID()
           
 void testForCorrectLockingWithOneIdPerRunnable()
           
 void testForCorrectLockingWithSingleId()
           
 void unlockThrowsNPE()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLockingStorageTest

public AbstractLockingStorageTest()
Method Detail

createExecutor

public void createExecutor()

destroyExecutor

public void destroyExecutor()
                     throws InterruptedException
Throws:
InterruptedException

newProducer

protected final IValueProducer<Long,Serializable> newProducer()

newStorage

protected abstract ILockingStorage<Long,Serializable> newStorage(IValueProducer<Long,Serializable> producer)

simpleSingleThreadLocking

public void simpleSingleThreadLocking()
                               throws Exception
Throws:
Exception

testForConsistentObjectRetrievalWithEvenlyDistributedID

public void testForConsistentObjectRetrievalWithEvenlyDistributedID()
                                                             throws Exception
Throws:
Exception

testForConsistentObjectRetrievalWithASingleID

public void testForConsistentObjectRetrievalWithASingleID()
                                                   throws Exception
Throws:
Exception

testForConsistentObjectRetrievalWithOneIdPerRunnable

public void testForConsistentObjectRetrievalWithOneIdPerRunnable()
                                                          throws Exception
Throws:
Exception

testForCorrectLockingWithOneIdPerRunnable

public void testForCorrectLockingWithOneIdPerRunnable()
                                               throws Exception
Throws:
Exception

testForCorrectLockingWithSingleId

public void testForCorrectLockingWithSingleId()
                                       throws Exception
Throws:
Exception

testForCorrectLockingWithEvenlyDistributedID

public void testForCorrectLockingWithEvenlyDistributedID()
                                                  throws Exception
Throws:
Exception

doubleUnlockThrowsException

public void doubleUnlockThrowsException()

doubleUnlock2ThrowsException

public void doubleUnlock2ThrowsException()

unlockThrowsNPE

public void unlockThrowsNPE()


Copyright © 2009-2010. All Rights Reserved.