org.apache.commons.configuration.event
Class AbstractTestConfigurationEvents

java.lang.Object
  extended by org.apache.commons.configuration.event.AbstractTestConfigurationEvents
Direct Known Subclasses:
AbstractTestFileConfigurationEvents, AbstractTestPListEvents, TestDatabaseConfigurationEvents, TestHierarchicalConfigurationEvents, TestMapConfigurationEvents, TestSubsetConfigurationEvents

public abstract class AbstractTestConfigurationEvents
extends Object

Base class for testing events generated by configuration classes derived from AbstractConfiguration. This class implements a couple of tests related to event generation. Concrete sub classes only have to implement the createConfiguration() method for creating an instance of a specific configuration class. Because tests for detail events depend on a concrete implementation an exact sequence of events cannot be checked. Instead the corresponding test methods check whether the enclosing events (not the detail events) are of the expected type.

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

Field Summary
protected  AbstractConfiguration config
          The configuration to be tested.
protected  ConfigurationListenerTestImpl l
          A test event listener.
 
Constructor Summary
AbstractTestConfigurationEvents()
           
 
Method Summary
protected abstract  AbstractConfiguration createConfiguration()
          Creates the configuration instance to be tested.
 void setUp()
           
 void testAddPropertyEvent()
          Tests events generated by addProperty().
 void testAddPropertyEventWithDetails()
          Tests events generated by addProperty() when detail events are enabled.
 void testClearEvent()
          Tests the events generated by the clear() method.
 void testClearEventWithDetails()
          Tests the events generated by the clear method when detail events are enabled.
 void testClearPropertyEvent()
          Tests events generated by clearProperty().
 void testClearPropertyEventWithDetails()
          Tests events generated by clearProperty() when detail events are enabled.
 void testSetPropertyEvent()
          Tests events generated by setProperty().
 void testSetPropertyEventWithDetails()
          Tests events generated by setProperty() when detail events are enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected AbstractConfiguration config
The configuration to be tested.


l

protected ConfigurationListenerTestImpl l
A test event listener.

Constructor Detail

AbstractTestConfigurationEvents

public AbstractTestConfigurationEvents()
Method Detail

setUp

public void setUp()
           throws Exception
Throws:
Exception

createConfiguration

protected abstract AbstractConfiguration createConfiguration()
Creates the configuration instance to be tested.

Returns:
the configuration instance under test

testAddPropertyEvent

public void testAddPropertyEvent()
Tests events generated by addProperty().


testAddPropertyEventWithDetails

public void testAddPropertyEventWithDetails()
Tests events generated by addProperty() when detail events are enabled.


testClearPropertyEvent

public void testClearPropertyEvent()
Tests events generated by clearProperty().


testClearPropertyEventWithDetails

public void testClearPropertyEventWithDetails()
Tests events generated by clearProperty() when detail events are enabled.


testSetPropertyEvent

public void testSetPropertyEvent()
Tests events generated by setProperty().


testSetPropertyEventWithDetails

public void testSetPropertyEventWithDetails()
Tests events generated by setProperty() when detail events are enabled.


testClearEvent

public void testClearEvent()
Tests the events generated by the clear() method.


testClearEventWithDetails

public void testClearEventWithDetails()
Tests the events generated by the clear method when detail events are enabled.



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