commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1596026 - /commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestMultiFileConfigurationBuilder.java
Date Mon, 19 May 2014 19:58:59 GMT
Author: oheger
Date: Mon May 19 19:58:59 2014
New Revision: 1596026

URL: http://svn.apache.org/r1596026
Log:
TestMultiFileConfigurationBuilder now relies on new event listener mechanism.

Modified:
    commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestMultiFileConfigurationBuilder.java

Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestMultiFileConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestMultiFileConfigurationBuilder.java?rev=1596026&r1=1596025&r2=1596026&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestMultiFileConfigurationBuilder.java
(original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestMultiFileConfigurationBuilder.java
Mon May 19 19:58:59 2014
@@ -34,8 +34,9 @@ import org.apache.commons.configuration.
 import org.apache.commons.configuration.XMLConfiguration;
 import org.apache.commons.configuration.builder.BasicBuilderParameters;
 import org.apache.commons.configuration.builder.BuilderConfigurationWrapperFactory;
-import org.apache.commons.configuration.builder.BuilderListener;
+import org.apache.commons.configuration.builder.BuilderEventListenerImpl;
 import org.apache.commons.configuration.builder.BuilderParameters;
+import org.apache.commons.configuration.builder.ConfigurationBuilderEvent;
 import org.apache.commons.configuration.builder.FileBasedConfigurationBuilder;
 import org.apache.commons.configuration.builder.XMLBuilderParametersImpl;
 import org.apache.commons.configuration.convert.DefaultListDelimiterHandler;
@@ -380,18 +381,18 @@ public class TestMultiFileConfigurationB
     @Test
     public void testBuilderListener() throws ConfigurationException
     {
-        BuilderListener listener = EasyMock.createMock(BuilderListener.class);
+        BuilderEventListenerImpl listener = new BuilderEventListenerImpl();
         Collection<FileBasedConfigurationBuilder<XMLConfiguration>> managedBuilders
=
                 new ArrayList<FileBasedConfigurationBuilder<XMLConfiguration>>();
         MultiFileConfigurationBuilder<XMLConfiguration> builder =
                 createBuilderWithAccessToManagedBuilders(managedBuilders);
-        listener.builderReset(builder);
-        EasyMock.replay(listener);
         switchToConfig(1);
-        builder.addBuilderListener(listener);
+        builder.addEventListener(ConfigurationBuilderEvent.RESET, listener);
         builder.getConfiguration();
         managedBuilders.iterator().next().resetResult();
-        EasyMock.verify(listener);
+        ConfigurationBuilderEvent event =
+                listener.nextEvent(ConfigurationBuilderEvent.RESET);
+        assertSame("Wrong event source", builder, event.getSource());
     }
 
     /**
@@ -402,18 +403,17 @@ public class TestMultiFileConfigurationB
     public void testRemoveBuilderListenerOnReset()
             throws ConfigurationException
     {
-        BuilderListener listener = EasyMock.createMock(BuilderListener.class);
+        BuilderEventListenerImpl listener = new BuilderEventListenerImpl();
         Collection<FileBasedConfigurationBuilder<XMLConfiguration>> managedBuilders
=
                 new ArrayList<FileBasedConfigurationBuilder<XMLConfiguration>>();
         MultiFileConfigurationBuilder<XMLConfiguration> builder =
                 createBuilderWithAccessToManagedBuilders(managedBuilders);
-        EasyMock.replay(listener);
         switchToConfig(1);
-        builder.addBuilderListener(listener);
+        builder.addEventListener(ConfigurationBuilderEvent.RESET, listener);
         builder.getConfiguration();
         builder.resetParameters();
         managedBuilders.iterator().next().resetResult();
-        EasyMock.verify(listener);
+        listener.assertNoMoreEvents();
     }
 
     /**



Mime
View raw message