Hi,

attached you find a patch adding a new method getRootList to the CompanyModelReader. It expects to find a bean called root and having the type List in the testdata xml. The method returns the list. I changed the CompletenessTest and the query test superclass to make use of the new method.

Regards Michael

--
Michael Bouschen                [EMAIL PROTECTED] Engineering GmbH
mailto:[EMAIL PROTECTED]        http://www.tech.spree.de/
Tel.:++49/30/235 520-33         Buelowstr. 66                   
Fax.:++49/30/2175 2012          D-10783 Berlin                  

Index: test/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java
===================================================================
--- test/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java     
(revision 219905)
+++ test/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java     
(working copy)
@@ -19,6 +19,7 @@
 import java.io.InputStream;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.List;
 import java.util.Locale;
 import java.util.TimeZone;
 
@@ -37,6 +38,9 @@
 
     /** The format of date values in the xml representation */
     public static final String DATE_PATTERN = "d/MMM/yyyy";
+
+    /** The name of the root list bean. */
+    public static final String ROOT_LIST_NAME = "root";
     
     /** All classes in the model 
      */
@@ -82,6 +86,15 @@
         super(new InputStreamResource(stream));
         configureFactory();
     }
+
+    /** 
+     * Returns a list of root objects. The method expects to find a bean
+     * called "root" of type list in the xml and returns it.
+     * @return a list of root instances
+     */
+    public List getRootList() {
+        return (List)getBean(ROOT_LIST_NAME);
+    }
     
     /** 
      * Configure the CompanyModelReader, e.g. register CustomEditor classes
Index: test/java/org/apache/jdo/tck/query/QueryTest.java
===================================================================
--- test/java/org/apache/jdo/tck/query/QueryTest.java   (revision 219905)
+++ test/java/org/apache/jdo/tck/query/QueryTest.java   (working copy)
@@ -130,7 +130,7 @@
         CompanyModelReader reader = new CompanyModelReader(filename);
         Transaction tx = pm.currentTransaction();
         tx.begin();
-        List rootList = (List)reader.getBean(ROOT_NAME);
+        List rootList = (List)reader.getRootList();
         pm.makePersistentAll(rootList);
         if (debug) logger.debug("inserted " + rootList);
         tx.commit();
@@ -145,6 +145,7 @@
      * The method returns the CompanyModelReader instance allowing to access 
      * a compay model instance by name.
      */
+    /*
     public CompanyModelReader loadCompanyModel(PersistenceManager pm,          
  
                                                String filename,
                                                Class pcRootClass) {
@@ -161,6 +162,7 @@
         tx = null;
         return reader;
     }
+    */
 
     /** */
     public void cleanupCompanyModel(PersistenceManager pm) {
Index: test/java/org/apache/jdo/tck/query/ComparingCollectionFieldToNull.java
===================================================================
--- test/java/org/apache/jdo/tck/query/ComparingCollectionFieldToNull.java      
(revision 219905)
+++ test/java/org/apache/jdo/tck/query/ComparingCollectionFieldToNull.java      
(working copy)
@@ -63,8 +63,7 @@
         
         try {
             // read test data
-            CompanyModelReader reader = loadCompanyModel(
-                pm, "org/apache/jdo/tck/pc/company/companyForQueryTests.xml");
+            CompanyModelReader reader = loadCompanyModel(pm, COMPANY_TESTDATA);
             runTest(pm, reader);
         }
         finally {
Index: test/java/org/apache/jdo/tck/query/DenoteUniquenessInFilter.java
===================================================================
--- test/java/org/apache/jdo/tck/query/DenoteUniquenessInFilter.java    
(revision 219905)
+++ test/java/org/apache/jdo/tck/query/DenoteUniquenessInFilter.java    
(working copy)
@@ -69,7 +69,7 @@
         try {
             // read test data
             CompanyModelReader reader = 
-                loadCompanyModel(pm, COMPANY_TESTDATA, Department.class);
+                loadCompanyModel(pm, COMPANY_TESTDATA);
             runTest(pm, reader);
         }
         finally {
Index: test/java/org/apache/jdo/tck/mapping/CompletenessTest.java
===================================================================
--- test/java/org/apache/jdo/tck/mapping/CompletenessTest.java  (revision 
219905)
+++ test/java/org/apache/jdo/tck/mapping/CompletenessTest.java  (working copy)
@@ -46,9 +46,6 @@
         "Assertion A18-[not identified] failed: ";
     
     /** */
-    public static final String ROOT_NAME = "root";
-    
-    /** */
     protected List rootOids;
     
         // todo: get filename from property
@@ -71,7 +68,7 @@
         // persist test data
         getPM();
         pm.currentTransaction().begin();
-        List rootList = (List)reader.getBean(ROOT_NAME);
+        List rootList = reader.getRootList();
         pm.makePersistentAll(rootList);
         addTearDownClass(reader.getTearDownClasses());
         rootOids = new ArrayList();
@@ -88,7 +85,7 @@
         
         // get new obj graph
         CompanyModelReader reader = new CompanyModelReader(inputFilename);
-        List rootList = (List)reader.getBean(ROOT_NAME);
+        List rootList = reader.getRootList();
         
         getPM();
         pm.currentTransaction().begin();

Reply via email to