db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r513563 - in /db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb: broker/AbstractArticle.java broker/cache/ObjectCacheTest.java odmg/DListTest.java odmg/ObjectImageTest.java
Date Fri, 02 Mar 2007 00:49:41 GMT
Author: arminw
Date: Thu Mar  1 16:49:40 2007
New Revision: 513563

URL: http://svn.apache.org/viewvc?view=rev&rev=513563
Log:
update tests

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/AbstractArticle.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/DListTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/ObjectImageTest.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/AbstractArticle.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/AbstractArticle.java?view=diff&rev=513563&r1=513562&r2=513563
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/AbstractArticle.java (original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/AbstractArticle.java Thu
Mar  1 16:49:40 2007
@@ -1,5 +1,7 @@
 package org.apache.ojb.broker;
 
+import org.apache.commons.lang.ClassUtils;
+
 /**
  * @ojb.class generate-table-info="false"
  */
@@ -12,7 +14,7 @@
         String groupId = "" + productGroupId;
         String groupName = productGroup != null ? productGroup.getName() : null;
 
-        return "----\n" +
+        return "----" + ClassUtils.getShortClassName(getClass()) + "\n" +
                 "Article No:   " + articleId + "\n" +
                 "Description:  " + articleName + "\n" +
                 "ProductGroupId: " + groupId + "\n" +

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java?view=diff&rev=513563&r1=513562&r2=513563
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/cache/ObjectCacheTest.java
Thu Mar  1 16:49:40 2007
@@ -21,8 +21,6 @@
 /**
  * Do some basic tests using ObjectCache implementations.
  *
- * @author <a href="mailto:armin@codeAuLait.de">Armin Waibel</a>
- * @author <a href="mailto:thma@apache.org">Thomas Mahler</a>
  * @version $Id$
  */
 public class ObjectCacheTest extends OJBTestCase
@@ -100,7 +98,7 @@
             bool = bool && cache.lookup(oid_3) != null;
             assertFalse("We should not found all cached objects", bool);
             // idle time is 2 sec
-            Thread.sleep(4100);
+            Thread.sleep(4500);
             assertNull(cache.lookup(oid_1));
             assertNull(cache.lookup(oid_2));
             assertNull(cache.lookup(oid_3));

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/DListTest.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/DListTest.java?view=diff&rev=513563&r1=513562&r2=513563
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/DListTest.java (original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/DListTest.java Thu Mar  1
16:49:40 2007
@@ -109,6 +109,7 @@
         tx.begin();
         tx.getBroker().clearCache();
         lookedUp = (DList) database.lookup(name);
+        assertNotNull("binded DList not found", lookedUp);
         iter = lookedUp.iterator();
         iter1 = list.iterator();
         assertEquals("Wrong number of DListEntry found", 8, list.size());
@@ -121,7 +122,6 @@
             assertEquals(a.getId(), b.getId());
         }
         tx.commit();
-        assertNotNull("binded DList not found", lookedUp);
     }
 
     public void testRemoveAdd() throws Exception
@@ -450,6 +450,7 @@
         c = createObject(name);
         d = createObject(name);
         e = createObject(name);
+        tx.checkpoint();
         bag1.add(a);
         bag1.add(b);
         bag1.add(c);

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/ObjectImageTest.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/ObjectImageTest.java?view=diff&rev=513563&r1=513562&r2=513563
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/ObjectImageTest.java (original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/odmg/ObjectImageTest.java Thu
Mar  1 16:49:40 2007
@@ -134,7 +134,6 @@
         tx.begin();
         database.makePersistent(book);
         tx.commit();
-
         Integer version = book.getVersion();
         assertTrue(book.getVersion().intValue() > 0);
 
@@ -146,6 +145,11 @@
         Collection result = (Collection) query.execute();
         assertEquals(1, result.size());
         Book b = (Book) result.iterator().next();
+
+        // replace date value with real date stored in the DB (this can
+        // differ dependend on the used DB, e.g. with/without nano sec support, ...)
+        date = b.getPublicationDate();
+
         assertEquals(version, b.getVersion());
         tx.commit();
 
@@ -208,6 +212,11 @@
             Collection result = (Collection) query.execute();
             assertEquals(1, result.size());
             Book b = (Book) result.iterator().next();
+
+            // replace date value with real date stored in the DB (this can
+            // differ dependend on the used DB, e.g. with/without nano sec support, ...)
+            date = b.getPublicationDate();
+
             assertEquals(version, b.getVersion());
             tx.commit();
 



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