db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r489444 - /db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java
Date Thu, 21 Dec 2006 19:16:51 GMT
Author: arminw
Date: Thu Dec 21 11:16:50 2006
New Revision: 489444

URL: http://svn.apache.org/viewvc?view=rev&rev=489444
Log:
fix test

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java?view=diff&rev=489444&r1=489443&r2=489444
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java
Thu Dec 21 11:16:50 2006
@@ -11,6 +11,7 @@
 import org.apache.ojb.broker.PersistenceBrokerFactory;
 import org.apache.ojb.broker.Person;
 import org.apache.ojb.broker.ProductGroupWithCollectionProxy;
+import org.apache.ojb.broker.InterfaceArticle;
 import org.apache.ojb.broker.accesslayer.OJBIterator;
 import org.apache.ojb.broker.query.Query;
 import org.apache.ojb.broker.query.QueryByCriteria;
@@ -309,10 +310,6 @@
         int loops;
         String title = "ThreadedUsingBroker_" + System.currentTimeMillis();
 
-        public ThreadedUsingBroker()
-        {
-        }
-
         public ThreadedUsingBroker(int loops)
         {
             this.loops = loops;
@@ -487,11 +484,17 @@
             // profile with unrelated class-mappings).
             DescriptorRepository dr = new DescriptorRepository();
             MetadataManager.getInstance().setDescriptor(dr);
-            Article article;
+            InterfaceArticle article;
             int numArticles = 0;
             for (Iterator iterator = articles.iterator(); iterator.hasNext();)
             {
-                assertNotNull(article = (Article) iterator.next());
+                Object obj = iterator.next();
+                assertNotNull(obj);
+                if(!(obj instanceof InterfaceArticle))
+                {
+                    fail("Expected instance of class Article, but retrieved: " + obj.getClass());
+                }
+                article = (InterfaceArticle) obj;
                 assertNotNull(article.getArticleId());
                 assertFalse(new Integer(0).equals(article.getArticleId()));
                 numArticles++;



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