org.apache.commons.configuration.interpol
Class TestConfigurationInterpolator

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

public class TestConfigurationInterpolator
extends Object

Test class for ConfigurationInterpolator.

Version:
$Id: TestConfigurationInterpolator.java 1225653 2011-12-29 21:06:26Z oheger $

Constructor Summary
TestConfigurationInterpolator()
           
 
Method Summary
 void setUp()
           
 void tearDown()
          Cleans the test environment.
 void testDeregisterGlobalLookup()
          Tests deregistering a global lookup object.
 void testDeregisterGlobalLookupNonExisting()
          Tests deregistering an unknown lookup.
 void testDeregisterLookup()
          Tests deregistering a local lookup object.
 void testDeregisterLookupNonExisting()
          Tests deregistering an unknown lookup object.
 void testInit()
          Tests creating an instance.
 void testLookupConstants()
          Tests whether constants can be correctly resolved.
 void testLookupDefault()
          Tests looking up a variable without a prefix.
 void testLookupDefaultAfterPrefixFails()
          Tests whether the default lookup is called for variables with a prefix when the lookup that was registered for this prefix is not able to resolve the variable.
 void testLookupDefaultEmptyVarName()
          Tests an empty variable name without a prefix.
 void testLookupEmptyPrefix()
          Tests the empty variable prefix.
 void testLookupEmptyVarName()
          Tests an empty variable name.
 void testLookupNoDefault()
          Tests looking up a variable without a prefix when no default lookup is specified.
 void testLookupNull()
          Tests looking up a null variable.
 void testLookupSysProperties()
          Tests whether system properties can be correctly resolved.
 void testLookupWithPrefix()
          Tests whether a variable can be resolved using the associated lookup object.
 void testLookupWithUnknownPrefix()
          Tests the behavior of the lookup method for variables with an unknown prefix.
 void testRegisterGlobalLookup()
          Tests registering a global lookup object.
 void testRegisterGlobalLookupNull()
          Tries to register a global null lookup.
 void testRegisterGlobalLookupNullPrefix()
          Tries to register a global lookup for a null prefix.
 void testRegisterLookup()
          Tests registering a lookup object at an instance.
 void testRegisterLookupNull()
          Tests registering a null lookup object.
 void testRegisterLookupNullPrefix()
          Tests registering a lookup object for an undefined prefix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestConfigurationInterpolator

public TestConfigurationInterpolator()
Method Detail

setUp

public void setUp()
           throws Exception
Throws:
Exception

tearDown

public void tearDown()
              throws Exception
Cleans the test environment. Deregisters the test lookup object if necessary.

Throws:
Exception

testInit

public void testInit()
Tests creating an instance. Does it contain some predefined lookups?


testRegisterGlobalLookupNullPrefix

public void testRegisterGlobalLookupNullPrefix()
Tries to register a global lookup for a null prefix. This should cause an exception.


testRegisterGlobalLookupNull

public void testRegisterGlobalLookupNull()
Tries to register a global null lookup. This should cause an exception.


testRegisterGlobalLookup

public void testRegisterGlobalLookup()
Tests registering a global lookup object. This lookup object should then be available for instances created later on.


testDeregisterGlobalLookup

public void testDeregisterGlobalLookup()
Tests deregistering a global lookup object.


testDeregisterGlobalLookupNonExisting

public void testDeregisterGlobalLookupNonExisting()
Tests deregistering an unknown lookup.


testRegisterLookup

public void testRegisterLookup()
Tests registering a lookup object at an instance.


testRegisterLookupNull

public void testRegisterLookupNull()
Tests registering a null lookup object. This should cause an exception.


testRegisterLookupNullPrefix

public void testRegisterLookupNullPrefix()
Tests registering a lookup object for an undefined prefix. This should cause an exception.


testDeregisterLookup

public void testDeregisterLookup()
Tests deregistering a local lookup object.


testDeregisterLookupNonExisting

public void testDeregisterLookupNonExisting()
Tests deregistering an unknown lookup object.


testLookupWithPrefix

public void testLookupWithPrefix()
Tests whether a variable can be resolved using the associated lookup object. The lookup is identified by the variable's prefix.


testLookupWithUnknownPrefix

public void testLookupWithUnknownPrefix()
Tests the behavior of the lookup method for variables with an unknown prefix. These variables should not be resolved.


testLookupDefault

public void testLookupDefault()
Tests looking up a variable without a prefix. This should trigger the default lookup object.


testLookupNoDefault

public void testLookupNoDefault()
Tests looking up a variable without a prefix when no default lookup is specified. Result should be null in this case.


testLookupEmptyPrefix

public void testLookupEmptyPrefix()
Tests the empty variable prefix. This is a special case, but legal.


testLookupEmptyVarName

public void testLookupEmptyVarName()
Tests an empty variable name.


testLookupDefaultEmptyVarName

public void testLookupDefaultEmptyVarName()
Tests an empty variable name without a prefix.


testLookupNull

public void testLookupNull()
Tests looking up a null variable. Result shoult be null, too.


testLookupSysProperties

public void testLookupSysProperties()
Tests whether system properties can be correctly resolved.


testLookupConstants

public void testLookupConstants()
Tests whether constants can be correctly resolved.


testLookupDefaultAfterPrefixFails

public void testLookupDefaultAfterPrefixFails()
Tests whether the default lookup is called for variables with a prefix when the lookup that was registered for this prefix is not able to resolve the variable.



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