incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r307134 - in /incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl: PersistenceManagerBeanQueryTest.java PersistenceManagerIteratorQueryTest.java
Date Fri, 07 Oct 2005 14:44:51 GMT
Author: clombart
Date: Fri Oct  7 07:44:42 2005
New Revision: 307134

URL: http://svn.apache.org/viewcvs?rev=307134&view=rev
Log:
* Add unit test for getObjectIterator
* Drop temp. PersistenceManagerBeanQueryTest - I don't know if it is possible to makes query
on subnodes. 

Added:
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerIteratorQueryTest.java
      - copied, changed from r307132, incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerBeanQueryTest.java
Removed:
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerBeanQueryTest.java

Copied: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerIteratorQueryTest.java
(from r307132, incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerBeanQueryTest.java)
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerIteratorQueryTest.java?p2=incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerIteratorQueryTest.java&p1=incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerBeanQueryTest.java&r1=307132&r2=307134&rev=307134&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerBeanQueryTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerIteratorQueryTest.java
Fri Oct  7 07:44:42 2005
@@ -18,6 +18,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Iterator;
 
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
@@ -39,19 +40,19 @@
 
 
 /**
- * Test QueryManagerImpl Query methods
+ * Test Object Iterator
  *
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
  */
-public class PersistenceManagerBeanQueryTest extends TestBase
+public class PersistenceManagerIteratorQueryTest extends TestBase
 {
-    private final static Log log = LogFactory.getLog(PersistenceManagerBeanQueryTest.class);
+    private final static Log log = LogFactory.getLog(PersistenceManagerIteratorQueryTest.class);
 
     /**
      * <p>Defines the test case name for junit.</p>
      * @param testName The test case name.
      */
-    public PersistenceManagerBeanQueryTest(String testName)  throws Exception
+    public PersistenceManagerIteratorQueryTest(String testName)  throws Exception
     {
         super(testName);
     }
@@ -59,7 +60,7 @@
     public static Test suite()
     {
         // All methods starting with "test" will be executed in the test suite.
-        return new TestSuite(PersistenceManagerBeanQueryTest.class);
+        return new TestSuite(PersistenceManagerIteratorQueryTest.class);
     }
 
     
@@ -80,9 +81,18 @@
     	      Filter filter = queryManager.createFilter(Page.class);        	      
     	      Query query = queryManager.createQuery(filter);    	      
     	      PersistenceManager persistenceManager = this.getPersistenceManager();
+    	      
+    	      long  start = System.currentTimeMillis();
+    	      Iterator iterator = persistenceManager.getObjectIterator(query);
+    	      System.out.println("getObject takes : " + (System.currentTimeMillis() - start));
+    	          	      
+    	      start = System.currentTimeMillis();
     	      Collection result = persistenceManager.getObjects(query);
+    	      System.out.println("getObject takes : " + (System.currentTimeMillis() - start));
  
     	      
-    	      assertTrue("Invalid number of objects - should be = 4", result.size() == 4);
+    	      start = System.currentTimeMillis();
+    	      iterator = persistenceManager.getObjectIterator(query);
+    	      System.out.println("getObject takes : " + (System.currentTimeMillis() - start));
      	      
 
     	      
         }



Mime
View raw message