net.groboclown.util.datastruct.v1.tests
Class TestPathRegistry

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--net.groboclown.junit.v1.MultiThreadedTestCase
                    |
                    +--net.groboclown.util.datastruct.v1.tests.TestPathRegistry
All Implemented Interfaces:
junit.framework.Test

public class TestPathRegistry
extends MultiThreadedTestCase


Inner classes inherited from class net.groboclown.junit.v1.MultiThreadedTestCase
MultiThreadedTestCase.StopThreadsTest, MultiThreadedTestCase.TestCaseRunnable
 
Field Summary
private static Random s_rand
           
private static Class THIS_CLASS
           
 
Fields inherited from class net.groboclown.junit.v1.MultiThreadedTestCase
m_synch, m_testResult, m_threadGroup, m_threadsFinished
 
Fields inherited from class junit.framework.TestCase
fName
 
Constructor Summary
TestPathRegistry(String name)
           
 
Method Summary
protected  void alreadyRegisteredTest(PathRegistry pr, String path)
          Attempt to register an object at the given path.
protected  void cantRemoveEntryTest(PathRegistry pr, String path)
          Pass if the correct exception is thrown when trying to remove an entry that doesn't exist.
protected  void caseAlreadyRegisteredTest(PathRegistry pr, String path, char separator)
          Attempt to register the given path and its case variations.
protected  void caseCantRemoveEntryTest(PathRegistry pr, String path, char separator)
           
protected  void caseNotRegisteredTest(PathRegistry pr, String path, char separator)
          Assert that the given path's case variations are not registered (however, the original path may be registered).
protected  void caseRegisteredRightTest(PathRegistry pr, String path, Object expectedObj, char separator)
          Assert that the given path and its case variations are registered/
protected  String[] getCaseVariations(String orig, char separator)
          Get a set of variations in case upper / lower of the given path.
static void main(String[] args)
           
private static int nextInt(int n)
           
protected  void notRegisteredTest(PathRegistry pr, String path)
          Assert that the given path has nothing registered to it.
protected  void registeredRightTest(PathRegistry pr, String path, Object expectedObj)
          Assert that the given path is registered to the given object.
protected  void setUp()
           
static junit.framework.Test suite()
           
protected  void tearDown()
           
 void testAddCaseInsensitiveNotRecursive()
           
 void testAddCaseSensitiveNotRecursive()
           
 void testAddCaseSensitiveRecursive()
           
 void testAddTwiceException()
           
 void testAddTwiceExceptionCaseInsensitive()
           
 void testAddTwiceExceptionRecursive()
           
 void testInstantiate()
           
 void testRemoveCaseSensitiveNotResursive()
           
 
Methods inherited from class net.groboclown.junit.v1.MultiThreadedTestCase
handleException, interruptThreads, run, runTestCaseRunnables, runTestCaseRunnables
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

THIS_CLASS

private static final Class THIS_CLASS

s_rand

private static Random s_rand
Constructor Detail

TestPathRegistry

public TestPathRegistry(String name)
Method Detail

suite

public static junit.framework.Test suite()

main

public static void main(String[] args)

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class junit.framework.TestCase

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class junit.framework.TestCase

testInstantiate

public void testInstantiate()

testAddCaseSensitiveNotRecursive

public void testAddCaseSensitiveNotRecursive()
                                      throws PathAlreadyRegisteredException

testAddTwiceException

public void testAddTwiceException()
                           throws PathAlreadyRegisteredException

testAddCaseInsensitiveNotRecursive

public void testAddCaseInsensitiveNotRecursive()
                                        throws PathAlreadyRegisteredException

testAddTwiceExceptionCaseInsensitive

public void testAddTwiceExceptionCaseInsensitive()
                                          throws PathAlreadyRegisteredException

testAddCaseSensitiveRecursive

public void testAddCaseSensitiveRecursive()
                                   throws PathAlreadyRegisteredException

testAddTwiceExceptionRecursive

public void testAddTwiceExceptionRecursive()
                                    throws PathAlreadyRegisteredException

testRemoveCaseSensitiveNotResursive

public void testRemoveCaseSensitiveNotResursive()
                                         throws PathAlreadyRegisteredException,
                                                NoRegisteredComponentException

notRegisteredTest

protected void notRegisteredTest(PathRegistry pr,
                                 String path)
Assert that the given path has nothing registered to it.

caseNotRegisteredTest

protected void caseNotRegisteredTest(PathRegistry pr,
                                     String path,
                                     char separator)
Assert that the given path's case variations are not registered (however, the original path may be registered).

registeredRightTest

protected void registeredRightTest(PathRegistry pr,
                                   String path,
                                   Object expectedObj)
Assert that the given path is registered to the given object.

caseRegisteredRightTest

protected void caseRegisteredRightTest(PathRegistry pr,
                                       String path,
                                       Object expectedObj,
                                       char separator)
Assert that the given path and its case variations are registered/

alreadyRegisteredTest

protected void alreadyRegisteredTest(PathRegistry pr,
                                     String path)
Attempt to register an object at the given path. The test succeeds if it is already registered, and fails if it does not throw an exception.

cantRemoveEntryTest

protected void cantRemoveEntryTest(PathRegistry pr,
                                   String path)
Pass if the correct exception is thrown when trying to remove an entry that doesn't exist.

caseCantRemoveEntryTest

protected void caseCantRemoveEntryTest(PathRegistry pr,
                                       String path,
                                       char separator)

caseAlreadyRegisteredTest

protected void caseAlreadyRegisteredTest(PathRegistry pr,
                                         String path,
                                         char separator)
Attempt to register the given path and its case variations.

nextInt

private static int nextInt(int n)

getCaseVariations

protected String[] getCaseVariations(String orig,
                                     char separator)
Get a set of variations in case upper / lower of the given path.


Written under the LGPL