Author: manik.surtani(a)jboss.com
Date: 2008-02-08 13:48:35 -0500 (Fri, 08 Feb 2008)
New Revision: 5340
Modified:
core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java
Log:
Rolled back immutable/defensively copied map performance enhancement
Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java 2008-02-08 18:47:21 UTC
(rev 5339)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java 2008-02-08 18:48:35 UTC
(rev 5340)
@@ -178,6 +178,31 @@
tm.commit();
}
+ public void testImmutabilityOfData()
+ {
+ rootNode.put("key", "value");
+ Map<Object, Object> m = rootNode.getData();
+ try
+ {
+ m.put("x", "y");
+ fail("Map should be immutable!!");
+ }
+ catch (Exception e)
+ {
+ // expected
+ }
+
+ try
+ {
+ rootNode.getKeys().add(new Object());
+ fail("Key set should be immutable");
+ }
+ catch (Exception e)
+ {
+ // expected
+ }
+ }
+
public void testImmutabilityOfChildren()
{
rootNode.addChild(A);