commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r782270 - /commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/
Date Sat, 06 Jun 2009 15:11:41 GMT
Author: oheger
Date: Sat Jun  6 15:11:41 2009
New Revision: 782270

URL: http://svn.apache.org/viewvc?rev=782270&view=rev
Log:
Some changes related to Java 1.5: Improved type safety, added @override annotations

Modified:
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/AbstractTestConfigurationEvents.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestHierarchicalConfigurationEvents.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestMapConfigurationEvents.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestPropertiesConfigurationEvents.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestXMLConfigurationEvents.java

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/AbstractTestConfigurationEvents.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/AbstractTestConfigurationEvents.java?rev=782270&r1=782269&r2=782270&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/AbstractTestConfigurationEvents.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/AbstractTestConfigurationEvents.java
Sat Jun  6 15:11:41 2009
@@ -18,12 +18,10 @@
 
 import java.util.LinkedList;
 
-import org.apache.commons.configuration2.AbstractConfiguration;
-import org.apache.commons.configuration2.event.ConfigurationEvent;
-import org.apache.commons.configuration2.event.ConfigurationListener;
-
 import junit.framework.TestCase;
 
+import org.apache.commons.configuration2.AbstractConfiguration;
+
 /**
  * Base class for testing events generated by configuration classes derived from
  * AbstractConfiguration. This class implements a couple of tests related to
@@ -53,6 +51,7 @@
     /** A test event listener. */
     protected TestConfigurationListener l;
 
+    @Override
     protected void setUp() throws Exception
     {
         super.setUp();
@@ -189,7 +188,7 @@
     protected class TestConfigurationListener implements ConfigurationListener
     {
         /** Stores the received events. */
-        private LinkedList events = new LinkedList();
+        private LinkedList<ConfigurationEvent> events = new LinkedList<ConfigurationEvent>();
 
         public void configurationChanged(ConfigurationEvent event)
         {

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestHierarchicalConfigurationEvents.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestHierarchicalConfigurationEvents.java?rev=782270&r1=782269&r2=782270&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestHierarchicalConfigurationEvents.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestHierarchicalConfigurationEvents.java
Sat Jun  6 15:11:41 2009
@@ -22,7 +22,7 @@
 import org.apache.commons.configuration2.AbstractConfiguration;
 import org.apache.commons.configuration2.HierarchicalConfiguration;
 import org.apache.commons.configuration2.SubnodeConfiguration;
-import org.apache.commons.configuration2.event.ConfigurationEvent;
+import org.apache.commons.configuration2.tree.ConfigurationNode;
 import org.apache.commons.configuration2.tree.DefaultConfigurationNode;
 
 /**
@@ -33,6 +33,7 @@
 public class TestHierarchicalConfigurationEvents extends
         AbstractTestConfigurationEvents
 {
+    @Override
     protected AbstractConfiguration createConfiguration()
     {
         return new HierarchicalConfiguration();
@@ -45,7 +46,7 @@
     {
         HierarchicalConfiguration hc = (HierarchicalConfiguration) config;
         String key = EXIST_PROPERTY.substring(0, EXIST_PROPERTY.indexOf('.'));
-        Collection nodes = hc.getExpressionEngine()
+        Collection<?> nodes = hc.getExpressionEngine()
                 .query(hc.getRootNode(), key);
         hc.clearTree(key);
         l.checkEvent(HierarchicalConfiguration.EVENT_CLEAR_TREE, key, null,
@@ -61,7 +62,7 @@
     public void testAddNodesEvent()
     {
         HierarchicalConfiguration hc = (HierarchicalConfiguration) config;
-        Collection nodes = new ArrayList(1);
+        Collection<ConfigurationNode> nodes = new ArrayList<ConfigurationNode>(1);
         nodes.add(new DefaultConfigurationNode("a_key", TEST_PROPVALUE));
         hc.addNodes(TEST_PROPNAME, nodes);
         l.checkEvent(HierarchicalConfiguration.EVENT_ADD_NODES, TEST_PROPNAME,
@@ -78,7 +79,7 @@
     public void testAddNodesEmptyEvent()
     {
         ((HierarchicalConfiguration) config).addNodes(TEST_PROPNAME,
-                new ArrayList());
+                new ArrayList<ConfigurationNode>());
         l.done();
     }
 

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestMapConfigurationEvents.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestMapConfigurationEvents.java?rev=782270&r1=782269&r2=782270&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestMapConfigurationEvents.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestMapConfigurationEvents.java
Sat Jun  6 15:11:41 2009
@@ -28,8 +28,9 @@
  */
 public class TestMapConfigurationEvents extends AbstractTestConfigurationEvents
 {
+    @Override
     protected AbstractConfiguration createConfiguration()
     {
-        return new MapConfiguration(new HashMap());
+        return new MapConfiguration(new HashMap<Object, Object>());
     }
 }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestPropertiesConfigurationEvents.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestPropertiesConfigurationEvents.java?rev=782270&r1=782269&r2=782270&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestPropertiesConfigurationEvents.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestPropertiesConfigurationEvents.java
Sat Jun  6 15:11:41 2009
@@ -36,13 +36,15 @@
     /** The file to be loaded.*/
     static final File TEST_FILE = ConfigurationAssert.getTestFile("test.properties");
 
+    @Override
     protected AbstractConfiguration createConfiguration()
     {
         return new PropertiesConfiguration();
     }
 
+    @Override
     protected URL getSourceURL() throws IOException
     {
-        return TEST_FILE.toURL();
+        return TEST_FILE.toURI().toURL();
     }
 }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestXMLConfigurationEvents.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestXMLConfigurationEvents.java?rev=782270&r1=782269&r2=782270&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestXMLConfigurationEvents.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/event/TestXMLConfigurationEvents.java
Sat Jun  6 15:11:41 2009
@@ -34,11 +34,13 @@
 {
     static final File TEST_FILE = ConfigurationAssert.getTestFile("test.xml");
 
+    @Override
     protected URL getSourceURL() throws IOException
     {
-        return TEST_FILE.toURL();
+        return TEST_FILE.toURI().toURL();
     }
 
+    @Override
     protected AbstractConfiguration createConfiguration()
     {
         return new XMLConfiguration();



Mime
View raw message