org.apache.commons.configuration.event
Class AbstractTestFileConfigurationEvents

java.lang.Object
  extended by org.apache.commons.configuration.event.AbstractTestConfigurationEvents
      extended by org.apache.commons.configuration.event.AbstractTestFileConfigurationEvents
Direct Known Subclasses:
TestPropertiesConfigurationEvents, TestXMLConfigurationEvents

public abstract class AbstractTestFileConfigurationEvents
extends AbstractTestConfigurationEvents

A base test class that can be used for testing file-based configurations. This class tests reload events, too.

Version:
$Id: AbstractTestFileConfigurationEvents.java 1225648 2011-12-29 20:55:07Z oheger $

Field Summary
 
Fields inherited from class org.apache.commons.configuration.event.AbstractTestConfigurationEvents
config, l
 
Constructor Summary
AbstractTestFileConfigurationEvents()
           
 
Method Summary
protected abstract  URL getSourceURL()
          Returns the URL of the file to be loaded.
protected  void setUpFileConfiguration()
          Initializes the file configuration for the tests.
 void testAccessPropertiesOnReload()
          Tests accessing a property during a reload event to ensure that no infinite loops are possible.
 void testReloadEvent()
          Tests events generated by the reload() method.
 void testReloadEventWithDetails()
          Tests events generated by the reload() method when detail events are enabled.
 
Methods inherited from class org.apache.commons.configuration.event.AbstractTestConfigurationEvents
createConfiguration, setUp, testAddPropertyEvent, testAddPropertyEventWithDetails, testClearEvent, testClearEventWithDetails, testClearPropertyEvent, testClearPropertyEventWithDetails, testSetPropertyEvent, testSetPropertyEventWithDetails
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTestFileConfigurationEvents

public AbstractTestFileConfigurationEvents()
Method Detail

setUpFileConfiguration

protected void setUpFileConfiguration()
                               throws ConfigurationException,
                                      IOException
Initializes the file configuration for the tests.

Throws:
ConfigurationException - if an error occurs
IOException

getSourceURL

protected abstract URL getSourceURL()
                             throws IOException
Returns the URL of the file to be loaded. Must be implemented in concrete test classes.

Returns:
the URL of the file-based configuration
Throws:
IOException - if an error occurs

testReloadEvent

public void testReloadEvent()
                     throws ConfigurationException,
                            IOException
Tests events generated by the reload() method.

Throws:
ConfigurationException
IOException

testReloadEventWithDetails

public void testReloadEventWithDetails()
                                throws ConfigurationException,
                                       IOException
Tests events generated by the reload() method when detail events are enabled.

Throws:
ConfigurationException
IOException

testAccessPropertiesOnReload

public void testAccessPropertiesOnReload()
                                  throws ConfigurationException,
                                         IOException
Tests accessing a property during a reload event to ensure that no infinite loops are possible.

Throws:
ConfigurationException
IOException


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