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 AnonymousFieldsTest.java
Date Fri, 19 Sep 2003 15:20:35 GMT
brj         2003/09/19 08:20:35

  Modified:    src/test/org/apache/ojb/broker AnonymousFieldsTest.java
  Log:
  multilevel vertical inheritance
  - new testcases
  
  Revision  Changes    Path
  1.7       +53 -0     db-ojb/src/test/org/apache/ojb/broker/AnonymousFieldsTest.java
  
  Index: AnonymousFieldsTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/AnonymousFieldsTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AnonymousFieldsTest.java	17 Sep 2003 19:02:33 -0000	1.6
  +++ AnonymousFieldsTest.java	19 Sep 2003 15:20:35 -0000	1.7
  @@ -103,6 +103,30 @@
   
       /**
        * write an entry using vertical inheritance and try to read it again.
  +     * E-F1-G1, autoincrement id in E
  +     */
  +    public void _failing_testVerticalInheritanceStoreAndLoad3() throws Exception
  +    {
  +        // produce some test data G1
  +        ObjectRepository.G1 entry = new ObjectRepository.G1();
  +        entry.setSomeSuperValue(31415926);
  +        entry.setSomeValue(123456);
  +        entry.setSomeSubValue(4242);
  +        Identity oid = new Identity(entry, broker);
  +        broker.store(entry);
  +
  +        // clear cache and retrieve a copy from the DB
  +        broker.clearCache();
  +        ObjectRepository.G1 copy = (ObjectRepository.G1) broker.getObjectByIdentity(oid);
  +
  +        // check equality
  +        assertEquals(entry.getSomeValue(), copy.getSomeValue());
  +        assertEquals(entry.getSomeSuperValue(), copy.getSomeSuperValue());
  +        assertEquals(entry.getSomeSubValue(), copy.getSomeSubValue());
  +    }
  +    
  +    /**
  +     * write an entry using vertical inheritance and try to read it again.
        * E-F
        */
       public void testVerticalInheritanceUpdate() throws Exception
  @@ -149,6 +173,35 @@
           // clear cache and retrieve a copy from the DB
           broker.clearCache();
           ObjectRepository.G copy = (ObjectRepository.G) broker.getObjectByIdentity(oid);
  +
  +        // check equality
  +        assertEquals(entry.getSomeValue(), copy.getSomeValue());
  +        assertEquals(entry.getSomeSuperValue(), copy.getSomeSuperValue());
  +        assertEquals(entry.getSomeSubValue(), copy.getSomeSubValue());
  +    }
  +
  +    /**
  +     * write an entry using vertical inheritance and try to read it again.
  +     * E-F1-G1, autoincrement id in E
  +     */
  +    public void _failing_testVerticalInheritanceUpdate3() throws Exception
  +    {
  +        // produce some test data
  +        ObjectRepository.G1 entry = new ObjectRepository.G1();
  +        entry.setSomeSuperValue(2718281);
  +        entry.setSomeValue(9999);
  +        entry.setSomeSubValue(8888);
  +        Identity oid = new Identity(entry, broker);
  +        broker.store(entry);
  +
  +        entry.setSomeSuperValue(2718282);
  +        entry.setSomeValue(10000);
  +        entry.setSomeSubValue(7777);
  +        broker.store(entry);
  +
  +        // clear cache and retrieve a copy from the DB
  +        broker.clearCache();
  +        ObjectRepository.G1 copy = (ObjectRepository.G1) broker.getObjectByIdentity(oid);
   
           // check equality
           assertEquals(entry.getSomeValue(), copy.getSomeValue());
  
  
  

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