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 InheritanceMultipleTableTest.java
Date Thu, 06 May 2004 19:51:37 GMT
brj         2004/05/06 12:51:37

  Modified:    src/test/org/apache/ojb/broker
                        InheritanceMultipleTableTest.java
  Log:
  improved testcase
  
  Revision  Changes    Path
  1.5       +27 -5     db-ojb/src/test/org/apache/ojb/broker/InheritanceMultipleTableTest.java
  
  Index: InheritanceMultipleTableTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/InheritanceMultipleTableTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- InheritanceMultipleTableTest.java	19 Apr 2004 16:31:15 -0000	1.4
  +++ InheritanceMultipleTableTest.java	6 May 2004 19:51:37 -0000	1.5
  @@ -2,6 +2,7 @@
   
   import java.util.ArrayList;
   import java.util.Collection;
  +import java.util.Iterator;
   import java.util.List;
   
   import org.apache.commons.lang.builder.EqualsBuilder;
  @@ -124,19 +125,36 @@
           crit.addLike("name", name+"%");
           Query query = QueryFactory.newQuery(Employee.class, crit);
           Collection result = broker.getCollectionByQuery(query);
  -        assertEquals(6, result.size());
  -
  +        assertEquals(6, result.size());       
  +        for(Iterator iterator = result.iterator(); iterator.hasNext();)
  +        {
  +            Employee obj = (Employee) iterator.next();
  +            assertNotNull(obj.getName());
  +        }
  +        
  +        broker.clearCache();
           crit = new Criteria();
           crit.addLike("name", name+"%");
           query = QueryFactory.newQuery(Executive.class, crit);
           result = broker.getCollectionByQuery(query);
           assertEquals(5, result.size());
  -
  +        for(Iterator iterator = result.iterator(); iterator.hasNext();)
  +        {
  +            Executive obj = (Executive) iterator.next();
  +            assertNotNull(obj.getName());
  +        }
  +        
  +        broker.clearCache();
           crit = new Criteria();
           crit.addLike("name", name+"%");
           query = QueryFactory.newQuery(Manager.class, crit);
           result = broker.getCollectionByQuery(query);
           assertEquals(3, result.size());
  +        for(Iterator iterator = result.iterator(); iterator.hasNext();)
  +        {
  +            Manager obj = (Manager) iterator.next();
  +            assertNotNull(obj.getName());
  +        }
       }
   
       public void testQuery_InheritedField()
  @@ -205,7 +223,11 @@
           Query query = QueryFactory.newQuery(Executive.class, crit);
           Collection result = broker.getCollectionByQuery(query);
           assertEquals(1, result.size());
  -    }
  +
  +        Executive retManager = (Executive) result.iterator().next();
  +        assertNotNull(retManager);
  +        assertEquals(name + "_manager_1", retManager.getName());
  +   }
   
       public void testQuery_InheritedReference_3()
       {
  
  
  

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