db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/test/org/apache/ojb/broker PersistenceBrokerTest.java
Date Sun, 23 Nov 2003 09:23:38 GMT
brj         2003/11/23 01:23:38

  Modified:    src/test/org/apache/ojb/broker PersistenceBrokerTest.java
  Log:
  testcase to compare sizes returned byGetCollectionByQuery and getIteratorByQuery
  
  Revision  Changes    Path
  1.35      +23 -0     db-ojb/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java
  
  Index: PersistenceBrokerTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- PersistenceBrokerTest.java	20 Nov 2003 20:58:35 -0000	1.34
  +++ PersistenceBrokerTest.java	23 Nov 2003 09:23:38 -0000	1.35
  @@ -1361,6 +1361,29 @@
   
           assertEquals("Both sizes must be equal", set.size(), result.size());     
       }
  + 
  +    /**
  +     * Size returned by Iterator must be same as size of Collection 
  +     */
  +    public void testIteratorSize()
  +    {
  +        OJBIterator ojbIter;
  +        Criteria crit;
  +        QueryByCriteria query;
  +        int collSize;
  +        int iterSize;
  +        
  +        crit = new Criteria();
  +        query = QueryFactory.newQuery(Article.class, crit);
  +        
  +        collSize = broker.getCollectionByQuery(query).size();
  +        
  +        ojbIter = (OJBIterator)broker.getIteratorByQuery(query);
  +        iterSize = ojbIter.size();
  +        
  +        assertEquals("collSize == iterSize", collSize , iterSize);
  +        ojbIter.releaseDbResources();
  +    }
       
       public void testPaging()
       {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message