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 QueryTest.java
Date Wed, 12 May 2004 19:36:02 GMT
brj         2004/05/12 12:36:02

  Modified:    src/test/org/apache/ojb/broker QueryTest.java
  Log:
  testcase for count with orderBy
  
  Revision  Changes    Path
  1.56      +19 -0     db-ojb/src/test/org/apache/ojb/broker/QueryTest.java
  
  Index: QueryTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/QueryTest.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- QueryTest.java	5 Apr 2004 17:11:48 -0000	1.55
  +++ QueryTest.java	12 May 2004 19:36:02 -0000	1.56
  @@ -117,6 +117,25 @@
       }
   
       /**
  +	 * test OrderBy and Count
  +	 */
  +    public void testOrderByCount()
  +    {
  +        Criteria crit = new Criteria();
  +        crit.addEqualTo("firstname", "tom");
  +        QueryByCriteria q = QueryFactory.newQuery(Person.class, crit);
  +        q.addOrderByAscending("firstname");
  +
  +        Collection results = broker.getCollectionByQuery(q);
  +        assertNotNull(results);
  +        assertTrue(results.size() > 0);
  +        
  +        // compare with count
  +        int count = broker.getCount(q);
  +        assertEquals(results.size(), count);        
  +    }
  +    
  +    /**
   	 * test Subquery get all product groups without articles
   	 *
   	 * test may fail if db does not support sub queries
  
  
  

---------------------------------------------------------------------
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