db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/test/org/apache/ojb/broker PBRollbackTest.java
Date Sat, 27 Nov 2004 02:12:38 GMT
arminw      2004/11/26 18:12:38

  Modified:    src/test/org/apache/ojb/broker Tag: OJB_1_0_RELEASE
                        PBRollbackTest.java
  Log:
  improve test
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.8.2.1   +11 -2     db-ojb/src/test/org/apache/ojb/broker/PBRollbackTest.java
  
  Index: PBRollbackTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/PBRollbackTest.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  --- PBRollbackTest.java	31 May 2004 22:57:21 -0000	1.8
  +++ PBRollbackTest.java	27 Nov 2004 02:12:38 -0000	1.8.2.1
  @@ -4,6 +4,7 @@
   import org.apache.ojb.broker.query.Query;
   import org.apache.ojb.broker.query.QueryByCriteria;
   import org.apache.ojb.broker.util.collections.ManageableVector;
  +import org.apache.ojb.broker.metadata.ObjectReferenceDescriptor;
   import org.apache.ojb.junit.PBTestCase;
   
   import java.util.ArrayList;
  @@ -254,6 +255,14 @@
   
       public void testRollbackCausedBySQLException() throws Exception
       {
  +        // first we change metadata settings
  +        ojbChangeReferenceSetting(
  +                Project.class,
  +                "persons",
  +                true,
  +                ObjectReferenceDescriptor.CASCADE_OBJECT,
  +                ObjectReferenceDescriptor.CASCADE_OBJECT,
  +                false);
           ArrayList projects = getNewProjects(5);
           PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
           Query q;
  @@ -278,12 +287,12 @@
           {
               broker.beginTransaction();
               projects = getNewProjects(5);
  -
               Project badProject = (Project) projects.get(0);
               badProject.setTitle("Bad project!");
  +            // set wrong kind of object to force exception
               badProject.setPersons(projects);
   
  -            System.err.println("!! The follwing SQLException is part of the Test !!");
  +            System.err.println("!! The following SQLException is part of the Test !!");
               storeObjects(broker, projects);
   
               fail("Test should throw a exception in place");
  
  
  

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