commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r701658 - /commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java
Date Sat, 04 Oct 2008 15:56:52 GMT
Author: oheger
Date: Sat Oct  4 08:56:51 2008
New Revision: 701658

URL: http://svn.apache.org/viewvc?rev=701658&view=rev
Log:
Removed some JDK 1.5-related warnings.

Modified:
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java?rev=701658&r1=701657&r2=701658&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java
Sat Oct  4 08:56:51 2008
@@ -22,13 +22,13 @@
 import java.util.Collection;
 import java.util.Set;
 
+import junit.framework.TestCase;
+
 import org.apache.commons.configuration2.beanutils.BeanHelper;
 import org.apache.commons.configuration2.reloading.FileChangedReloadingStrategy;
 import org.apache.commons.configuration2.tree.DefaultConfigurationNode;
 import org.apache.commons.configuration2.tree.xpath.XPathExpressionEngine;
 
-import junit.framework.TestCase;
-
 /**
  * Test class for DefaultConfigurationBuilder.
  *
@@ -313,7 +313,7 @@
      */
     public void testLoadConfigurationFromURL() throws Exception
     {
-        factory = new DefaultConfigurationBuilder(TEST_FILE.toURL());
+        factory = new DefaultConfigurationBuilder(TEST_FILE.toURI().toURL());
         checkConfiguration();
     }
 
@@ -383,7 +383,7 @@
         // Test if union was constructed correctly
         Object prop = compositeConfiguration.getProperty("tables.table.name");
         assertTrue(prop instanceof Collection);
-        assertEquals(3, ((Collection) prop).size());
+        assertEquals(3, ((Collection<?>) prop).size());
         assertEquals("users", compositeConfiguration
                 .getProperty("tables.table(0).name"));
         assertEquals("documents", compositeConfiguration
@@ -394,20 +394,20 @@
         prop = compositeConfiguration
                 .getProperty("tables.table.fields.field.name");
         assertTrue(prop instanceof Collection);
-        assertEquals(17, ((Collection) prop).size());
+        assertEquals(17, ((Collection<?>) prop).size());
 
         assertEquals("smtp.mydomain.org", compositeConfiguration
                 .getString("mail.host.smtp"));
         assertEquals("pop3.mydomain.org", compositeConfiguration
                 .getString("mail.host.pop"));
 
-        // This was overriden
+        // This was overridden
         assertEquals("masterOfPost", compositeConfiguration
                 .getString("mail.account.user"));
         assertEquals("topsecret", compositeConfiguration
                 .getString("mail.account.psswd"));
 
-        // This was overriden, too, but not in additional section
+        // This was overridden, too, but not in additional section
         assertEquals("enhanced factory", compositeConfiguration
                 .getString("test.configuration"));
     }
@@ -427,7 +427,7 @@
      */
     public void testLoadOptional() throws Exception
     {
-        factory.setURL(OPTIONAL_FILE.toURL());
+        factory.setURL(OPTIONAL_FILE.toURI().toURL());
         Configuration config = factory.getConfiguration();
         assertTrue(config.getBoolean("test.boolean"));
         assertEquals("value", config.getProperty("element"));
@@ -526,6 +526,7 @@
                 new DefaultConfigurationBuilder.ConfigurationBuilderProvider()
                 {
                     // Throw an exception here, too
+                    @Override
                     public AbstractConfiguration getEmptyConfiguration(
                             DefaultConfigurationBuilder.ConfigurationDeclaration decl) throws
Exception
                     {
@@ -662,7 +663,7 @@
         CombinedConfiguration cc2 = (CombinedConfiguration) cc
                 .getConfiguration(DefaultConfigurationBuilder.ADDITIONAL_NAME);
         assertNotNull("No additional configuration found", cc2);
-        Set names = cc2.getConfigurationNames();
+        Set<?> names = cc2.getConfigurationNames();
         assertEquals("Wrong number of contained additional configs", 2, names
                 .size());
         assertTrue("Config 1 not contained", names.contains("combiner1"));
@@ -690,7 +691,7 @@
     {
         factory.setFile(INIT_FILE);
         CombinedConfiguration cc = factory.getConfiguration(true);
-        Set listNodes = cc.getNodeCombiner().getListNodes();
+        Set<?> listNodes = cc.getNodeCombiner().getListNodes();
         assertEquals("Wrong number of list nodes", 2, listNodes.size());
         assertTrue("table node not a list node", listNodes.contains("table"));
         assertTrue("list node not a list node", listNodes.contains("list"));
@@ -746,7 +747,7 @@
 
         factory = new DefaultConfigurationBuilder();
         factory.setFile(testSavedFactory);
-        factory.registerEntityId(publicId, dtdFile.toURL());
+        factory.registerEntityId(publicId, dtdFile.toURI().toURL());
         factory.clearErrorListeners();
         Configuration c = factory.getConfiguration();
         assertEquals("Wrong property value", "value1", c.getString("entry(0)"));



Mime
View raw message