[jbosscache-commits] JBoss Cache SVN: r6561 - in pojo/trunk/src: test/java/org/jboss/cache/pojo and 1 other directory.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Thu Aug 14 15:16:16 EDT 2008


Author: jason.greene at jboss.com
Date: 2008-08-14 15:16:15 -0400 (Thu, 14 Aug 2008)
New Revision: 6561

Modified:
   pojo/trunk/src/main/java/org/jboss/cache/pojo/collection/CachedSetImpl.java
   pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java
Log:
Rmove SPI use from Set


Modified: pojo/trunk/src/main/java/org/jboss/cache/pojo/collection/CachedSetImpl.java
===================================================================
--- pojo/trunk/src/main/java/org/jboss/cache/pojo/collection/CachedSetImpl.java	2008-08-14 10:54:25 UTC (rev 6560)
+++ pojo/trunk/src/main/java/org/jboss/cache/pojo/collection/CachedSetImpl.java	2008-08-14 19:16:15 UTC (rev 6561)
@@ -116,9 +116,9 @@
       return false;
    }
 
-   public Iterator iterator()
+   public Iterator<Object> iterator()
    {
-      Node node = cache.getRoot().getChild(getFqn());
+      Node<Object, Object> node = cache.getRoot().getChild(getFqn());
       if (node == null)
       {
          return Collections.EMPTY_SET.iterator();
@@ -253,16 +253,16 @@
       }
    }
 
-   private class IteratorImpl implements Iterator
+   private class IteratorImpl implements Iterator<Object>
    {
-      private Iterator<NodeSPI> iterator;
+      private Iterator<Node<Object, Object>> iterator;
 
-      private Node node;
+      private Node<Object, Object> node;
       private Object o;
 
-      private IteratorImpl(Node node)
+      private IteratorImpl(Node<Object, Object> node)
       {
-         Collection<NodeSPI> children = new HashSet<NodeSPI>(((NodeSPI) node).getChildrenDirect());
+         Collection<Node<Object, Object>> children = new HashSet<Node<Object, Object>>(node.getChildren());
          iterator = children.iterator();
       }
 

Modified: pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java
===================================================================
--- pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java	2008-08-14 10:54:25 UTC (rev 6560)
+++ pojo/trunk/src/test/java/org/jboss/cache/pojo/LocalTest.java	2008-08-14 19:16:15 UTC (rev 6561)
@@ -17,6 +17,9 @@
 import org.apache.commons.logging.LogFactory;
 import org.jboss.aop.proxy.ClassProxy;
 import org.jboss.cache.Fqn;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.pojo.impl.PojoReference;
 import org.jboss.cache.pojo.test.Address;
 import org.jboss.cache.pojo.test.DoubleRef;
@@ -45,8 +48,11 @@
    {
       log.info("setUp() ....");
       String configFile = "configs/local-tx.xml";
+      XmlConfigurationParser parser = new XmlConfigurationParser();
+      Configuration expected = parser.parseFile(configFile);
+      //expected.setNodeLockingScheme(NodeLockingScheme.MVCC);
       boolean toStart = false;
-      cache_ = PojoCacheFactory.createCache(configFile, toStart);
+      cache_ = PojoCacheFactory.createCache(expected, toStart);
       cache_.start();
    }
 
@@ -62,7 +68,7 @@
    {
       return createPerson(id, name, age, null);
    }
-   
+
    private Person createPerson(String id, String name, int age, Map<String, String> finalMap)
    {
       Person p = new Person(finalMap);
@@ -196,7 +202,7 @@
       {
          fail("Final map is not an instance of ClassProxy");
       }
-      
+
       map.put("test1", "testa");
       map.put("test2", "testb");
 
@@ -408,14 +414,14 @@
       PojoReference ref = (PojoReference) cache_.getCache().get(fqn,  PojoReference.KEY);
       assertTrue(cache_.exists(ref.getFqn()));
    }
-   
+
    public void testDoubleRef() throws Exception
    {
       DoubleRef ref = new DoubleRef();
       cache_.attach("/test", ref);
 
       AssertJUnit.assertSame(ref.getOne(), ref.getTwo());
-      
+
       ref.setOne(null);
       ref.setTwo(null);
    }




More information about the jbosscache-commits mailing list