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 Fri, 19 Nov 2004 19:03:23 GMT
brj         2004/11/19 11:03:23

  Modified:    src/test/org/apache/ojb/broker Tag: OJB_1_0_RELEASE
                        M2NTest.java
  Log:
  auto-update = OBJECT for bidirectional m:n-relationship
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.7.2.3   +40 -1     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.2
  retrieving revision 1.7.2.3
  diff -u -r1.7.2.2 -r1.7.2.3
  --- M2NTest.java	21 Sep 2004 00:29:02 -0000	1.7.2.2
  +++ M2NTest.java	19 Nov 2004 19:03:22 -0000	1.7.2.3
  @@ -688,6 +688,45 @@
           assertEquals(3, readMovie.getActors().size());
       }
   
  +    /**
  +     * movies with back-references
  +     * auto-update = OBJECT 
  +     */
  +    public void testStoreTTFT_2()
  +    {
  +        changeMovieCollectionDescriptorTo(true, OBJECT, NONE, true);
  +        changeActorCollectionDescriptorTo(true, OBJECT, NONE, false);
  +        doTestStoreTTXX_2();
  +    }
  +
  +    public void doTestStoreTTXX_2()
  +    {
  +        String postfix = "" + System.currentTimeMillis();
  +        Movie movie = buildMovieWithActorsAndBackReferences(postfix);
  +
  +        broker.beginTransaction();
  +        broker.store(movie);
  +        broker.commitTransaction();
  +
  +        Query queryMovie = movieQuery(postfix);
  +        Collection resultMovie = broker.getCollectionByQuery(queryMovie);
  +        assertEquals(3, resultMovie.size());
  +
  +        Query queryActor = actorQuery(postfix);
  +        Collection resultActor = broker.getCollectionByQuery(queryActor);
  +        assertEquals(3, resultActor.size());
  +
  +        Query queryRole = roleQuery(null, movie);
  +        Collection resultRole = broker.getCollectionByQuery(queryRole);
  +        assertEquals(3, resultRole.size());
  +
  +        broker.clearCache();
  +        Identity oid = new Identity(movie, broker);
  +        Movie readMovie = (Movie) broker.getObjectByIdentity(oid);
  +        assertNotNull(readMovie);
  +        assertEquals(3, readMovie.getActors().size());
  +    }
  +    
       public void testStoreUpdateTTFF()
       {
           changeMovieCollectionDescriptorTo(true, OBJECT, NONE, false);
  
  
  

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