db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: jakarta-ojb/src/test/org/apache/ojb/broker MtoNMapping.java
Date Mon, 09 Dec 2002 19:27:38 GMT
brj         2002/12/09 11:27:38

  Modified:    src/test/org/apache/ojb/broker MtoNMapping.java
  Log:
  improved insert and delete testcase
  
  Revision  Changes    Path
  1.8       +9 -5      jakarta-ojb/src/test/org/apache/ojb/broker/MtoNMapping.java
  
  Index: MtoNMapping.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/test/org/apache/ojb/broker/MtoNMapping.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MtoNMapping.java	8 Dec 2002 13:16:05 -0000	1.7
  +++ MtoNMapping.java	9 Dec 2002 19:27:38 -0000	1.8
  @@ -202,7 +202,7 @@
       public void testInsertAndDelete() throws Exception
       {
           Person pers = new Person();
  -        pers.setId(2);
  +        pers.setId(7);
           Query query = QueryFactory.newQuery(pers);
           pers = (Person) broker.getObjectByQuery(query);
           Collection projects = pers.getProjects();
  @@ -214,19 +214,23 @@
           projects.remove(oldProj);
           
           newProj = new Project();
  -        newProj.setTitle("Test Project for Person 2");
  -        newProj.setDescription("This is a Test Project for Person 2");
  +        newProj.setTitle("Test Project1 for Person 7");
  +        newProj.setDescription("This is a Test Project1 for Person 7");
  +        projects.add(newProj);
  +
  +        newProj = new Project();
  +        newProj.setTitle("Test Project2 for Person 7");
  +        newProj.setDescription("This is a Test Project2 for Person 7");
           projects.add(newProj);
           
           broker.beginTransaction();
  -        broker.delete(oldProj);
           broker.store(pers);
           broker.commitTransaction();
   
           broker.clearCache();
   
           pers = (Person) broker.getObjectByQuery(query);
  -        assertEquals(count , pers.getProjects().size());
  +        assertEquals(count + 1 , pers.getProjects().size());
   
       }
           
  
  
  

Mime
View raw message