db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r421026 - /db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataTest.java
Date Tue, 11 Jul 2006 23:30:53 GMT
Author: arminw
Date: Tue Jul 11 16:30:53 2006
New Revision: 421026

URL: http://svn.apache.org/viewvc?rev=421026&view=rev
Log:
add test for OJB-117

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

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataTest.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataTest.java?rev=421026&r1=421025&r2=421026&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataTest.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/metadata/MetadataTest.java
Tue Jul 11 16:30:53 2006
@@ -1,10 +1,9 @@
 package org.apache.ojb.broker.metadata;
 
-import java.util.Iterator;
 import java.io.File;
 import java.io.FileInputStream;
+import java.util.Iterator;
 
-import junit.framework.TestCase;
 import org.apache.ojb.broker.Identity;
 import org.apache.ojb.broker.ObjectRepository;
 import org.apache.ojb.broker.PBKey;
@@ -19,6 +18,7 @@
 import org.apache.ojb.broker.query.QueryFactory;
 import org.apache.ojb.broker.sequence.Repository;
 import org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl;
+import org.apache.ojb.junit.OJBTestCase;
 import org.apache.ojb.odmg.OJB;
 import org.odmg.Database;
 import org.odmg.Implementation;
@@ -29,11 +29,12 @@
  * This TestClass tests the RepositoryPersitors facilities for
  * reading and writing a valid repository.
  */
-public class MetadataTest extends TestCase
+public class MetadataTest extends OJBTestCase
 {
     public static final String TEST_CLASS_DESCRIPTOR = "Test_ClassDescriptor.xml";
     public static final String TEST_CONNECTION_DESCRIPTOR = "Test_ConnectionDescriptor.xml";
     public static final String TEST_REPOSITORY = "Test_Repository.xml";
+    public static final String TEST_JAR = "Test_Repository_Renamed_DTD.xml";
 
     /**
      * A persistent object class
@@ -51,11 +52,12 @@
         super(name);
     }
 
-    public void setUp()
+    public void setUp() throws Exception
     {
+        super.setUp();
     }
 
-    public void tearDown()
+    public void tearDown() throws Exception
     {
         try
         {
@@ -64,9 +66,10 @@
         catch (Exception e)
         {
         }
+        super.tearDown();
     }
 
-    public void testReadRepository() throws Exception
+    public void testReadRepository_1() throws Exception
     {
         MetadataManager mm = MetadataManager.getInstance();
 
@@ -84,8 +87,19 @@
         cr_1 = mm.readConnectionRepository(TEST_CONNECTION_DESCRIPTOR);
         assertNotNull(dr_1);
         assertNotNull(cr_1);
+    }
+
+    public void testReadRepository_2() throws Exception
+    {
+        MetadataManager mm = MetadataManager.getInstance();
 
+        DescriptorRepository dr_1 = mm.readDescriptorRepository(TEST_JAR);
+        assertNotNull(dr_1);
+        System.out.println("" + dr_1.toXML());
 
+        ConnectionRepository cr_1 = mm.readConnectionRepository(TEST_JAR);
+        assertNotNull(cr_1);
+        System.out.println("" + cr_1.toXML());
     }
 
     public void testFindFirstConcreteClassDescriptor()



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