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 M2NTest.java
Date Sun, 08 May 2005 08:52:29 GMT
brj         2005/05/08 01:52:29

  Modified:    src/test/org/apache/ojb/broker Tag: OJB_1_0_RELEASE
                        M2NTest.java
  Log:
  clear cache after commit
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.7.2.6   +14 -24    db-ojb/src/test/org/apache/ojb/broker/M2NTest.java
  
  Index: M2NTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/M2NTest.java,v
  retrieving revision 1.7.2.5
  retrieving revision 1.7.2.6
  diff -u -r1.7.2.5 -r1.7.2.6
  --- M2NTest.java	6 May 2005 18:30:18 -0000	1.7.2.5
  +++ M2NTest.java	8 May 2005 08:52:29 -0000	1.7.2.6
  @@ -1,8 +1,13 @@
   package org.apache.ojb.broker;
   
  +import java.util.ArrayList;
  +import java.util.Collection;
  +import java.util.Iterator;
  +import java.util.List;
  +
  +import org.apache.commons.lang.ClassUtils;
   import org.apache.commons.lang.builder.ToStringBuilder;
   import org.apache.commons.lang.time.StopWatch;
  -import org.apache.commons.lang.ClassUtils;
   import org.apache.ojb.broker.metadata.ClassDescriptor;
   import org.apache.ojb.broker.metadata.CollectionDescriptor;
   import org.apache.ojb.broker.metadata.ObjectReferenceDescriptor;
  @@ -11,11 +16,6 @@
   import org.apache.ojb.broker.query.QueryFactory;
   import org.apache.ojb.junit.PBTestCase;
   
  -import java.util.ArrayList;
  -import java.util.Collection;
  -import java.util.Iterator;
  -import java.util.List;
  -
   /**
    * Test (non-decomposed) M:N relations.
    *
  @@ -643,6 +643,7 @@
           broker.beginTransaction();
           broker.store(movie);
           broker.commitTransaction();
  +        broker.clearCache();
   
           /*
           auto-update settings is false, so only the movie object should be
  @@ -773,6 +774,7 @@
           broker.beginTransaction();
           broker.store(movie);
           broker.commitTransaction();
  +        broker.clearCache();
   
           Query queryMovie = queryMovie(postfix);
           Collection resultMovie = broker.getCollectionByQuery(queryMovie);
  @@ -813,6 +815,7 @@
           broker.beginTransaction();
           broker.store(movie);
           broker.commitTransaction();
  +        broker.clearCache();
   
           Query queryMovie = queryMovie(postfix);
           Collection resultMovie = broker.getCollectionByQuery(queryMovie);
  @@ -855,6 +858,7 @@
           broker.beginTransaction();
           broker.store(movie);
           broker.commitTransaction();
  +        broker.clearCache();
   
           Query queryMovie = queryMovie(postfix);
           Collection resultMovie = broker.getCollectionByQuery(queryMovie);
  @@ -1211,12 +1215,7 @@
   
       void changeActorCollectionDescriptorTo(boolean autoRetrieve, int autoUpdate, int autoDelete,
boolean proxy)
       {
  -        ClassDescriptor cld = broker.getClassDescriptor(Actor.class);
  -        CollectionDescriptor cod = (CollectionDescriptor) cld.getCollectionDescriptors().get(0);
  -        cod.setLazy(proxy);
  -        cod.setCascadeRetrieve(autoRetrieve);
  -        cod.setCascadingStore(autoUpdate);
  -        cod.setCascadingDelete(autoDelete);
  +        ojbChangeReferenceSetting(Actor.class, "movies", autoRetrieve, autoUpdate, autoDelete,
proxy);
       }
   
       void changeActorCollectionDescriptorTo(boolean autoRetrieve, boolean autoUpdate, boolean
autoDelete, boolean proxy)
  @@ -1231,17 +1230,8 @@
   
       void changeMovieCollectionDescriptorTo(boolean autoRetrieve, int autoUpdate, int autoDelete,
boolean proxy)
       {
  -        ClassDescriptor cld = broker.getClassDescriptor(MovieImpl.class);
  -        Iterator iter = cld.getCollectionDescriptors().iterator();
  -
  -        while (iter.hasNext())
  -        {
  -            CollectionDescriptor cod = (CollectionDescriptor) iter.next();
  -            cod.setLazy(proxy);
  -            cod.setCascadeRetrieve(autoRetrieve);
  -            cod.setCascadingStore(autoUpdate);
  -            cod.setCascadingDelete(autoDelete);
  -        }
  +        ojbChangeReferenceSetting(MovieImpl.class, "actors", autoRetrieve, autoUpdate,
autoDelete, proxy);
  +        ojbChangeReferenceSetting(MovieImpl.class, "actors2", autoRetrieve, autoUpdate,
autoDelete, proxy);
       }
   
   
  
  
  

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