org.apache.commons.configuration.event
Class TestEventSource

java.lang.Object
  extended by org.apache.commons.configuration.event.TestEventSource

public class TestEventSource
extends Object

Test class for EventSource.

Version:
$Id: TestEventSource.java 1225652 2011-12-29 21:00:57Z oheger $

Constructor Summary
TestEventSource()
           
 
Method Summary
 void setUp()
           
 void testAddConfigurationListener()
          Tests registering a new listener.
 void testAddErrorListener()
          Tests registering a new error listener.
 void testAddNullConfigurationListener()
          Tests adding an undefined configuration listener.
 void testAddNullErrorListener()
          Tests adding an undefined error listener.
 void testClone()
          Tests cloning an event source object.
 void testFireError()
          Tests delivering an error event to a listener.
 void testFireErrorNoListeners()
          Tests firing an error event if there are no error listeners.
 void testFireEvent()
          Tests delivering an event to a listener.
 void testFireEventNoDetails()
          Tests generating a detail event if detail events are not allowed.
 void testFireEventNoListeners()
          Tests firing an event if there are no listeners.
 void testGetConfigurationListenersAddNew()
          Tests that the collection returned by getConfigurationListeners() is really a snapshot.
 void testGetConfigurationListenersUpdate()
          Tests whether the listeners list is read only.
 void testGetErrorListenersUpdate()
          Tests whether the listeners list is read only.
 void testInit()
          Tests a newly created source object.
 void testRemoveConfigurationListener()
          Tests removing a listener.
 void testRemoveErrorListener()
          Tests removing an error listener.
 void testRemoveListenerInFireEvent()
          Tests whether an event listener can deregister itself in reaction of a delivered event.
 void testRemoveNullConfigurationListener()
          Tests if a null listener can be removed.
 void testRemoveNullErrorListener()
          Tests if a null error listener can be removed.
 void testSetDetailEvents()
          Tests enabling and disabling the detail events flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestEventSource

public TestEventSource()
Method Detail

setUp

public void setUp()
           throws Exception
Throws:
Exception

testInit

public void testInit()
Tests a newly created source object.


testAddConfigurationListener

public void testAddConfigurationListener()
Tests registering a new listener.


testAddNullConfigurationListener

public void testAddNullConfigurationListener()
Tests adding an undefined configuration listener. This should cause an exception.


testRemoveConfigurationListener

public void testRemoveConfigurationListener()
Tests removing a listener.


testRemoveNullConfigurationListener

public void testRemoveNullConfigurationListener()
Tests if a null listener can be removed. This should be a no-op.


testGetConfigurationListenersUpdate

public void testGetConfigurationListenersUpdate()
Tests whether the listeners list is read only.


testGetConfigurationListenersAddNew

public void testGetConfigurationListenersAddNew()
Tests that the collection returned by getConfigurationListeners() is really a snapshot. A later added listener must not be visible.


testSetDetailEvents

public void testSetDetailEvents()
Tests enabling and disabling the detail events flag.


testFireEvent

public void testFireEvent()
Tests delivering an event to a listener.


testFireEventNoListeners

public void testFireEventNoListeners()
Tests firing an event if there are no listeners.


testFireEventNoDetails

public void testFireEventNoDetails()
Tests generating a detail event if detail events are not allowed.


testRemoveListenerInFireEvent

public void testRemoveListenerInFireEvent()
Tests whether an event listener can deregister itself in reaction of a delivered event.


testAddErrorListener

public void testAddErrorListener()
Tests registering a new error listener.


testAddNullErrorListener

public void testAddNullErrorListener()
Tests adding an undefined error listener. This should cause an exception.


testRemoveErrorListener

public void testRemoveErrorListener()
Tests removing an error listener.


testRemoveNullErrorListener

public void testRemoveNullErrorListener()
Tests if a null error listener can be removed. This should be a no-op.


testGetErrorListenersUpdate

public void testGetErrorListenersUpdate()
Tests whether the listeners list is read only.


testFireError

public void testFireError()
Tests delivering an error event to a listener.


testFireErrorNoListeners

public void testFireErrorNoListeners()
Tests firing an error event if there are no error listeners.


testClone

public void testClone()
               throws CloneNotSupportedException
Tests cloning an event source object. The registered listeners should not be registered at the clone.

Throws:
CloneNotSupportedException


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