Author: manik.surtani(a)jboss.com
Date: 2008-10-14 08:35:58 -0400 (Tue, 14 Oct 2008)
New Revision: 6932
Modified:
core/branches/2.2.X/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java
Log:
Added test for JBCACHE-1426
Modified:
core/branches/2.2.X/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java
===================================================================
---
core/branches/2.2.X/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java 2008-10-14
12:07:32 UTC (rev 6931)
+++
core/branches/2.2.X/src/test/java/org/jboss/cache/loader/CacheLoaderTestsBase.java 2008-10-14
12:35:58 UTC (rev 6932)
@@ -833,10 +833,32 @@
assertEquals("Has key 'one", "one",
data.get("one"));
assertEquals("Has key 'two", "two",
data.get("two"));
assertEquals("Has key 'three", "three",
data.get("three"));
-
+
}
+ public void testPutNullDataMap() throws Exception
+ {
+ Fqn f = Fqn.fromString("/a");
+ assert !cache.exists(f);
+ assert !loader.exists(f);
+ cache.put(f, null);
+ Map fromLoader = loader.get(f);
+ assert fromLoader != null : "Node should exist in the loader";
+ assert fromLoader.isEmpty() : "Should not contain any data";
+ }
+ public void testPutNullDataMapNodeHasData() throws Exception
+ {
+ Fqn f = Fqn.fromString("/a");
+ cache.put(f, "key", "value");
+ assert cache.exists(f);
+ assert loader.exists(f);
+ cache.put(f, null);
+ Map fromLoader = loader.get(f);
+ assert fromLoader != null : "Node should exist in the loader";
+ assert fromLoader.size() == 1 : "Should contain original data";
+ }
+
public void testRemoveData()
{
String key = "/x/y/z/";
Show replies by date