org.apache.commons.configuration.interpol
Class TestConstantLookup

java.lang.Object
  extended by org.apache.commons.configuration.interpol.TestConstantLookup

public class TestConstantLookup
extends Object

Test class for ConstantLookup.

Version:
$Id: TestConstantLookup.java 1225656 2011-12-29 21:09:11Z oheger $

Constructor Summary
TestConstantLookup()
           
 
Method Summary
 void setUp()
           
 void tearDown()
          Clears the test environment.
 void testLookupCache()
          Tests accessing the cache by querying a variable twice.
 void testLookupConstant()
          Tests resolving a valid constant.
 void testLookupInvalidSyntax()
          Tries to resolve a variable with an invalid syntax: The name does not contain a dot as a field separator.
 void testLookupNonExisting()
          Tests resolving a non existing constant.
 void testLookupNonStringFromCache()
          Tests resolving a non string constant.
 void testLookupNull()
          Tests looking up a null variable.
 void testLookupPrivate()
          Tests resolving a private constant.
 void testLookupUnknownClass()
          Tests resolving a field from an unknown class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestConstantLookup

public TestConstantLookup()
Method Detail

setUp

public void setUp()
           throws Exception
Throws:
Exception

tearDown

public void tearDown()
              throws Exception
Clears the test environment. Here the static cache of the constant lookup class is wiped out.

Throws:
Exception

testLookupConstant

public void testLookupConstant()
Tests resolving a valid constant.


testLookupNonExisting

public void testLookupNonExisting()
Tests resolving a non existing constant. Result should be null.


testLookupPrivate

public void testLookupPrivate()
Tests resolving a private constant. Because a private field cannot be accessed this should again yield null.


testLookupUnknownClass

public void testLookupUnknownClass()
Tests resolving a field from an unknown class.


testLookupInvalidSyntax

public void testLookupInvalidSyntax()
Tries to resolve a variable with an invalid syntax: The name does not contain a dot as a field separator.


testLookupNull

public void testLookupNull()
Tests looking up a null variable.


testLookupCache

public void testLookupCache()
Tests accessing the cache by querying a variable twice.


testLookupNonStringFromCache

public void testLookupNonStringFromCache()
Tests resolving a non string constant. Then looks the same variable up from the cache.



Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.