geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r410878 - /geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/command/VariablesMapTest.java
Date Thu, 01 Jun 2006 15:50:23 GMT
Author: jdillon
Date: Thu Jun  1 08:50:23 2006
New Revision: 410878

URL: http://svn.apache.org/viewvc?rev=410878&view=rev
Log:
Improve tests

Modified:
    geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/command/VariablesMapTest.java

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/command/VariablesMapTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/command/VariablesMapTest.java?rev=410878&r1=410877&r2=410878&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/command/VariablesMapTest.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/command/VariablesMapTest.java
Thu Jun  1 08:50:23 2006
@@ -20,6 +20,7 @@
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Iterator;
 
 /**
  * Unit tests for the {@link VariablesMap} class.
@@ -225,5 +226,27 @@
         assertNotNull(vars.parent());
 
         assertEquals(parent, vars.parent());
+    }
+
+    public void testNames() throws Exception {
+        VariablesMap vars = new VariablesMap();
+        Iterator<String> iter = vars.names();
+        assertNotNull(iter);
+        assertFalse(iter.hasNext());
+    }
+
+    public void testNamesImmutable() throws Exception {
+        VariablesMap vars = new VariablesMap();
+        vars.set("a", "b");
+
+        Iterator<String> iter = vars.names();
+        iter.next();
+
+        try {
+            iter.remove();
+        }
+        catch (UnsupportedOperationException expected) {
+            // ignore
+        }
     }
 }



Mime
View raw message