OK, here you go.  Three tests, one passes, two fail:

  |     public void testGetChildren5()
  |     {
  |         try {
  |             cache.put("/a/1", null);
  |             cache.put("/a/2", null);
  |             cache.put("/a/3", null);
  |             System.out.println("cache is " + cache.printLockInfo());
  |             cache.evict(Fqn.fromString("/a/1"));
  |             cache.evict(Fqn.fromString("/a/2"));
  |             cache.evict(Fqn.fromString("/a/3"));
  |             cache.evict(Fqn.fromString("/a"));
  |             System.out.println("cache is " + cache.printLockInfo());
  | 
  |             assertNotNull(cache.get("/a"));
  | 
  |             Set children = cache.getChildrenNames("/a");
  |             assertNotNull("No children were loaded", children);
  |             System.out.println("children: "+children);
  |             assertEquals("3 children weren't loaded", 3, children.size());
  |         } catch (Exception e) {
  |             fail(e.toString());
  |         }
  |     }
  | 
  |     public void testGetChildren6()
  |     {
  |         try {
  |             cache.put("/a/1", null);
  |             cache.put("/a/2", null);
  |             cache.put("/a/3", null);
  |             cache.put("/a", "test", "test");
  |             System.out.println("cache is " + cache.printLockInfo());
  |             cache.evict(Fqn.fromString("/a/1"));
  |             cache.evict(Fqn.fromString("/a/2"));
  |             cache.evict(Fqn.fromString("/a/3"));
  |             cache.evict(Fqn.fromString("/a"));
  |             System.out.println("cache is " + cache.printLockInfo());
  | 
  |             assertEquals("attributes weren't loaded", "test", 
cache.get("/a", "test"));
  | 
  |             Set children = cache.getChildrenNames("/a");
  |             assertNotNull("No children were loaded", children);
  |             System.out.println("children: "+children);
  |             assertEquals("3 children weren't loaded", 3, children.size());
  |         } catch (Exception e) {
  |             fail(e.toString());
  |         }
  |     }
  | 
  |     public void testGetChildren7()
  |     {
  |         try {
  |             cache.put("/a/1", null);
  |             cache.put("/a/2", null);
  |             cache.put("/a/3", null);
  |             System.out.println("cache is " + cache.printLockInfo());
  |             cache.evict(Fqn.fromString("/a/1"));
  |             cache.evict(Fqn.fromString("/a/2"));
  |             cache.evict(Fqn.fromString("/a/3"));
  |             cache.evict(Fqn.fromString("/a"));
  |             System.out.println("cache is " + cache.printLockInfo());
  | 
  |             assertNull(cache.get("/a","test"));
  | 
  |             cache.get("/a/1");
  |             Set children = cache.getChildrenNames("/a");
  |             assertNotNull("No children were loaded", children);
  |             System.out.println("children: "+children);
  |             assertEquals("3 children weren't loaded", 3, children.size());
  |         } catch (Exception e) {
  |             fail(e.toString());
  |         }
  |     }
  | 

I tested these out with the FileCacheLoaderTest, but they should happen the 
same everywhere.  Actually, the first one may fail or not depending on the 
CacheLoader implementation, but the last two always will.

All of them start out the same. I fill up the cache, then evict all of the 
nodes (so they are still present in the persistent store, but not in memory).

testGetChildren5 is a slightly modified version of what you sent. It calls 
get("/a") to get the entire /a node, and then calls getChildrenNames().  This 
seems to work fine.

testGetChildren6 and 7 call get("/a","test"), the form of get which fetches an 
attribute rather than an entire node.  This is where I ran into problems, and 
this is where it fails.  In 6, after I evict all of the nodes, I call get to 
fetch one attribute from /a.  Then I call getChildrenNames, which returns null 
(should return ([1],[2],[3])).  To further illustrate what's happening, in 7 I 
call get("/a/1") in addition to get("/a","test").  As you can see, it 
successfully loads the /a/1 node, but now when I call getChildrenNames, it 
returns me a list with a single element, [1].

To verify that it wasn't the presence or absence of attributes, in 6 I actually 
added an attribute named "test", while in 7 I didn't.    In either case, when I 
get the attributes of a node, it clears the UNINITIALIZED flag, and then it 
fails to load the children in the CacheLoaderInterceptor.


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3872989#3872989

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3872989


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to