You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ar...@apache.org on 2005/01/23 04:03:20 UTC

cvs commit: db-ojb/src/test/org/apache/ojb OJB-logging.properties repository.dtd repository_database.xml repository_junit_cache.xml web.xml

arminw      2005/01/22 19:03:20

  Modified:    src/test/org/apache/ojb/broker/cache Tag: OJB_1_0_RELEASE
                        LocalCacheTest.java ObjectCacheTest.java
               src/test/org/apache/ojb/broker/cloneable Tag:
                        OJB_1_0_RELEASE CloneableGroup.java
               src/test/org/apache/ojb/broker/locking Tag: OJB_1_0_RELEASE
                        LockTestCommitedReads.java
               src/test/org/apache/ojb/broker/sqlcount Tag: OJB_1_0_RELEASE
                        EmptyCacheCountTest.java TwoLevelSimpleTest.java
               src/test/org/apache/ojb/broker Tag: OJB_1_0_RELEASE
                        ArticleProxy.java BrokerExamples.java
                        CollectionTest.java InterfaceArticle.java
               src/test/org/apache/ojb/junit Tag: OJB_1_0_RELEASE
                        OJBTestCase.java
               src/test/org/apache/ojb/odmg Tag: OJB_1_0_RELEASE
                        M2NTest.java ODMGRollbackTest.java
                        OneToManyTest.java
               src/test/org/apache/ojb/otm Tag: OJB_1_0_RELEASE
                        OtmExamples.java
               src/test/org/apache/ojb Tag: OJB_1_0_RELEASE
                        OJB-logging.properties repository.dtd
                        repository_database.xml repository_junit_cache.xml
                        web.xml
  Log:
  checked in a first version of a two-level cache
  do remove some unused ObjectCache implementations
  update the docs
  fix/update test cases
  try to fix concurrency problems in locking package
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.2.2.1   +173 -28   db-ojb/src/test/org/apache/ojb/broker/cache/LocalCacheTest.java
  
  Index: LocalCacheTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/cache/LocalCacheTest.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- LocalCacheTest.java	22 Jun 2004 18:16:21 -0000	1.2
  +++ LocalCacheTest.java	23 Jan 2005 03:03:19 -0000	1.2.2.1
  @@ -21,8 +21,6 @@
   import java.util.List;
   
   import org.apache.ojb.broker.Identity;
  -import org.apache.ojb.broker.metadata.ClassDescriptor;
  -import org.apache.ojb.broker.metadata.MetadataException;
   import org.apache.ojb.broker.metadata.ObjectReferenceDescriptor;
   import org.apache.ojb.broker.query.Criteria;
   import org.apache.ojb.broker.query.Query;
  @@ -38,8 +36,8 @@
    */
   public class LocalCacheTest extends PBTestCase
   {
  -    private static final int CASCADE_NONE = ObjectReferenceDescriptor.CASCADE_NONE;
  -    private static final int CASCADE_LINK = ObjectReferenceDescriptor.CASCADE_LINK;
  +//    private static final int CASCADE_NONE = ObjectReferenceDescriptor.CASCADE_NONE;
  +//    private static final int CASCADE_LINK = ObjectReferenceDescriptor.CASCADE_LINK;
       private static final int CASCADE_OBJECT = ObjectReferenceDescriptor.CASCADE_OBJECT;
   
       public static void main(String[] args)
  @@ -50,20 +48,16 @@
   
       public void tearDown() throws Exception
       {
  -        setReferenceMetadata(Person.class, "father", true, CASCADE_NONE, CASCADE_NONE, false);
  -        setReferenceMetadata(Person.class, "grandfather", true, CASCADE_NONE, CASCADE_NONE, false);
  -        setReferenceMetadata(Person.class, "childs", true, CASCADE_NONE, CASCADE_NONE, false);
  -        setReferenceMetadata(Person.class, "grandchilds", true, CASCADE_NONE, CASCADE_NONE, false);
           super.tearDown();
       }
   
       public void testCircularStore()
       {
           // prepare test
  -        setReferenceMetadata(Person.class, "father", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  -        setReferenceMetadata(Person.class, "grandfather", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  -        setReferenceMetadata(Person.class, "childs", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  -        setReferenceMetadata(Person.class, "grandchilds", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +        ojbChangeReferenceSetting(Person.class, "father", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +        ojbChangeReferenceSetting(Person.class, "grandfather", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +        ojbChangeReferenceSetting(Person.class, "childs", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +        ojbChangeReferenceSetting(Person.class, "grandchilds", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
   
           String postfix = "_testCircularStore_" + System.currentTimeMillis();
           Person junior = createComplexFamily(postfix);
  @@ -93,32 +87,183 @@
   
           Collection result = broker.getCollectionByQuery(q);
           assertEquals(2, result.size());
  -        for (Iterator iterator = result.iterator(); iterator.hasNext();)
  +        for(Iterator iterator = result.iterator(); iterator.hasNext();)
           {
  -            Person p =  (Person)iterator.next();
  +            Person p = (Person) iterator.next();
               assertNotNull(p.getFather());
  -            assertEquals("jeffJunior"+postfix, p.getFather().getName());
  +            assertEquals("jeffJunior" + postfix, p.getFather().getName());
               assertNotNull(p.getGrandfather());
  -            assertEquals("jeffSenior"+postfix, p.getGrandfather().getName());
  +            assertEquals("jeffSenior" + postfix, p.getGrandfather().getName());
           }
       }
   
  -    private void setReferenceMetadata(Class clazz, String reference, boolean autoretrieve, int autoupdate, int autodelete, boolean useProxy)
  +    /**
  +     * same as above but without clearing the cache
  +     */
  +    public void testCircularStore_2()
       {
  -        ClassDescriptor cld = broker.getClassDescriptor(clazz);
  -        ObjectReferenceDescriptor ord = cld.getObjectReferenceDescriptorByName(reference);
  -        if(ord == null)
  +        // prepare test
  +        ojbChangeReferenceSetting(Person.class, "father", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +        ojbChangeReferenceSetting(Person.class, "grandfather", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +        ojbChangeReferenceSetting(Person.class, "childs", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +        ojbChangeReferenceSetting(Person.class, "grandchilds", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +
  +        String postfix = "_testCircularStore_2_" + System.currentTimeMillis();
  +        Person junior = createComplexFamily(postfix);
  +        broker.beginTransaction();
  +        broker.store(junior);
  +        broker.commitTransaction();
  +        Identity oidJunior = new Identity(junior, broker);
  +        Identity oidSenior = new Identity(junior.getFather(), broker);
  +
  +        Criteria crit = new Criteria();
  +        crit.addLike("name", "jeffChild_%" + postfix);
  +        Query q = QueryFactory.newQuery(Person.class, crit);
  +
  +        Person newJunior = (Person) broker.getObjectByIdentity(oidJunior);
  +        assertNotNull(newJunior);
  +        assertNotNull(newJunior.getFather());
  +        assertNotNull(newJunior.getChilds());
  +        assertEquals(2, newJunior.getChilds().size());
  +
  +        Person newSenior = (Person) broker.getObjectByIdentity(oidSenior);
  +        assertNotNull(newSenior);
  +        assertNotNull(newSenior.getChilds());
  +        assertEquals(1, newSenior.getChilds().size());
  +        assertNotNull(newSenior.getGrandchilds());
  +        assertEquals(2, newSenior.getGrandchilds().size());
  +
  +        Collection result = broker.getCollectionByQuery(q);
  +        assertEquals(2, result.size());
  +        for(Iterator iterator = result.iterator(); iterator.hasNext();)
           {
  -            ord = cld.getCollectionDescriptorByName(reference);
  +            Person p = (Person) iterator.next();
  +            assertNotNull(p.getFather());
  +            assertEquals("jeffJunior" + postfix, p.getFather().getName());
  +            assertNotNull(p.getGrandfather());
  +            assertEquals("jeffSenior" + postfix, p.getGrandfather().getName());
           }
  -        if(ord == null)
  +    }
  +
  +    public void testCircularStoreUpdate()
  +    {
  +        // prepare test
  +        ojbChangeReferenceSetting(Person.class, "father", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +        ojbChangeReferenceSetting(Person.class, "grandfather", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +        ojbChangeReferenceSetting(Person.class, "childs", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +        ojbChangeReferenceSetting(Person.class, "grandchilds", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +
  +        String postfix = "_testCircularStore_" + System.currentTimeMillis();
  +        Person junior = createComplexFamily(postfix);
  +        broker.beginTransaction();
  +        broker.store(junior);
  +        broker.commitTransaction();
  +        Identity oidJunior = new Identity(junior, broker);
  +        Identity oidSenior = new Identity(junior.getFather(), broker);
  +        broker.clearCache();
  +
  +        Criteria crit = new Criteria();
  +        crit.addLike("name", "jeffChild_%" + postfix);
  +        Query q = QueryFactory.newQuery(Person.class, crit);
  +
  +        Person newJunior = (Person) broker.getObjectByIdentity(oidJunior);
  +        assertNotNull(newJunior);
  +        assertNotNull(newJunior.getFather());
  +        assertNotNull(newJunior.getChilds());
  +        assertEquals(2, newJunior.getChilds().size());
  +
  +        Person newSenior = (Person) broker.getObjectByIdentity(oidSenior);
  +        assertNotNull(newSenior);
  +        assertNotNull(newSenior.getChilds());
  +        assertEquals(1, newSenior.getChilds().size());
  +        assertNotNull(newSenior.getGrandchilds());
  +        assertEquals(2, newSenior.getGrandchilds().size());
  +
  +        Collection result = broker.getCollectionByQuery(q);
  +        assertEquals(2, result.size());
  +        for(Iterator iterator = result.iterator(); iterator.hasNext();)
  +        {
  +            Person p = (Person) iterator.next();
  +            assertNotNull(p.getFather());
  +            assertEquals("jeffJunior" + postfix, p.getFather().getName());
  +            assertNotNull(p.getGrandfather());
  +            assertEquals("jeffSenior" + postfix, p.getGrandfather().getName());
  +        }
  +
  +        broker.beginTransaction();
  +        Person newChild = new Person("newGrandChild" + postfix, null, newSenior, null);
  +        newSenior.addGranschild(newChild);
  +        broker.store(newSenior);
  +        broker.commitTransaction();
  +        broker.clearCache();
  +
  +        newSenior = (Person) broker.getObjectByIdentity(oidSenior);
  +        assertNotNull(newSenior);
  +        assertNotNull(newSenior.getChilds());
  +        assertEquals(1, newSenior.getChilds().size());
  +        assertNotNull(newSenior.getGrandchilds());
  +        assertEquals(3, newSenior.getGrandchilds().size());
  +    }
  +
  +    /**
  +     * same as above, but without clearing the cache
  +     */
  +    public void testCircularStoreUpdate_2()
  +    {
  +        // prepare test
  +        ojbChangeReferenceSetting(Person.class, "father", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +        ojbChangeReferenceSetting(Person.class, "grandfather", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +        ojbChangeReferenceSetting(Person.class, "childs", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +        ojbChangeReferenceSetting(Person.class, "grandchilds", true, CASCADE_OBJECT, CASCADE_OBJECT, false);
  +
  +        String postfix = "_testCircularStore_2_" + System.currentTimeMillis();
  +        Person junior = createComplexFamily(postfix);
  +        broker.beginTransaction();
  +        broker.store(junior);
  +        broker.commitTransaction();
  +        Identity oidJunior = new Identity(junior, broker);
  +        Identity oidSenior = new Identity(junior.getFather(), broker);
  +
  +        Criteria crit = new Criteria();
  +        crit.addLike("name", "jeffChild_%" + postfix);
  +        Query q = QueryFactory.newQuery(Person.class, crit);
  +
  +        Person newJunior = (Person) broker.getObjectByIdentity(oidJunior);
  +        assertNotNull(newJunior);
  +        assertNotNull(newJunior.getFather());
  +        assertNotNull(newJunior.getChilds());
  +        assertEquals(2, newJunior.getChilds().size());
  +
  +        Person newSenior = (Person) broker.getObjectByIdentity(oidSenior);
  +        assertNotNull(newSenior);
  +        assertNotNull(newSenior.getChilds());
  +        assertEquals(1, newSenior.getChilds().size());
  +        assertNotNull(newSenior.getGrandchilds());
  +        assertEquals(2, newSenior.getGrandchilds().size());
  +
  +        Collection result = broker.getCollectionByQuery(q);
  +        assertEquals(2, result.size());
  +        for(Iterator iterator = result.iterator(); iterator.hasNext();)
           {
  -            throw new MetadataException("Reference with name '" + reference + "' does not exist in " + clazz.getName());
  +            Person p = (Person) iterator.next();
  +            assertNotNull(p.getFather());
  +            assertEquals("jeffJunior" + postfix, p.getFather().getName());
  +            assertNotNull(p.getGrandfather());
  +            assertEquals("jeffSenior" + postfix, p.getGrandfather().getName());
           }
  -        ord.setCascadeRetrieve(autoretrieve);
  -        ord.setCascadingStore(autoupdate);
  -        ord.setCascadingDelete(autodelete);
  -        ord.setLazy(useProxy);
  +
  +        broker.beginTransaction();
  +        Person newChild = new Person("newGrandChild" + postfix, null, newSenior, null);
  +        newSenior.addGranschild(newChild);
  +        broker.store(newSenior);
  +        broker.commitTransaction();
  +
  +        newSenior = (Person) broker.getObjectByIdentity(oidSenior);
  +        assertNotNull(newSenior);
  +        assertNotNull(newSenior.getChilds());
  +        assertEquals(1, newSenior.getChilds().size());
  +        assertNotNull(newSenior.getGrandchilds());
  +        assertEquals(3, newSenior.getGrandchilds().size());
       }
   
       /**
  
  
  
  1.1.2.1   +27 -54    db-ojb/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java
  
  Index: ObjectCacheTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- ObjectCacheTest.java	4 Jun 2004 16:03:37 -0000	1.1
  +++ ObjectCacheTest.java	23 Jan 2005 03:03:19 -0000	1.1.2.1
  @@ -3,23 +3,21 @@
   import java.io.Serializable;
   import java.util.Properties;
   
  -import junit.framework.TestCase;
   import org.apache.ojb.broker.Article;
   import org.apache.ojb.broker.Identity;
   import org.apache.ojb.broker.InterfaceArticle;
   import org.apache.ojb.broker.PBKey;
   import org.apache.ojb.broker.PersistenceBroker;
   import org.apache.ojb.broker.PersistenceBrokerFactory;
  -import org.apache.ojb.broker.TestHelper;
   import org.apache.ojb.broker.metadata.ConnectionRepository;
  +import org.apache.ojb.broker.metadata.JdbcConnectionDescriptor;
   import org.apache.ojb.broker.metadata.MetadataManager;
   import org.apache.ojb.broker.metadata.MetadataTest;
   import org.apache.ojb.broker.query.QueryByIdentity;
   import org.apache.ojb.broker.sequence.Repository;
   import org.apache.ojb.broker.util.ClassHelper;
   import org.apache.ojb.broker.util.GUID;
  -import org.apache.ojb.broker.util.configuration.impl.OjbConfiguration;
  -import org.apache.ojb.broker.util.configuration.impl.OjbConfigurator;
  +import org.apache.ojb.junit.OJBTestCase;
   
   /**
    * Do some basic tests using ObjectCache implementations.
  @@ -28,7 +26,7 @@
    * @author <a href="mailto:thma@apache.org">Thomas Mahler</a>
    * @version $Id$
    */
  -public class ObjectCacheTest extends TestCase
  +public class ObjectCacheTest extends OJBTestCase
   {
       static final String EXCLUDE_PACKAGE = "org.apache.ojb.broker.sequence";
       static final String EXCLUDE_PACKAGE_NOT_EXIST = "org.apache.ojb.broker.sequence.xyz";
  @@ -36,17 +34,13 @@
       Class[] objectCacheImpls = new Class[]{
           // ObjectCacheEmptyImpl.class,
           ObjectCacheDefaultImpl.class,
  -        ObjectCacheLocalDefaultImpl.class,
  +        ObjectCacheTwoLevelImpl.class,
           ObjectCachePerBrokerImpl.class,
           ObjectCacheJCSImpl.class,
           ObjectCacheJCSPerClassImpl.class,
           ObjectCachePerClassImpl.class
       };
   
  -    String[] cacheFilter = new String[]{
  -        CacheFilterClassImpl.class.getName(),
  -        CacheFilterPackageImpl.class.getName()
  -    };
       Class old_ObjectCache;
       String[] old_CacheFilter;
   
  @@ -64,22 +58,11 @@
       protected void setUp() throws Exception
       {
           super.setUp();
  -        old_CacheFilter = getConfig().getCacheFilters();
  -        old_ObjectCache = ObjectCacheFactory.getInstance().getClassToServe();
       }
   
       protected void tearDown() throws Exception
       {
           super.tearDown();
  -        getConfig().setCacheFilters(old_CacheFilter);
  -        ObjectCacheFactory.getInstance().setClassToServe(old_ObjectCache);
  -        MetadataManager.getInstance().getRepository().
  -                addAttribute(CacheFilterPackageImpl.EXCLUDE_PACKAGES, null);
  -    }
  -
  -    private OjbConfiguration getConfig()
  -    {
  -        return (OjbConfiguration) OjbConfigurator.getInstance().getConfigurationFor(null);
       }
   
       /**
  @@ -197,21 +180,25 @@
       }
   
       /**
  -     * This test check the CacheFilter feature and the two standard implementations
  -     * enable per class and per package out-filtering of objects.
  +     * This test check the 'cacheExcludes' property and try to exclude a whole package from
  +     * caching.
        * @throws Exception
        */
       public void testCacheFilterFunctions() throws Exception
       {
           PersistenceBrokerFactory.releaseAllInstances();
  -
  +        String old = null;
           try
           {
  -            getConfig().setCacheFilters(cacheFilter);
  -            MetadataManager.getInstance().getRepository().
  -                    addAttribute(CacheFilterPackageImpl.EXCLUDE_PACKAGES, EXCLUDE_PACKAGE);
  -            MetadataManager.getInstance().connectionRepository().getDescriptor(TestHelper.DEF_KEY).
  -                    addAttribute(CacheFilterPackageImpl.EXCLUDE_PACKAGES, EXCLUDE_PACKAGE_NOT_EXIST);
  +            MetadataManager mm = MetadataManager.getInstance();
  +            JdbcConnectionDescriptor jcd = mm.connectionRepository().getDescriptor(mm.getDefaultPBKey());
  +            if(jcd.getObjectCacheDescriptor().getObjectCache().equals(ObjectCacheEmptyImpl.class))
  +            {
  +                ojbSkipTestMessage("Doesn't work with " + ObjectCacheEmptyImpl.class + " as default cache.");
  +                return;
  +            }
  +            old = jcd.getAttribute(CacheDistributor.CACHE_EXCLUDES_STRING);
  +            jcd.addAttribute(CacheDistributor.CACHE_EXCLUDES_STRING, "org.apache.ojb.broker.sequence");
   
               PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
               try
  @@ -220,8 +207,6 @@
                   CacheObject obj = new CacheObject(null, "CacheObject persistent obj");
                   Identity oid = new Identity(obj, broker);
   
  -                CacheObject filterOutObject = new CacheFilterObject(null, "CacheFilterObject persistent obj");
  -                Identity filterOutOid = new Identity(filterOutObject, broker);
   
                   Repository.SMKey filterOutPackageObject = new Repository.SMKey();
                   filterOutPackageObject.setName("ObjectCacheTest: package filter");
  @@ -231,33 +216,31 @@
                   cache.clear();
                   result = cache.lookup(oid);
                   assertNull(result);
  -                result = cache.lookup(filterOutOid);
  -                assertNull(result);
                   result = cache.lookup(filterOutPackageOid);
                   assertNull(result);
   
                   // cache it
                   cache.cache(oid, obj);
                   cache.cache(filterOutPackageOid, filterOutPackageObject);
  -                cache.cache(filterOutOid, filterOutObject);
   
                   // lookup things
                   result = cache.lookup(oid);
                   assertNotNull(result);
                   assertEquals(obj, result);
  -                result = cache.lookup(filterOutOid);
  -                assertNull(result);
                   result = cache.lookup(filterOutPackageOid);
                   assertNull(result);
               }
               finally
               {
  +                jcd.addAttribute(CacheDistributor.CACHE_EXCLUDES_STRING, old);
                   if (broker != null) broker.close();
               }
           }
           finally
           {
               PersistenceBrokerFactory.releaseAllInstances();
  +            PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
  +            broker.close();
           }
       }
   
  @@ -332,6 +315,13 @@
        */
       public void testPerClassCache() throws Exception
       {
  +        PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
  +        JdbcConnectionDescriptor jcd = broker.serviceConnectionManager().getConnectionDescriptor();
  +        if(jcd.getObjectCacheDescriptor().getObjectCache().equals(ObjectCacheEmptyImpl.class))
  +        {
  +            ojbSkipTestMessage("Doesn't work with " + ObjectCacheEmptyImpl.class + " as default cache.");
  +            return;
  +        }
           String name = "testPerClassCache_" + System.currentTimeMillis();
   
           TestObjectEmptyCache obj = new TestObjectEmptyCache();
  @@ -339,7 +329,6 @@
           CacheObject dummy = new CacheObject();
           dummy.setName(name);
   
  -        PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
           try
           {
               broker.beginTransaction();
  @@ -466,22 +455,6 @@
           public void setName(String name)
           {
               this.name = name;
  -        }
  -    }
  -
  -    /**
  -     * in class-descriptor CacheFilter attribute 'cacheable=false'
  -     * is declared
  -     */
  -    public static class CacheFilterObject extends CacheObject
  -    {
  -        public CacheFilterObject(Integer objId, String name)
  -        {
  -            super(objId, name);
  -        }
  -
  -        public CacheFilterObject()
  -        {
           }
       }
   
  
  
  
  No                   revision
  No                   revision
  1.1.4.1   +3 -3      db-ojb/src/test/org/apache/ojb/broker/cloneable/CloneableGroup.java
  
  Index: CloneableGroup.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/cloneable/CloneableGroup.java,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- CloneableGroup.java	28 Oct 2003 09:15:20 -0000	1.1
  +++ CloneableGroup.java	23 Jan 2005 03:03:19 -0000	1.1.4.1
  @@ -6,7 +6,7 @@
   package org.apache.ojb.broker.cloneable;
   
   /**
  - * implements Cloneable so that it can be used in TwoLevelCache
  + * implements Cloneable so that it can be used in a two-level cache
    *
    * @author <a href="mailto:om@ppi.de">Oliver Matz</a>
    * @version $Id$
  @@ -17,7 +17,7 @@
     private String groupName;
   
     /**
  -   * called by reflection in {@link org.apache.ojb.broker.cache.TwoLevelCache}.
  +   * called by reflection in {@link org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl}.
      * @return
      * @throws CloneNotSupportedException
      */
  
  
  
  No                   revision
  No                   revision
  1.1.2.2   +1 -1      db-ojb/src/test/org/apache/ojb/broker/locking/LockTestCommitedReads.java
  
  Index: LockTestCommitedReads.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/locking/LockTestCommitedReads.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- LockTestCommitedReads.java	4 Dec 2004 13:51:32 -0000	1.1.2.1
  +++ LockTestCommitedReads.java	23 Jan 2005 03:03:19 -0000	1.1.2.2
  @@ -205,7 +205,7 @@
       public void testReadWithExistingWriter()
       {
           assertTrue(lockManager.writeLock(tx1, obj, testIsoLevel));
  -        assertTrue(!lockManager.readLock(tx2, obj, testIsoLevel));
  +        assertFalse(lockManager.readLock(tx2, obj, testIsoLevel));
       }
   
       /**
  
  
  
  No                   revision
  No                   revision
  1.2.4.1   +7 -8      db-ojb/src/test/org/apache/ojb/broker/sqlcount/EmptyCacheCountTest.java
  
  Index: EmptyCacheCountTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/sqlcount/EmptyCacheCountTest.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- EmptyCacheCountTest.java	10 Nov 2003 12:57:21 -0000	1.2
  +++ EmptyCacheCountTest.java	23 Jan 2005 03:03:19 -0000	1.2.4.1
  @@ -19,8 +19,7 @@
    * @author <a href="mailto:om@ppi.de">Oliver Matz</a>
    * @version $Id$
    */
  -public class EmptyCacheCountTest
  -        extends AbstractCountTest
  +public class EmptyCacheCountTest extends AbstractCountTest
   {
     protected PersistenceBroker myPB;
   
  @@ -38,11 +37,11 @@
      */
     protected void setUp() throws Exception
     {
  -    ObjectCacheFactory.getInstance().setClassToServe(ObjectCacheEmptyImpl.class);
  +    //ObjectCacheFactory.getInstance().setClassToServe(ObjectCacheEmptyImpl.class);
       super.setUp();
       myPB = PersistenceBrokerFactory.defaultPersistenceBroker();
  -    old_CacheFilter = getConfig().getCacheFilters();
  -    old_ObjectCache = ObjectCacheFactory.getInstance().getClassToServe();
  +    //old_CacheFilter = getConfig().getCacheFilters();
  +    //old_ObjectCache = ObjectCacheFactory.getInstance().getClassToServe();
     }
   
     /**
  @@ -51,8 +50,8 @@
      */
     protected void tearDown() throws Exception
     {
  -    getConfig().setCacheFilters(old_CacheFilter);
  -    ObjectCacheFactory.getInstance().setClassToServe(old_ObjectCache);
  +    //getConfig().setCacheFilters(old_CacheFilter);
  +    //ObjectCacheFactory.getInstance().setClassToServe(old_ObjectCache);
       super.tearDown();
     }
   
  
  
  
  1.1.4.1   +9 -10     db-ojb/src/test/org/apache/ojb/broker/sqlcount/TwoLevelSimpleTest.java
  
  Index: TwoLevelSimpleTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/sqlcount/TwoLevelSimpleTest.java,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- TwoLevelSimpleTest.java	28 Oct 2003 09:15:20 -0000	1.1
  +++ TwoLevelSimpleTest.java	23 Jan 2005 03:03:19 -0000	1.1.4.1
  @@ -8,7 +8,7 @@
   import org.apache.ojb.broker.util.configuration.impl.OjbConfiguration;
   import org.apache.ojb.broker.util.configuration.impl.OjbConfigurator;
   import org.apache.ojb.broker.cache.ObjectCacheFactory;
  -import org.apache.ojb.broker.cache.TwoLevelCache;
  +import org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl;
   import org.apache.ojb.broker.PersistenceBrokerFactory;
   import org.apache.ojb.broker.Identity;
   import org.apache.ojb.broker.PersistenceBroker;
  @@ -18,8 +18,7 @@
    * @author <a href="mailto:om@ppi.de">Oliver Matz</a>
    * @version $Id$
    */
  -public class TwoLevelSimpleTest
  -        extends AbstractCountTest
  +public class TwoLevelSimpleTest extends AbstractCountTest
   {
     private Class old_ObjectCache;
     private String[] old_CacheFilter;
  @@ -29,16 +28,16 @@
         return (OjbConfiguration) OjbConfigurator.getInstance().getConfigurationFor(null);
     }
     /**
  -   * switch cache to {@link org.apache.ojb.broker.cache.TwoLevelCache}.
  +   * switch cache to {@link org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl}.
      * @throws Exception
      */
     protected void setUp() throws Exception
     {
  -    ObjectCacheFactory.getInstance().setClassToServe(TwoLevelCache.class);
  +    //ObjectCacheFactory.getInstance().setClassToServe(ObjectCacheTwoLevelImpl.class);
       //ObjectCacheFactory.getInstance().setClassToServe(org.apache.ojb.broker.cache.ObjectCachePerBrokerImpl.class);
       super.setUp();
  -    old_CacheFilter = getConfig().getCacheFilters();
  -    old_ObjectCache = ObjectCacheFactory.getInstance().getClassToServe();
  +    //old_CacheFilter = getConfig().getCacheFilters();
  +    //old_ObjectCache = ObjectCacheFactory.getInstance().getClassToServe();
     }
   
     /**
  @@ -47,8 +46,8 @@
      */
     protected void tearDown() throws Exception
     {
  -    getConfig().setCacheFilters(old_CacheFilter);
  -    ObjectCacheFactory.getInstance().setClassToServe(old_ObjectCache);
  +    //getConfig().setCacheFilters(old_CacheFilter);
  +    //ObjectCacheFactory.getInstance().setClassToServe(old_ObjectCache);
       super.tearDown();
     }
   
  
  
  
  No                   revision
  No                   revision
  1.5.2.3   +6 -1      db-ojb/src/test/org/apache/ojb/broker/ArticleProxy.java
  
  Index: ArticleProxy.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/ArticleProxy.java,v
  retrieving revision 1.5.2.2
  retrieving revision 1.5.2.3
  diff -u -r1.5.2.2 -r1.5.2.3
  --- ArticleProxy.java	4 Dec 2004 14:36:21 -0000	1.5.2.2
  +++ ArticleProxy.java	23 Jan 2005 03:03:19 -0000	1.5.2.3
  @@ -62,7 +62,7 @@
       /**
        * getArticleName method comment.
        */
  -    public java.lang.String getArticleName()
  +    public String getArticleName()
       {
           return realSubject().getArticleName();
       }
  @@ -81,6 +81,11 @@
       public double getStockValue()
       {
           return realSubject().getStockValue();
  +    }
  +
  +    public void setStock(int stock)
  +    {
  +        realSubject().setStock(stock);
       }
   
       /**
  
  
  
  1.19.2.2  +2 -1      db-ojb/src/test/org/apache/ojb/broker/BrokerExamples.java
  
  Index: BrokerExamples.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/BrokerExamples.java,v
  retrieving revision 1.19.2.1
  retrieving revision 1.19.2.2
  diff -u -r1.19.2.1 -r1.19.2.2
  --- BrokerExamples.java	4 Dec 2004 14:01:07 -0000	1.19.2.1
  +++ BrokerExamples.java	23 Jan 2005 03:03:19 -0000	1.19.2.2
  @@ -119,7 +119,8 @@
           Article cached = (Article) broker.serviceObjectCache().lookup(oid);
           assertNull("After flushing Object should be not in cache", cached);
           Article article = (Article) broker.getObjectByQuery(new QueryByIdentity(oid));
  -        // only works if a cache is used, else this test fails
  +
  +        // !!! only works if a cache is used, else this test fails
           cached = (Article) broker.serviceObjectCache().lookup(oid);
           assertNotNull("now object should be found in cache", cached);
           assertEquals("should be the same Identity",
  
  
  
  1.11.2.1  +31 -19    db-ojb/src/test/org/apache/ojb/broker/CollectionTest.java
  
  Index: CollectionTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/CollectionTest.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- CollectionTest.java	25 Jun 2004 15:58:39 -0000	1.11
  +++ CollectionTest.java	23 Jan 2005 03:03:19 -0000	1.11.2.1
  @@ -119,7 +119,7 @@
           broker.store(gat);
           broker.commitTransaction();
   
  -        Identity oid = new Identity(gat, broker);
  +        Identity oid = broker.serviceIdentity().buildIdentity(gat);
           broker.clearCache();
           Gatherer new_gat = (Gatherer) broker.getObjectByIdentity(oid);
           assertNotNull(new_gat);
  @@ -183,7 +183,7 @@
           assertEquals("CollectibleB objects", 4, gatherer.getCollectiblesB().size());
           assertEquals(gatherer.getGatId(), ((CollectibleBIF) gatherer.getCollectiblesB().get(0)).getGathererId());
   
  -        Identity oid = new Identity(gatherer, broker);
  +        Identity oid = broker.serviceIdentity().buildIdentity(gatherer);
           broker.clearCache();
           Gatherer new_gatherer = (Gatherer) broker.getObjectByIdentity(oid);
   
  @@ -285,7 +285,7 @@
           assertEquals("CollectibleB objects", 4, gatherer.getCollectiblesB().size());
           assertEquals(gatherer.getGatId(), ((CollectibleBIF) gatherer.getCollectiblesB().get(0)).getGathererId());
   
  -        Identity oid = new Identity(gatherer, broker);
  +        Identity oid = broker.serviceIdentity().buildIdentity(gatherer);
           broker.clearCache();
           Gatherer new_gatherer = (Gatherer) broker.getObjectByIdentity(oid);
   
  @@ -388,7 +388,7 @@
           assertEquals(gatherer.getGatId(), ((CollectibleC2) gatherer.getCollectiblesC2().get(0)).getGathererId());
   
           broker.clearCache();
  -        Identity oid = new Identity(gatherer, broker);
  +        Identity oid = broker.serviceIdentity().buildIdentity(gatherer);
           gatherer = (Gatherer) broker.getObjectByIdentity(oid);
           assertNotNull(gatherer);
           // auto-retierve is set false
  @@ -447,7 +447,7 @@
           assertEquals("CollectibleDD objects", 3, gatherer.getCollectiblesDD().size());
           assertEquals(gatherer.getGatId(), ((CollectibleDDIF) gatherer.getCollectiblesDD().get(0)).getGathererId());
   
  -        Identity oid = new Identity(gatherer, broker);
  +        Identity oid = broker.serviceIdentity().buildIdentity(gatherer);
           broker.clearCache();
           Gatherer new_gatherer = (Gatherer) broker.getObjectByIdentity(oid);
   
  @@ -550,7 +550,7 @@
           broker.store(gatherer);
           broker.commitTransaction();
   
  -        Identity oid = new Identity(gatherer, broker);
  +        Identity oid = broker.serviceIdentity().buildIdentity(gatherer);
           broker.clearCache();
           Gatherer new_gatherer = (Gatherer) broker.getObjectByIdentity(oid);
   
  @@ -604,7 +604,7 @@
           broker.store(gatherer);
           broker.commitTransaction();
   
  -        Identity oid = new Identity(gatherer, broker);
  +        Identity oid = broker.serviceIdentity().buildIdentity(gatherer);
           broker.clearCache();
           Gatherer new_gatherer = (Gatherer) broker.getObjectByIdentity(oid);
   
  @@ -671,7 +671,7 @@
           assertTrue(gatherer.getCollectiblesC().size() > 0);
           assertEquals(gatherer.getGatId(), ((CollectibleCIF) gatherer.getCollectiblesC().get(0)).getGathererId());
   
  -        Identity oid = new Identity(gatherer, broker);
  +        Identity oid = broker.serviceIdentity().buildIdentity(gatherer);
           broker.clearCache();
           Gatherer new_gatherer = (Gatherer) broker.getObjectByIdentity(oid);
   
  @@ -716,7 +716,7 @@
   
           broker.clearCache();
           BookShelf loadedCopy = (BookShelf) broker.getObjectByIdentity(
  -                new Identity(BookShelf.class, BookShelf.class, new Object[]{bookShelf.getPK()}));
  +                broker.serviceIdentity().buildIdentity(BookShelf.class, bookShelf.getPK()));
           assertNotNull(loadedCopy);
           assertNotNull(loadedCopy.getItems());
           assertEquals(2, loadedCopy.getItems().size());
  @@ -728,9 +728,10 @@
           Collection books = broker.getCollectionByQuery(q);
           assertNotNull(books);
           assertEquals(1, books.size());
  -        bookShelf = (BookShelf) books.iterator().next();
  -        assertNotNull(bookShelf.getItems());
  -        assertEquals("wrong number of items found", 2, bookShelf.getItems().size());
  +        // we are using collection proxies, so we have to use the interface
  +        BookShelfIF bookShelfIF = (BookShelfIF) books.iterator().next();
  +        assertNotNull(bookShelfIF.getItems());
  +        assertEquals("wrong number of items found", 2, bookShelfIF.getItems().size());
       }
   
       public void testOneBookShelfQueryByIterator() throws Exception
  @@ -753,7 +754,7 @@
   
           broker.clearCache();
           BookShelf loadedCopy = (BookShelf) broker.getObjectByIdentity(
  -                new Identity(BookShelf.class, BookShelf.class, new Object[]{bookShelf.getPK()}));
  +                broker.serviceIdentity().buildIdentity(BookShelf.class, bookShelf.getPK()));
           assertNotNull(loadedCopy);
           assertNotNull(loadedCopy.getItems());
           assertEquals(2, loadedCopy.getItems().size());
  @@ -1272,8 +1273,19 @@
           }
       }
   
  +    public static interface BookShelfIF
  +    {
  +        public Integer getPK();
  +        public void addItem(BookShelfItem event);
  +        public List getItems();
  +        public Integer getPk();
  +        public void setPk(Integer pk);
  +        public String getName();
  +        public void setName(String name);
  +    }
  +
   
  -    public static class BookShelf
  +    public static class BookShelf implements BookShelfIF
       {
           private Integer pk;
           private String name;
  @@ -1330,13 +1342,13 @@
       public static abstract class BookShelfItem
       {
           private Integer pk;
  -        private BookShelf shelf;
  +        private BookShelfIF shelf;
   
           public BookShelfItem()
           {
           }
   
  -        public BookShelfItem(BookShelf shelf)
  +        public BookShelfItem(BookShelfIF shelf)
           {
               this.shelf = shelf;
           }
  @@ -1351,7 +1363,7 @@
               this.pk = pk;
           }
   
  -        public BookShelf getShelf()
  +        public BookShelfIF getShelf()
           {
               return shelf;
           }
  @@ -1380,7 +1392,7 @@
           {
           }
   
  -        public Book(BookShelf shelf)
  +        public Book(BookShelfIF shelf)
           {
               super(shelf);
           }
  
  
  
  1.2.4.2   +2 -0      db-ojb/src/test/org/apache/ojb/broker/InterfaceArticle.java
  
  Index: InterfaceArticle.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/InterfaceArticle.java,v
  retrieving revision 1.2.4.1
  retrieving revision 1.2.4.2
  diff -u -r1.2.4.1 -r1.2.4.2
  --- InterfaceArticle.java	4 Dec 2004 14:01:07 -0000	1.2.4.1
  +++ InterfaceArticle.java	23 Jan 2005 03:03:19 -0000	1.2.4.2
  @@ -22,6 +22,8 @@
       public void setArticleId(Integer newArticleId);
   
       public void setArticleName(String newArticleName);
  +    
  +    public void setStock(int stock);
   
       public int getStock();
   
  
  
  
  No                   revision
  No                   revision
  1.5.2.5   +14 -1     db-ojb/src/test/org/apache/ojb/junit/OJBTestCase.java
  
  Index: OJBTestCase.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/junit/OJBTestCase.java,v
  retrieving revision 1.5.2.4
  retrieving revision 1.5.2.5
  diff -u -r1.5.2.4 -r1.5.2.5
  --- OJBTestCase.java	12 Dec 2004 01:35:12 -0000	1.5.2.4
  +++ OJBTestCase.java	23 Jan 2005 03:03:19 -0000	1.5.2.5
  @@ -78,6 +78,19 @@
       }
   
       /**
  +     * This method could be used to print a message before skip 'problematic' test cases.
  +     */
  +    public void ojbSkipTestMessage(String message)
  +    {
  +        if(message == null)
  +        {
  +           message = "No description, please see test case";
  +        }
  +        String className = this.getClass().getName();
  +        System.out.println("# [Skip test in " + className + "] " + message + " #");
  +    }
  +
  +    /**
        * This method could be used to skip 'problematic' test cases or known issues before
        * a release was made. To enable the skipped tests set a system property 'skip.issues'
        * to <tt>false</tt>.
  
  
  
  No                   revision
  No                   revision
  1.3.2.1   +9 -6      db-ojb/src/test/org/apache/ojb/odmg/M2NTest.java
  
  Index: M2NTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/M2NTest.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- M2NTest.java	15 Jun 2004 11:44:36 -0000	1.3
  +++ M2NTest.java	23 Jan 2005 03:03:20 -0000	1.3.2.1
  @@ -92,11 +92,14 @@
           doTestStore_2();
       }
   
  -    public void testStore_2WithProxy() throws Exception
  -    {
  -        prepareAutoUpdateDeleteSettings(true);
  -        doTestStore_2();
  -    }
  +// arminw: this test will not work, because we use a user defined ManageableCollection
  +// and the collection proxy is not compatible. Maybe this test will work in future versions
  +// when it's possible set a CollectionProxy impl in metadate.    
  +//    public void testStore_2WithProxy() throws Exception
  +//    {
  +//        prepareAutoUpdateDeleteSettings(true);
  +//        doTestStore_2();
  +//    }
   
       public void doTestStore_2() throws Exception
       {
  
  
  
  1.24.2.3  +14 -5     db-ojb/src/test/org/apache/ojb/odmg/ODMGRollbackTest.java
  
  Index: ODMGRollbackTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/ODMGRollbackTest.java,v
  retrieving revision 1.24.2.2
  retrieving revision 1.24.2.3
  diff -u -r1.24.2.2 -r1.24.2.3
  --- ODMGRollbackTest.java	4 Dec 2004 14:01:08 -0000	1.24.2.2
  +++ ODMGRollbackTest.java	23 Jan 2005 03:03:20 -0000	1.24.2.3
  @@ -77,10 +77,13 @@
           Criteria crit = new Criteria();
           crit.addEqualTo("name", obj.getName());
           QueryByCriteria query = QueryFactory.newQuery(ODMGZoo.class, crit);
  -        // we flushed all objects, thus we should found object in DB/cache
  +        // we flushed all objects, thus we should find object in DB/cache
           Iterator it = broker.getIteratorByQuery(query);
           assertTrue(it.hasNext());
  -        assertSame(obj, it.next());
  +        ODMGZoo other = (ODMGZoo) it.next();
  +        assertNotNull(other);
  +        assertEquals(obj.getZooId(), other.getZooId());
  +        assertEquals(obj.getName(), other.getName());
           assertFalse(it.hasNext());
           // now we abort tx, so all flushed objects shouldn't be found
           // in further queries
  @@ -117,7 +120,10 @@
           // we flushed all objects, thus we should found object in DB/cache
           Iterator it = broker.getIteratorByQuery(query);
           assertTrue(it.hasNext());
  -        assertSame(obj, it.next());
  +        ODMGZoo other = (ODMGZoo) it.next();
  +        assertNotNull(other);
  +        assertEquals(obj.getZooId(), other.getZooId());
  +        assertEquals(obj.getName(), other.getName());
           assertFalse(it.hasNext());
   
           /*** Charles : Start ***/
  @@ -133,8 +139,11 @@
   
           //Redo the query - we should find the object again
           it = ((Collection) q.execute()).iterator();
  -        assertTrue("Should find object",it.hasNext());
  -        assertSame(obj, it.next());
  +        assertTrue(it.hasNext());
  +        other = (ODMGZoo) it.next();
  +        assertNotNull(other);
  +        assertEquals(obj.getZooId(), other.getZooId());
  +        assertEquals(obj.getName(), other.getName());
           assertFalse(it.hasNext());
           /*** Charles : End ***/
   
  
  
  
  1.10.2.3  +4 -4      db-ojb/src/test/org/apache/ojb/odmg/OneToManyTest.java
  
  Index: OneToManyTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/OneToManyTest.java,v
  retrieving revision 1.10.2.2
  retrieving revision 1.10.2.3
  diff -u -r1.10.2.2 -r1.10.2.3
  --- OneToManyTest.java	4 Dec 2004 14:36:21 -0000	1.10.2.2
  +++ OneToManyTest.java	23 Jan 2005 03:03:20 -0000	1.10.2.3
  @@ -65,8 +65,7 @@
        *
        * @throws Exception
        */
  -    public void testCreate()
  -            throws Exception
  +    public void testCreate() throws Exception
       {
           String name = "testCreate_" + System.currentTimeMillis();
           /**
  @@ -102,15 +101,16 @@
   
       /**
        * tests creation of new object that has a one to many relationship.
  -     * thma: thhis test will not work, because ODMG is no able to track
  +     * thma: this test will not work, because ODMG is no able to track
        * modifictations to normal collections.
        * Only Odmg Collections like DList will be treated properly.
        *
        * @throws Exception
        */
  -    public void brokenTestUpdateWithProxy()
  +    public void testestUpdateWithProxy()
               throws Exception
       {
  +        if(ojbSkipKnownIssueProblem()) return;
           String name = "brokenTestUpdateWithProxy_" + System.currentTimeMillis();
           Transaction tx = odmg.newTransaction();
           tx.begin();
  
  
  
  No                   revision
  No                   revision
  1.20.2.2  +9 -9      db-ojb/src/test/org/apache/ojb/otm/OtmExamples.java
  
  Index: OtmExamples.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/otm/OtmExamples.java,v
  retrieving revision 1.20.2.1
  retrieving revision 1.20.2.2
  diff -u -r1.20.2.1 -r1.20.2.2
  --- OtmExamples.java	4 Dec 2004 14:01:08 -0000	1.20.2.1
  +++ OtmExamples.java	23 Jan 2005 03:03:20 -0000	1.20.2.2
  @@ -669,27 +669,27 @@
               tx = _kit.getTransaction(_conn);
               tx.begin();
               pg = (ProductGroup) _conn.getObjectByIdentity(pgOid);
  -            article2 = (Article) pg.getAllArticles().get(0);
  -            article = (Article) pg.getAllArticles().get(1);
  -            if (!_conn.getIdentity(article2).equals(aOid2))
  +            InterfaceArticle articleNew1 = (InterfaceArticle) pg.getAllArticles().get(0);
  +            InterfaceArticle articleNew2 = (InterfaceArticle) pg.getAllArticles().get(1);
  +            if (!_conn.getIdentity(articleNew2).equals(aOid2))
               {
  -                article = (Article) pg.getAllArticles().get(0);
  -                article2 = (Article) pg.getAllArticles().get(1);
  +                articleNew2 = (InterfaceArticle) pg.getAllArticles().get(0);
  +                articleNew1 = (InterfaceArticle) pg.getAllArticles().get(1);
                   if (!_conn.getIdentity(article2).equals(aOid2))
                   {
                       fail("Missing the second article");
                   }
               }
  -            article.setStock(433);
  -            article2.setStock(434);
  +            articleNew1.setStock(433);
  +            articleNew2.setStock(434);
               pg.setName("2");
               tx.commit();
   
               tx = _kit.getTransaction(_conn);
               tx.begin();
               _conn.invalidateAll();
  -            article = (Article) _conn.getObjectByIdentity(aOid);
  -            article2 = (Article) _conn.getObjectByIdentity(aOid2);
  +            articleNew1 = (InterfaceArticle) _conn.getObjectByIdentity(aOid);
  +            articleNew2 = (InterfaceArticle) _conn.getObjectByIdentity(aOid2);
               assertEquals("should be equal", "2", article.getProductGroup().getName());
               assertEquals("should be equal", 433, article.getStock());
               assertEquals("should be equal", 434, article2.getStock());
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +9 -1      db-ojb/src/test/org/apache/ojb/OJB-logging.properties
  
  Index: OJB-logging.properties
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/OJB-logging.properties,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- OJB-logging.properties	1 Jun 2004 21:42:21 -0000	1.1
  +++ OJB-logging.properties	23 Jan 2005 03:03:20 -0000	1.1.2.1
  @@ -72,6 +72,14 @@
   org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.LogLevel=WARN
   # Logger for IndirectionHandler class
   org.apache.ojb.broker.core.proxy.IndirectionHandler.LogLevel=WARN
  +# Logger for MaterializationCache
  +org.apache.ojb.broker.cache.MaterializationCache.LogLevel=WARN
  +# Logger for CacheDistributor
  +org.apache.ojb.broker.cache.CacheDistributor.LogLevel=WARN
  +# Logger for ObjectCacheDefaultImpl
  +org.apache.ojb.broker.cache.ObjectCacheDefaultImpl.LogLevel=WARN
  +# Logger for ObjectCacheTwoLevelImpl
  +org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl.LogLevel=WARN
   #
   # Special Logger categories used in test suite and tutorials
   #
  
  
  
  1.56.2.1  +1 -1      db-ojb/src/test/org/apache/ojb/repository.dtd
  
  Index: repository.dtd
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/repository.dtd,v
  retrieving revision 1.56
  retrieving revision 1.56.2.1
  diff -u -r1.56 -r1.56.2.1
  --- repository.dtd	5 Apr 2004 13:58:59 -0000	1.56
  +++ repository.dtd	23 Jan 2005 03:03:20 -0000	1.56.2.1
  @@ -342,7 +342,7 @@
   
     -->
   <!ELEMENT class-descriptor
  -	((documentation?, extent-class+, attribute*) |
  +	((documentation?, object-cache?, extent-class+, attribute*) |
   	(documentation?, object-cache?, extent-class*, field-descriptor+,
   	 reference-descriptor*, collection-descriptor*,
        index-descriptor*, attribute*,
  
  
  
  1.22.2.5  +12 -3     db-ojb/src/test/org/apache/ojb/repository_database.xml
  
  Index: repository_database.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/repository_database.xml,v
  retrieving revision 1.22.2.4
  retrieving revision 1.22.2.5
  diff -u -r1.22.2.4 -r1.22.2.5
  --- repository_database.xml	4 Oct 2004 15:00:13 -0000	1.22.2.4
  +++ repository_database.xml	23 Jan 2005 03:03:20 -0000	1.22.2.5
  @@ -47,9 +47,11 @@
           ignoreAutoCommitExceptions="false"
        >
   
  -        <object-cache class="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl">
  +        <object-cache class="org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl">
  +            <attribute attribute-name="cacheExcludes" attribute-value=""/>
  +            <attribute attribute-name="applicationCache" attribute-value="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl"/>
               <attribute attribute-name="timeout" attribute-value="900"/>
  -            <attribute attribute-name="autoSync" attribute-value="true"/>
  +            <attribute attribute-name="autoSync" attribute-value="false"/>
               <attribute attribute-name="cachingKeyType" attribute-value="0"/>
           </object-cache>
   
  @@ -83,6 +85,13 @@
           useAutoCommit="0"
           ignoreAutoCommitExceptions="false"
      >
  +        <object-cache class="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl">
  +            <attribute attribute-name="cacheExcludes" attribute-value=""/>
  +            <attribute attribute-name="timeout" attribute-value="900"/>
  +            <attribute attribute-name="autoSync" attribute-value="true"/>
  +            <attribute attribute-name="cachingKeyType" attribute-value="0"/>
  +        </object-cache>
  +
           <sequence-manager className="org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl">
               <attribute attribute-name="autoNaming" attribute-value="true"/>
           </sequence-manager>
  
  
  
  1.1.2.1   +1 -30     db-ojb/src/test/org/apache/ojb/repository_junit_cache.xml
  
  Index: repository_junit_cache.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/repository_junit_cache.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- repository_junit_cache.xml	4 Jun 2004 16:02:44 -0000	1.1
  +++ repository_junit_cache.xml	23 Jan 2005 03:03:20 -0000	1.1.2.1
  @@ -25,10 +25,6 @@
       class="org.apache.ojb.broker.cache.LocalCacheTest$Person"
       table="LOCAL_CACHE_TEST"
   >
  -    <!-- declare a per class cache -->
  -    <object-cache class="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl">
  -        <attribute attribute-name="timeout" attribute-value="10"/>
  -    </object-cache>
   
       <field-descriptor
           name="id"
  @@ -124,31 +120,6 @@
            jdbc-type="VARCHAR"
           />
       </class-descriptor>
  -
  -    <class-descriptor
  -        class="org.apache.ojb.broker.cache.ObjectCacheTest$CacheFilterObject"
  -        table="CACHE_TEST">
  -
  -        <field-descriptor
  -         name="objId"
  -         column="OBJ_ID"
  -         jdbc-type="INTEGER"
  -         primarykey="true"
  -         autoincrement="true"
  -        />
  -        <field-descriptor
  -         name="name"
  -         column="NAME"
  -         jdbc-type="VARCHAR"
  -        />
  -
  -        <!-- when cache filtering is enabled this class was not cached -->
  -        <attribute
  -            attribute-name="cacheable"
  -            attribute-value="false"/>
  -
  -    </class-descriptor>
  -
   
       <class-descriptor
           class="org.apache.ojb.broker.cache.ObjectCacheTest$TestObjectEmptyCache"
  
  
  
  1.2.2.1   +1 -1      db-ojb/src/test/org/apache/ojb/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/web.xml,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- web.xml	5 Apr 2004 00:52:54 -0000	1.2
  +++ web.xml	23 Jan 2005 03:03:20 -0000	1.2.2.1
  @@ -28,7 +28,7 @@
   
     <servlet>
       <servlet-name>lockserver</servlet-name>
  -    <servlet-class>org.apache.ojb.odmg.locking.LockServerServlet</servlet-class>
  +    <servlet-class>org.apache.ojb.broker.locking.LockServerServlet</servlet-class>
       <init-param>
         <param-name>debug</param-name>
         <param-value>0</param-value>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org