From commits-return-1708-apmail-commons-commits-archive=commons.apache.org@commons.apache.org Sat Feb 02 20:34:15 2008 Return-Path: Delivered-To: apmail-commons-commits-archive@locus.apache.org Received: (qmail 4110 invoked from network); 2 Feb 2008 20:34:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Feb 2008 20:34:14 -0000 Received: (qmail 75900 invoked by uid 500); 2 Feb 2008 20:34:05 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 75839 invoked by uid 500); 2 Feb 2008 20:34:05 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 75830 invoked by uid 99); 2 Feb 2008 20:34:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Feb 2008 12:34:05 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Feb 2008 20:33:57 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8E9971A9832; Sat, 2 Feb 2008 12:33:49 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r617888 - /commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java Date: Sat, 02 Feb 2008 20:33:49 -0000 To: commits@commons.apache.org From: oheger@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080202203349.8E9971A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: oheger Date: Sat Feb 2 12:33:48 2008 New Revision: 617888 URL: http://svn.apache.org/viewvc?rev=617888&view=rev Log: Removed dependency to commons-collections from TestAbstractConfigurationBasicFeatures and some Java 1.5 related changes Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java?rev=617888&r1=617887&r2=617888&view=diff ============================================================================== --- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java (original) +++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java Sat Feb 2 12:33:48 2008 @@ -24,7 +24,6 @@ import java.util.List; import java.util.Map; -import org.apache.commons.collections.CollectionUtils; import org.apache.commons.configuration2.AbstractConfiguration; import org.apache.commons.configuration2.BaseConfiguration; import org.apache.commons.configuration2.Configuration; @@ -58,12 +57,14 @@ new BaseConfiguration()) { // return an iterator that does not support remove operations - public Iterator getKeys() + public Iterator getKeys() { - Collection keyCol = new ArrayList(); - CollectionUtils.addAll(keyCol, getUnderlyingConfiguration() - .getKeys()); - Object[] keys = keyCol.toArray(); + Collection keyCol = new ArrayList(); + for(Iterator it = getUnderlyingConfiguration().getKeys(); it.hasNext();) + { + keyCol.add(it.next().toString()); + } + String[] keys = keyCol.toArray(new String[keyCol.size()]); return Arrays.asList(keys).iterator(); } }; @@ -128,7 +129,7 @@ { "value4", "value5", "value6" }; config.addProperty("test", lstValues1); config.addProperty("test", Arrays.asList(lstValues2)); - List lst = config.getList("test"); + List lst = config.getList("test"); assertEquals("Wrong number of list elements", 6, lst.size()); for (int i = 0; i < lst.size(); i++) { @@ -209,7 +210,7 @@ String key = KEY_PREFIX + i; if (srcConfig.containsKey(key)) { - List values = config.getList(key); + List values = config.getList(key); assertEquals("Value not added: " + key, 2, values.size()); assertEquals("Wrong value 1 for " + key, "value" + i, values .get(0)); @@ -302,7 +303,7 @@ */ private void checkListProperties(Configuration config) { - List values = config.getList("list1"); + List values = config.getList("list1"); assertEquals("Wrong number of elements in list 1", 3, values.size()); values = config.getList("list2"); assertEquals("Wrong number of elements in list 2", 2, values.size()); @@ -320,10 +321,9 @@ private void checkCopyEvents(CollectingConfigurationListener l, Configuration src, int eventType) { - Map events = new HashMap(); - for (Iterator it = l.events.iterator(); it.hasNext();) + Map events = new HashMap(); + for (ConfigurationEvent e : l.events) { - ConfigurationEvent e = (ConfigurationEvent) it.next(); assertEquals("Wrong event type", eventType, e.getType()); assertTrue("Unknown property: " + e.getPropertyName(), src .containsKey(e.getPropertyName())); @@ -340,7 +340,7 @@ } } - for (Iterator it = src.getKeys(); it.hasNext();) + for (Iterator it = src.getKeys(); it.hasNext();) { String key = (String) it.next(); assertTrue("No event received for key " + key, events @@ -380,7 +380,7 @@ return config.containsKey(key); } - public Iterator getKeys() + public Iterator getKeys() { return config.getKeys(); } @@ -408,7 +408,7 @@ static class CollectingConfigurationListener implements ConfigurationListener { - List events = new ArrayList(); + List events = new ArrayList(); public void configurationChanged(ConfigurationEvent event) {