harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r549399 - in /harmony/enhanced/classlib/branches/java6/modules/luni/src: main/java/java/util/ListResourceBundle.java test/api/common/tests/api/java/util/ListResourceBundleTest.java
Date Thu, 21 Jun 2007 06:05:21 GMT
Author: tonywu
Date: Wed Jun 20 23:05:20 2007
New Revision: 549399

URL: http://svn.apache.org/viewvc?view=rev&rev=549399
Log: (empty)

Modified:
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/ListResourceBundle.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/ListResourceBundleTest.java

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/ListResourceBundle.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/ListResourceBundle.java?view=diff&rev=549399&r1=549398&r2=549399
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/ListResourceBundle.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/ListResourceBundle.java
Wed Jun 20 23:05:20 2007
@@ -138,4 +138,15 @@
             }
         }
     }
+    
+    /**
+     * Answers a set of the keys in this ResourceBundle but not in its parents.
+     * 
+     * @return a set of the keys in this ResourceBundle but not in its parents.
+     * @since 1.6
+     */
+    protected Set<String> handleKeySet() {
+        initializeTable();
+        return table.keySet();
+    }
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/ListResourceBundleTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/ListResourceBundleTest.java?view=diff&rev=549399&r1=549398&r2=549399
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/ListResourceBundleTest.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/ListResourceBundleTest.java
Wed Jun 20 23:05:20 2007
@@ -20,8 +20,10 @@
 import java.util.Enumeration;
 import java.util.Locale;
 import java.util.ResourceBundle;
+import java.util.Set;
 import java.util.Vector;
 
+import tests.resources.subfolder.tests.resources.hyts_resource_fr_FR;
 public class ListResourceBundleTest extends junit.framework.TestCase {
 
 	/**
@@ -46,6 +48,45 @@
 		assertTrue("Missing key child3", result.contains("child3"));
 	}
 
+    /**
+     * @tests {@link java.util.ListResourceBundle#handleKeySet()}
+     * @since 1.6
+     */
+    @SuppressWarnings("nls")
+    public void test_handleKeySet() {
+        ResourceBundle.clearCache();
+        hyts_resource_fr_FR bundle = (hyts_resource_fr_FR) ResourceBundle
+                .getBundle(
+                        "tests.resources.subfolder.tests.resources.hyts_resource",
+                        new Locale("fr", "FR"));
+        Set<String> set = bundle.handleKeySet();
+        assertEquals(4, set.size());
+        assertTrue(set.contains("subChild1"));
+        assertTrue(set.contains("subChild2"));
+        assertTrue(set.contains("subParent3"));
+        assertTrue(set.contains("subParent4"));
+        set = bundle.keySet();
+        assertEquals(6, set.size());
+        assertTrue(set.contains("subChild1"));
+        assertTrue(set.contains("subChild2"));
+        assertTrue(set.contains("subParent1"));
+        assertTrue(set.contains("subParent2"));
+        assertTrue(set.contains("subParent3"));
+        assertTrue(set.contains("subParent4"));
+    }
+    
+    public void test_handleGetObject(){
+        ResourceBundle.clearCache();
+        hyts_resource_fr_FR bundle = (hyts_resource_fr_FR) ResourceBundle
+                .getBundle(
+                        "tests.resources.subfolder.tests.resources.hyts_resource",
+                        new Locale("fr", "FR"));
+        try{
+            bundle.handleGetObject(null);
+            fail("Should throw NPE");
+        }catch(NullPointerException e){
+        }
+    }
 	protected void setUp() {
 	}
 



Mime
View raw message