db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From olegn...@apache.org
Subject cvs commit: db-ojb/src/test/org/apache/ojb/broker BatchModeTest.java
Date Tue, 13 Jan 2004 21:50:24 GMT
olegnitz    2004/01/13 13:50:24

  Modified:    src/test/org/apache/ojb/broker BatchModeTest.java
  Log:
  Added test for collection-descriptor without inverse reference-descriptor
  
  Revision  Changes    Path
  1.5       +78 -0     db-ojb/src/test/org/apache/ojb/broker/BatchModeTest.java
  
  Index: BatchModeTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/BatchModeTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BatchModeTest.java	28 Oct 2003 21:05:16 -0000	1.4
  +++ BatchModeTest.java	13 Jan 2004 21:50:24 -0000	1.5
  @@ -137,6 +137,84 @@
           }
       }
   
  +    /**
  +     * collection-descriptor without inverse reference-descriptor
  +     */
  +    public void testBatchStatementsOrder2()
  +    {
  +        ConnectionManagerIF conMan = broker.serviceConnectionManager();
  +        boolean saveBatchMode = conMan.isBatchMode();
  +        try
  +        {
  +            conMan.setBatchMode(true);
  +
  +            broker.beginTransaction();
  +
  +            Zoo zoo1 = new Zoo();
  +            zoo1.setZooId(20001);
  +            zoo1.setName("BatchModeTest Zoo #1");
  +            broker.store(zoo1);
  +
  +            conMan.executeBatch();
  +
  +            Mammal m1 = new Mammal();
  +            m1.setAnimalId(20001);
  +            m1.setName("BatchModeTest Mammal #1");
  +            m1.setAge(5);
  +            m1.setNumLegs(4);
  +            m1.setZooId(zoo1.getZooId());
  +            zoo1.getAnimals().add(m1);
  +            broker.store(m1);
  +
  +            Zoo zoo2 = new Zoo();
  +            zoo2.setZooId(20002);
  +            zoo2.setName("BatchModeTest Zoo #2");
  +            broker.store(zoo2);
  +
  +            Mammal m2 = new Mammal();
  +            m2.setAnimalId(20002);
  +            m2.setName("BatchModeTest Mammal #2");
  +            m2.setAge(5);
  +            m2.setNumLegs(4);
  +            m2.setZooId(zoo2.getZooId());
  +            zoo2.getAnimals().add(m2);
  +            broker.store(m2);
  +
  +            Zoo zoo3 = new Zoo();
  +            zoo3.setZooId(20003);
  +            zoo3.setName("BatchModeTest Zoo #3");
  +            broker.store(zoo3);
  +
  +            Mammal m3 = new Mammal();
  +            m3.setAnimalId(20003);
  +            m3.setName("BatchModeTest Mammal #3");
  +            m3.setAge(5);
  +            m3.setNumLegs(4);
  +            m3.setZooId(zoo3.getZooId());
  +            zoo3.getAnimals().add(m3);
  +            broker.store(m3);
  +
  +            conMan.executeBatch();
  +
  +            broker.delete(m1);
  +
  +            conMan.executeBatch();
  +
  +            broker.delete(zoo1);
  +            broker.delete(m2);
  +            broker.delete(zoo2);
  +            broker.delete(m3);
  +            broker.delete(zoo3);
  +
  +            conMan.executeBatch();
  +        }
  +        finally
  +        {
  +            broker.commitTransaction();
  +            conMan.setBatchMode(saveBatchMode);
  +        }
  +    }
  +
       public void testMassInsertDelete()
       {
           String name = "testMassInsert_" + System.currentTimeMillis();
  
  
  

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