svn commit: r489444 - /db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataMultithreadedTest.java

[email protected]
Newsgroups gmane.comp.jakarta.ojb.devel
Message-ID <[email protected]>
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++;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.