db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r279234 [1/2] - in /incubator/jdo/trunk/tck20/test: java/org/apache/jdo/tck/mapping/ java/org/apache/jdo/tck/pc/company/ testdata/org/apache/jdo/tck/pc/company/
Date Wed, 07 Sep 2005 04:00:23 GMT
Author: clr
Date: Tue Sep  6 21:00:18 2005
New Revision: 279234

URL: http://svn.apache.org/viewcvs?rev=279234&view=rev
Log:
Added CompanyFactory and implementations; updated test data to use factory

Added:
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactory.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryAbstractImpl.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryConcreteClass.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMInterface.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryRegistry.java
Modified:
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/mapping/CompletenessTest.java
    incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java
    incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/company1-1Relationships.xml
    incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/company1-MRelationships.xml
    incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyAllRelationships.xml
    incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyEmbedded.xml
    incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyForQueryTests.xml
    incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyM-MRelationships.xml
    incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyNoRelationships.xml

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/mapping/CompletenessTest.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/mapping/CompletenessTest.java?rev=279234&r1=279233&r2=279234&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/mapping/CompletenessTest.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/mapping/CompletenessTest.java Tue Sep  6 21:00:18 2005
@@ -16,12 +16,21 @@
 
 package org.apache.jdo.tck.mapping;
 
+import java.lang.reflect.Constructor;
+
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
+import javax.jdo.PersistenceManager;
+import javax.jdo.JDOException;
+
 import org.apache.jdo.tck.JDO_Test;
+
+import org.apache.jdo.tck.pc.company.CompanyFactory;
+import org.apache.jdo.tck.pc.company.CompanyFactoryRegistry;
 import org.apache.jdo.tck.pc.company.CompanyModelReader;
+
 import org.apache.jdo.tck.util.BatchTestRunner;
 import org.apache.jdo.tck.util.DeepEquality;
 import org.apache.jdo.tck.util.EqualityHelper;
@@ -62,9 +71,10 @@
      * @see JDO_Test#localSetUp()
      */
     protected void localSetUp() {
+        getPM();
+        CompanyFactoryRegistry.registerFactory(pm);
         CompanyModelReader reader = new CompanyModelReader(inputFilename);
         // persist test data
-        getPM();
         pm.currentTransaction().begin();
         List rootList = reader.getRootList();
         pm.makePersistentAll(rootList);
@@ -81,7 +91,9 @@
     /** */
     public void test() {
         
-        // get new obj graph
+        // register the default factory
+        CompanyFactoryRegistry.registerFactory();
+        // get new obj graph to compare persistent graph with
         CompanyModelReader reader = new CompanyModelReader(inputFilename);
         List rootList = reader.getRootList();
         
@@ -110,7 +122,8 @@
         pm.currentTransaction().commit();
         // fail test if at least one of the instances is not the expected one
         if (msg.length() > 0) {
-            fail("CompletenessTest failed; see list of failed instances below:", msg.toString());
+            fail("CompletenessTest failed; see list of failures below:", 
+                    msg.toString());
         }
     }
 }

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactory.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactory.java?rev=279234&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactory.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactory.java Tue Sep  6 21:00:18 2005
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+ 
+/*
+ * CompanyFactory.java
+ *
+ */
+
+package org.apache.jdo.tck.pc.company;
+
+import java.math.BigDecimal;
+
+import java.util.Date;
+
+/**
+ * This interface is implemented by a factory class that can create 
+ * Company model instances. The factory instance is registered with 
+ * CompanyFactoryRegistry.
+ */
+public interface CompanyFactory {
+    ICompany newCompany(long companyid, String name, Date founded);
+    ICompany newCompany(long companyid, String name, Date founded, 
+            IAddress addr);
+    IAddress newAddress(long addrid, String street, String city, 
+            String state, String zipcode, String country);
+    IDentalInsurance newDentalInsurance(long insid, String carrier, 
+            BigDecimal lifetimeOrthoBenefit);
+    IDentalInsurance newDentalInsurance(long insid, String carrier, 
+            IEmployee employee, BigDecimal lifetimeOrthoBenefit);
+    IDepartment newDepartment(long deptid, String name);
+    IDepartment newDepartment(long deptid, 
+            String name, ICompany company);
+    IDepartment newDepartment(long deptid, 
+            String name, ICompany company, 
+            IEmployee employeeOfTheMonth);
+    IFullTimeEmployee newFullTimeEmployee(long personid, 
+            String first, String last, String middle, 
+            Date born, IAddress addr, Date hired, double sal);
+    IFullTimeEmployee newFullTimeEmployee(long personid, 
+            String first, String last, String middle, 
+            Date born, Date hired, double sal);
+    IMedicalInsurance newMedicalInsurance(long insid, String carrier, 
+            String planType);
+    IMedicalInsurance newMedicalInsurance(long insid, String carrier, 
+            IEmployee employee, String planType);
+    IPartTimeEmployee newPartTimeEmployee(long personid, 
+            String first, String last, String middle, 
+            Date born, Date hired, double wage);
+    IPartTimeEmployee newPartTimeEmployee(long personid, 
+            String first, String last, String middle,
+            Date born, IAddress addr, Date hired, double wage); 
+    IProject newProject(long projid, String name, BigDecimal budget);
+}

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryAbstractImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryAbstractImpl.java?rev=279234&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryAbstractImpl.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryAbstractImpl.java Tue Sep  6 21:00:18 2005
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jdo.tck.pc.company;
+
+import javax.jdo.PersistenceManager;
+
+/*
+ * This class provides an implementation of CompanyFactory that sets all
+ * of the properties of the instance and defines abstract methods to
+ * construct the instance itself. It is intended to be subclassed by
+ * classes that implement only the methods to construct the instance.
+ */
+public abstract class CompanyFactoryAbstractImpl implements CompanyFactory {
+    
+    protected PersistenceManager pm;
+    
+    /** Creates a new instance of CompanyFactoryAbstractImpl */
+    public CompanyFactoryAbstractImpl(PersistenceManager pm) {
+        this.pm = pm;
+    }
+
+    abstract IAddress newAddress();
+    abstract ICompany newCompany();
+    abstract IDentalInsurance newDentalInsurance();
+    abstract IDepartment newDepartment();
+    abstract IFullTimeEmployee newFullTimeEmployee();
+    abstract IMedicalInsurance newMedicalInsurance();
+    abstract IPartTimeEmployee newPartTimeEmployee();
+    abstract IProject newProject();
+    
+    public IAddress newAddress(long addrid, String street, String city, String state, String zipcode, String country) {
+        IAddress result = newAddress();
+        result.setAddrid(addrid);
+        result.setStreet(street);
+        result.setCity(city);
+        result.setState(state);
+        result.setZipcode(zipcode);
+        result.setCountry(country);
+        return result;
+    }
+
+    public ICompany newCompany(long companyid, String name, java.util.Date founded) {
+        ICompany result = newCompany();
+        result.setCompanyid(companyid);
+        result.setName(name);
+        result.setFounded(founded);
+        return result;
+    }
+
+    public ICompany newCompany(long companyid, String name, java.util.Date founded, IAddress addr) {
+        ICompany result = newCompany();
+        result.setCompanyid(companyid);
+        result.setName(name);
+        result.setFounded(founded);
+        result.setAddress(addr);
+        return result;
+    }
+
+    public IDentalInsurance newDentalInsurance(long insid, String carrier, java.math.BigDecimal lifetimeOrthoBenefit) {
+        IDentalInsurance result = newDentalInsurance();
+        result.setInsid(insid);
+        result.setCarrier(carrier);
+        result.setLifetimeOrthoBenefit(lifetimeOrthoBenefit);
+        return null;
+    }
+
+    public IDentalInsurance newDentalInsurance(long insid, String carrier, IEmployee employee, java.math.BigDecimal lifetimeOrthoBenefit) {
+        IDentalInsurance result = newDentalInsurance();
+        result.setInsid(insid);
+        result.setCarrier(carrier);
+        result.setEmployee(employee);
+        result.setLifetimeOrthoBenefit(lifetimeOrthoBenefit);
+        return result;
+    }
+
+    public IDepartment newDepartment(long deptid, String name) {
+        IDepartment result = newDepartment();
+        result.setDeptid(deptid);
+        result.setName(name);
+        return result;
+    }
+
+    public IDepartment newDepartment(long deptid, String name, ICompany company) {
+        IDepartment result = newDepartment();
+        result.setDeptid(deptid);
+        result.setName(name);
+        result.setCompany(company);
+        return result;
+    }
+
+    public IDepartment newDepartment(long deptid, String name, ICompany company, IEmployee employeeOfTheMonth) {
+        IDepartment result = newDepartment();
+        result.setDeptid(deptid);
+        result.setName(name);
+        result.setCompany(company);
+        result.setEmployeeOfTheMonth(employeeOfTheMonth);
+        return result;
+    }
+
+    public IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, java.util.Date hired, double sal) {
+        IFullTimeEmployee result = newFullTimeEmployee();
+        result.setPersonid(personid);
+        result.setFirstname(first);
+        result.setLastname(last);
+        result.setMiddlename(middle);
+        result.setBirthdate(born);
+        result.setHiredate(hired);
+        result.setSalary(sal);
+        return result;
+    }
+
+    public IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, IAddress addr, java.util.Date hired, double sal) {
+        IFullTimeEmployee result = newFullTimeEmployee();
+        result.setPersonid(personid);
+        result.setFirstname(first);
+        result.setLastname(last);
+        result.setMiddlename(middle);
+        result.setBirthdate(born);
+        result.setAddress(addr);
+        result.setHiredate(hired);
+        result.setSalary(sal);
+        return result;
+    }
+
+    public IMedicalInsurance newMedicalInsurance(long insid, String carrier, String planType) {
+        IMedicalInsurance result = newMedicalInsurance();
+        result.setInsid(insid);
+        result.setCarrier(carrier);
+        result.setPlanType(planType);
+        return result;
+    }
+
+    public IMedicalInsurance newMedicalInsurance(long insid, String carrier, IEmployee employee, String planType) {
+        IMedicalInsurance result = newMedicalInsurance();
+        result.setInsid(insid);
+        result.setCarrier(carrier);
+        result.setEmployee(employee);
+        result.setPlanType(planType);
+        return result;
+    }
+
+    public IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, java.util.Date hired, double wage) {
+        IPartTimeEmployee result = newPartTimeEmployee();
+        result.setPersonid(personid);
+        result.setFirstname(first);
+        result.setLastname(last);
+        result.setMiddlename(middle);
+        result.setBirthdate(born);
+        result.setHiredate(hired);
+        result.setWage(wage);
+        return result;
+    }
+
+    public IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, IAddress addr, java.util.Date hired, double wage) {
+        IPartTimeEmployee result = newPartTimeEmployee();
+        result.setPersonid(personid);
+        result.setFirstname(first);
+        result.setLastname(last);
+        result.setMiddlename(middle);
+        result.setBirthdate(born);
+        result.setAddress(addr);
+        result.setHiredate(hired);
+        result.setWage(wage);
+        return result;
+    }
+
+    public IProject newProject(long projid, String name, java.math.BigDecimal budget) {
+        IProject result = newProject();
+        result.setProjid(projid);
+        result.setName(name);
+        result.setBudget(budget);
+        return result;
+    }
+    
+}

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryConcreteClass.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryConcreteClass.java?rev=279234&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryConcreteClass.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryConcreteClass.java Tue Sep  6 21:00:18 2005
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jdo.tck.pc.company;
+
+import java.math.BigDecimal;
+
+import java.util.Date;
+
+import javax.jdo.PersistenceManager;
+
+/*
+ * This class is the company factory that uses constructors of the
+ * concrete classes.
+ */
+public  class CompanyFactoryConcreteClass implements CompanyFactory {
+
+    public CompanyFactoryConcreteClass(PersistenceManager pm) {
+    }
+
+    public CompanyFactoryConcreteClass() {
+    }
+
+    public ICompany newCompany(long companyid, 
+            String name, Date founded) {
+        return new Company(companyid, name, founded);
+    }
+
+    public ICompany newCompany(long companyid, 
+            String name, Date founded, IAddress addr) {
+        return new Company(companyid, name, founded, addr);
+    }
+
+    public IAddress newAddress(long addrid, 
+            String street, String city, String state, String zipcode, 
+            String country) {
+        return new Address(addrid, street, city, state, zipcode, country);
+    }
+
+    public IDentalInsurance newDentalInsurance(long insid, 
+            String carrier, BigDecimal lifetimeOrthoBenefit) {
+        return new DentalInsurance(insid, carrier, lifetimeOrthoBenefit);
+    }
+
+    public IDentalInsurance newDentalInsurance(long insid, 
+            String carrier, IEmployee employee,
+            BigDecimal lifetimeOrthoBenefit) {
+        return new DentalInsurance(insid, carrier, lifetimeOrthoBenefit);
+    }
+
+    public IDepartment newDepartment(long deptid, String name) {
+        return new Department(deptid, name);
+    }
+
+    public IDepartment newDepartment(long deptid, 
+            String name, ICompany company) {
+        return new Department(deptid, name, company);
+    }
+
+    public IDepartment newDepartment(long deptid, 
+            String name, ICompany company, IEmployee employeeOfTheMonth) {
+        return new Department(deptid, name, company, employeeOfTheMonth);
+    }
+
+    public IFullTimeEmployee newFullTimeEmployee(long personid, 
+            String first, String last, String middle, 
+            Date born, Date hired, double sal) {
+        return new FullTimeEmployee(personid, first, last, middle,
+                born, hired, sal);
+    }
+
+    public IFullTimeEmployee newFullTimeEmployee(long personid, 
+            String first, String last, String middle, 
+            Date born, IAddress addr, Date hired, double sal) {
+        return new FullTimeEmployee(personid, first, last, middle,
+                born, addr, hired, sal);
+    }
+
+    public IMedicalInsurance newMedicalInsurance(long insid, 
+            String carrier, String planType) {
+        return new MedicalInsurance(insid, carrier, planType);
+    }
+
+    public IMedicalInsurance newMedicalInsurance(long insid, 
+            String carrier, IEmployee employee, String planType) {
+        return new MedicalInsurance(insid, carrier, planType);
+    }
+
+    public IPartTimeEmployee newPartTimeEmployee(long personid, 
+            String first, String last, String middle, 
+            Date born, Date hired, double wage ) {
+        return new PartTimeEmployee(personid, first, last, middle,
+                born, hired, wage);
+    }
+
+    public IPartTimeEmployee newPartTimeEmployee(long personid, 
+            String first, String last, String middle, 
+            Date born, IAddress addr, Date hired, double wage) {
+        return new PartTimeEmployee(personid, first, last, middle, 
+                born, addr, hired, wage);
+    } 
+
+    public IPerson newPerson(long personid, 
+            String firstname, String lastname, String middlename, 
+            Date birthdate) {
+        return new Person(personid, firstname, lastname, middlename,
+                birthdate);
+    }
+
+    public IPerson newPerson(long personid, 
+            String firstname, String lastname, String middlename, 
+            Date birthdate, IAddress address) {
+        return new Person(personid, firstname, lastname, middlename, 
+                birthdate, address);
+    }
+
+    public IProject newProject(long projid, String name, 
+            BigDecimal budget) {
+        return new Project(projid, name, budget);
+    }
+}

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMInterface.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMInterface.java?rev=279234&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMInterface.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMInterface.java Tue Sep  6 21:00:18 2005
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jdo.tck.pc.company;
+
+import javax.jdo.PersistenceManager;
+
+/*
+ * CompanyFactoryPMInterface.java
+ *
+ * Created on August 29, 2005, 9:56 PM
+ *
+ */
+public class CompanyFactoryPMInterface 
+        extends CompanyFactoryAbstractImpl {
+    
+    /**
+     * Creates a new instance of CompanyFactoryPMInterface 
+     */
+    public CompanyFactoryPMInterface(PersistenceManager pm) {
+        super(pm);
+    }
+    
+    IAddress newAddress() {
+        return (IAddress)pm.newInstance(IAddress.class);
+    }
+    
+    ICompany newCompany() {
+        return (ICompany)pm.newInstance(ICompany.class);
+    }
+    
+    IDentalInsurance newDentalInsurance() {
+        return (IDentalInsurance)pm.newInstance(IDentalInsurance.class);
+    }
+    
+    IDepartment newDepartment() {
+        return (IDepartment)pm.newInstance(IDepartment.class);
+    }
+    
+    IFullTimeEmployee  newFullTimeEmployee() {
+        return (IFullTimeEmployee)pm.newInstance(IFullTimeEmployee.class);
+    }
+    
+    IMedicalInsurance newMedicalInsurance() {
+        return (IMedicalInsurance)pm.newInstance(IMedicalInsurance.class);        
+    }
+    
+    IPartTimeEmployee  newPartTimeEmployee() {
+        return (IPartTimeEmployee)pm.newInstance(IPartTimeEmployee.class);
+    }
+    
+    IProject newProject() {
+        return (IProject)pm.newInstance(IProject.class);
+    }
+
+}

Added: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryRegistry.java?rev=279234&view=auto
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryRegistry.java (added)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyFactoryRegistry.java Tue Sep  6 21:00:18 2005
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+ 
+package org.apache.jdo.tck.pc.company;
+
+import java.lang.reflect.Constructor;
+
+import java.math.BigDecimal;
+
+import java.util.Date;
+
+import javax.jdo.PersistenceManager;
+
+/*
+ * This is the registry for company factories. It is used for the
+ * CompletenessTest to create instances from input xml test data files.
+ * Factory instances that implement CompanyFactory interface are 
+ * registered (using the singleton pattern).
+ * <P>Several registration methods are available. The default factory,
+ * which creates instances by construction, is automatically
+ * registered during class initialization. The default factory can
+ * also be registered by using the no-args method registerFactory().
+ * <P>Non-default factories can be registered using the registerFactory
+ * method taking the factory as an argument. Non-default factories that
+ * have a single constructor argument PersistenceManager can be
+ * registered using either the method that explicitly names the class,
+ * or with the method that takes the class name from a system property.
+ */
+public class CompanyFactoryRegistry {
+
+    /** The system property for factory name
+     */
+    final static String FACTORY_PROPERTY_NAME = 
+        "jdo.tck.mapping.companyfactory";
+
+    /** The factory name if the system property is not set.
+     */
+    final static String DEFAULT_FACTORY_CLASS_NAME =
+        "org.apache.jdo.tck.pc.company.CompanyFactoryConcreteClass";
+
+    /**
+     * The default factory class name
+     */
+    final static String FACTORY_CLASS_NAME = 
+        System.getProperty(FACTORY_PROPERTY_NAME, DEFAULT_FACTORY_CLASS_NAME);
+
+    /**
+     * This is the default company factory singleton. This is statically
+     * loaded regardless of the setting of the system property.
+     */
+    final static CompanyFactory SINGLETON = new CompanyFactoryConcreteClass();
+    
+    /** 
+     * This is the currently registered factory.
+     */
+    static CompanyFactory instance = SINGLETON;
+    
+    /**
+     * Creates a new instance of CompanyFactoryRegistry 
+     */
+    private CompanyFactoryRegistry() {
+    }
+
+    /** 
+     * Get the currently registered factory.
+     * @return the factory
+     */
+    public static CompanyFactory getInstance() {
+        return instance;
+    }
+
+    /** Register the default factory.
+     */
+    public static void registerFactory() {
+        instance = SINGLETON;
+    }
+
+    /** Register a factory using the default factory name from the
+     * system property. The factory must be available in the current
+     * class path and have a public constructor
+     * taking a PersistenceManager as a parameter.
+     * @param pm the PersistenceManager
+     */
+    public static void registerFactory(PersistenceManager pm) {
+        registerFactory(FACTORY_CLASS_NAME, pm);
+    }
+
+    /** Register a factory using the specified factoryName
+     * parameter. The factory class must be loadable by the current context
+     * classloader and have a public constructor
+     * taking a PersistenceManager as a parameter.
+     * @param factoryClassName the fully-qualified class name of the factory
+     * @param pm the PersistenceManager
+     */
+    public static void registerFactory(String factoryClassName, 
+            PersistenceManager pm) {
+        CompanyFactory factory = null;
+        try {
+            if (factoryClassName != null) {
+                Class factoryClass = Class.forName(factoryClassName);
+                Constructor ctor = factoryClass.getConstructor(new Class[]
+                    {PersistenceManager.class});
+                factory = (CompanyFactory)
+                    ctor.newInstance(new Object[]{pm});
+            }
+            registerFactory(factory);
+        } catch (Exception ex) {
+            throw new RuntimeException ("Unable to construct CompanyFactory " +
+                    factoryClassName, ex);
+        }
+    }
+
+    /** Register the factory.
+     * @param factory the factory
+     */
+    public static void registerFactory(CompanyFactory factory) {
+        instance = factory!=null?factory:SINGLETON;
+    }
+
+}

Modified: incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java?rev=279234&r1=279233&r2=279234&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java (original)
+++ incubator/jdo/trunk/tck20/test/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java Tue Sep  6 21:00:18 2005
@@ -41,7 +41,11 @@
 
     /** The name of the root list bean. */
     public static final String ROOT_LIST_NAME = "root";
-    
+
+    /** The bean-factory name in the xml input files.
+     */
+    public static final String BEAN_FACTORY_NAME = "companyFactory";
+
     /** All classes in the model 
      */
     private static final Class[] allClasses = new Class[] {
@@ -107,6 +111,7 @@
         CustomDateEditor dateEditor = 
             new CustomDateEditor(formatter, true);
         registerCustomEditor(Date.class, dateEditor);
+        addSingleton(BEAN_FACTORY_NAME, CompanyFactoryRegistry.getInstance());
     }
     
     // Convenience methods

Modified: incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/company1-1Relationships.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/company1-1Relationships.xml?rev=279234&r1=279233&r2=279234&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/company1-1Relationships.xml (original)
+++ incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/company1-1Relationships.xml Tue Sep  6 21:00:18 2005
@@ -22,23 +22,23 @@
         </constructor-arg>
     </bean>
 
-    <bean id="company1" class="org.apache.jdo.tck.pc.company.Company">
+    <bean id="company1" factory-bean="companyFactory" factory-method="newCompany">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Sun Microsystems, Inc.</value></constructor-arg>
         <constructor-arg index="2" type="java.util.Date"><value>11/Apr/1952</value></constructor-arg>
     </bean>
 
-    <bean id="dept1" class="org.apache.jdo.tck.pc.company.Department">
+    <bean id="dept1" factory-bean="companyFactory" factory-method="newDepartment">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String" ><value>Development</value></constructor-arg>
     </bean>
 
-    <bean id="dept2" class="org.apache.jdo.tck.pc.company.Department">
+    <bean id="dept2" factory-bean="companyFactory" factory-method="newDepartment">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String" ><value>Human Resources</value></constructor-arg>
     </bean>
 
-    <bean id="emp1" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp1" factory-bean="companyFactory" factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp1First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp1Last</value></constructor-arg>
@@ -52,7 +52,7 @@
         <property name="mentor"><ref bean="emp2"/></property>
         <property name="protege"><ref bean="emp5"/></property>
     </bean>
-    <bean id="emp2" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp2" factory-bean="companyFactory" factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp2First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp2Last</value></constructor-arg>
@@ -66,7 +66,7 @@
         <property name="mentor"><ref bean="emp3"/></property>
         <property name="protege"><ref bean="emp1"/></property>
     </bean>
-    <bean id="emp3" class="org.apache.jdo.tck.pc.company.PartTimeEmployee">
+    <bean id="emp3" factory-bean="companyFactory" factory-method="newPartTimeEmployee">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp3First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp3Last</value></constructor-arg>
@@ -80,7 +80,7 @@
         <property name="mentor"><ref bean="emp4"/></property>
         <property name="protege"><ref bean="emp2"/></property>
     </bean>
-    <bean id="emp4" class="org.apache.jdo.tck.pc.company.PartTimeEmployee">
+    <bean id="emp4" factory-bean="companyFactory" factory-method="newPartTimeEmployee">
         <constructor-arg index="0" type="long"><value>4</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp4First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp4Last</value></constructor-arg>
@@ -93,7 +93,7 @@
         <property name="mentor"><ref bean="emp5"/></property>
         <property name="protege"><ref bean="emp3"/></property>
     </bean>
-    <bean id="emp5" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp5" factory-bean="companyFactory" factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>5</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp5First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp5Last</value></constructor-arg>
@@ -107,7 +107,7 @@
         <property name="protege"><ref bean="emp4"/></property>
     </bean>
 
-    <bean id="addr1" class="org.apache.jdo.tck.pc.company.Address">
+    <bean id="addr1" factory-bean="companyFactory" factory-method="newAddress">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Unter den Linden 1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>Berlin</value></constructor-arg>
@@ -115,7 +115,7 @@
         <constructor-arg index="4" type="java.lang.String"><value>12345</value></constructor-arg>
         <constructor-arg index="5" type="java.lang.String"><value>Germany</value></constructor-arg>
     </bean>
-    <bean id="addr2" class="org.apache.jdo.tck.pc.company.Address">
+    <bean id="addr2" factory-bean="companyFactory" factory-method="newAddress">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Broadway 1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>New York</value></constructor-arg>
@@ -123,7 +123,7 @@
         <constructor-arg index="4" type="java.lang.String"><value>10000</value></constructor-arg>
         <constructor-arg index="5" type="java.lang.String"><value>USA</value></constructor-arg>
     </bean>
-    <bean id="addr3" class="org.apache.jdo.tck.pc.company.Address">
+    <bean id="addr3" factory-bean="companyFactory" factory-method="newAddress">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Market St.</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>San Francisco</value></constructor-arg>
@@ -132,89 +132,90 @@
         <constructor-arg index="5" type="java.lang.String"><value>USA</value></constructor-arg>
     </bean>
 
-    <bean id="medicalIns1" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns1" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>PPO</value></constructor-arg>
         <property name="employee"><ref bean="emp1"/></property>
     </bean>
 
-    <bean id="medicalIns2" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns2" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier2</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>HMO</value></constructor-arg>
         <property name="employee"><ref bean="emp2"/></property>
     </bean>
 
-    <bean id="medicalIns3" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns3" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier3</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>HMO</value></constructor-arg>
         <property name="employee"><ref bean="emp3"/></property>
     </bean>
 
-    <bean id="medicalIns4" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns4" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>4</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier4</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>HMO</value></constructor-arg>
         <property name="employee"><ref bean="emp4"/></property>
     </bean>
 
-    <bean id="medicalIns5" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns5" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>5</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier5</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>HMO</value></constructor-arg>
         <property name="employee"><ref bean="emp5"/></property>
     </bean>
 
-    <bean id="dentalIns1" class="org.apache.jdo.tck.pc.company.DentalInsurance">
+    <bean id="dentalIns1" factory-bean="companyFactory" factory-method="newDentalInsurance">
         <constructor-arg index="0" type="long"><value>11</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier1</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>99.999</value></constructor-arg>
         <property name="employee"><ref bean="emp1"/></property>
     </bean>
 
-    <bean id="dentalIns2" class="org.apache.jdo.tck.pc.company.DentalInsurance">
+    <bean id="dentalIns2" factory-bean="companyFactory" factory-method="newDentalInsurance">
         <constructor-arg index="0" type="long"><value>12</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier2</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>99.999</value></constructor-arg>
         <property name="employee"><ref bean="emp2"/></property>
     </bean>
 
-    <bean id="dentalIns3" class="org.apache.jdo.tck.pc.company.DentalInsurance">
+    <bean id="dentalIns3" factory-bean="companyFactory" factory-method="newDentalInsurance">
         <constructor-arg index="0" type="long"><value>13</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier3</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>99.999</value></constructor-arg>
         <property name="employee"><ref bean="emp3"/></property>
     </bean>
 
-    <bean id="dentalIns4" class="org.apache.jdo.tck.pc.company.DentalInsurance">
+    <bean id="dentalIns4" factory-bean="companyFactory" factory-method="newDentalInsurance">
         <constructor-arg index="0" type="long"><value>14</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier4</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>99.999</value></constructor-arg>
         <property name="employee"><ref bean="emp4"/></property>
     </bean>
 
-    <bean id="dentalIns5" class="org.apache.jdo.tck.pc.company.DentalInsurance">
+    <bean id="dentalIns5" factory-bean="companyFactory" factory-method="newDentalInsurance">
         <constructor-arg index="0" type="long"><value>15</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier5</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>99.999</value></constructor-arg>
         <property name="employee"><ref bean="emp5"/></property>
     </bean>
 
-    <bean id="proj1" class="org.apache.jdo.tck.pc.company.Project">
+    <bean id="proj1" factory-bean="companyFactory" factory-method="newProject">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>orange</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>2500000.99</value></constructor-arg>
     </bean>
-    <bean id="proj2" class="org.apache.jdo.tck.pc.company.Project">
+    <bean id="proj2" factory-bean="companyFactory" factory-method="newProject">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>blue</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>50000.00</value></constructor-arg>
     </bean>
-    <bean id="proj3" class="org.apache.jdo.tck.pc.company.Project">
+    <bean id="proj3" factory-bean="companyFactory" factory-method="newProject">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>green</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>2000.99</value></constructor-arg>
     </bean>
 </beans>
+

Modified: incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/company1-MRelationships.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/company1-MRelationships.xml?rev=279234&r1=279233&r2=279234&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/company1-MRelationships.xml (original)
+++ incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/company1-MRelationships.xml Tue Sep  6 21:00:18 2005
@@ -19,7 +19,7 @@
         </constructor-arg>
     </bean>
 
-    <bean id="company1" class="org.apache.jdo.tck.pc.company.Company">
+    <bean id="company1" factory-bean="companyFactory" factory-method="newCompany">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Sun Microsystems, Inc.</value></constructor-arg>
         <constructor-arg index="2" type="java.util.Date"><value>11/Apr/1952</value></constructor-arg>
@@ -31,7 +31,7 @@
         </property>
     </bean>
 
-    <bean id="dept1" class="org.apache.jdo.tck.pc.company.Department">
+    <bean id="dept1" factory-bean="companyFactory" factory-method="newDepartment">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String" ><value>Development</value></constructor-arg>
         <property name="company"><ref bean="company1"/></property>
@@ -50,7 +50,7 @@
         </property>
     </bean>
 
-    <bean id="dept2" class="org.apache.jdo.tck.pc.company.Department">
+    <bean id="dept2" factory-bean="companyFactory" factory-method="newDepartment">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String" ><value>Human Resources</value></constructor-arg>
         <property name="company"><ref bean="company1"/></property>
@@ -69,7 +69,7 @@
         </property>
     </bean>
 
-    <bean id="emp1" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp1" factory-bean="companyFactory" factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp1First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp1Last</value></constructor-arg>
@@ -83,7 +83,7 @@
         <property name="manager"><ref bean="emp2"/></property>
         <property name="hradvisor"><ref bean="emp5"/></property>
     </bean>
-    <bean id="emp2" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp2" factory-bean="companyFactory" factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp2First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp2Last</value></constructor-arg>
@@ -104,7 +104,7 @@
             </set>
         </property>
     </bean>
-    <bean id="emp3" class="org.apache.jdo.tck.pc.company.PartTimeEmployee">
+    <bean id="emp3" factory-bean="companyFactory" factory-method="newPartTimeEmployee">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp3First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp3Last</value></constructor-arg>
@@ -118,7 +118,7 @@
         <property name="manager"><ref bean="emp2"/></property>
         <property name="hradvisor"><ref bean="emp5"/></property>
     </bean>
-    <bean id="emp4" class="org.apache.jdo.tck.pc.company.PartTimeEmployee">
+    <bean id="emp4" factory-bean="companyFactory" factory-method="newPartTimeEmployee">
         <constructor-arg index="0" type="long"><value>4</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp4First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp4Last</value></constructor-arg>
@@ -131,7 +131,7 @@
         <property name="manager"><ref bean="emp2"/></property>
         <property name="hradvisor"><ref bean="emp5"/></property>
     </bean>
-    <bean id="emp5" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp5" factory-bean="companyFactory" factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>5</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp5First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp5Last</value></constructor-arg>
@@ -152,7 +152,7 @@
         </property>
     </bean>
 
-    <bean id="addr1" class="org.apache.jdo.tck.pc.company.Address">
+    <bean id="addr1" factory-bean="companyFactory" factory-method="newAddress">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Unter den Linden 1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>Berlin</value></constructor-arg>
@@ -160,7 +160,7 @@
         <constructor-arg index="4" type="java.lang.String"><value>12345</value></constructor-arg>
         <constructor-arg index="5" type="java.lang.String"><value>Germany</value></constructor-arg>
     </bean>
-    <bean id="addr2" class="org.apache.jdo.tck.pc.company.Address">
+    <bean id="addr2" factory-bean="companyFactory" factory-method="newAddress">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Broadway 1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>New York</value></constructor-arg>
@@ -168,7 +168,7 @@
         <constructor-arg index="4" type="java.lang.String"><value>10000</value></constructor-arg>
         <constructor-arg index="5" type="java.lang.String"><value>USA</value></constructor-arg>
     </bean>
-    <bean id="addr3" class="org.apache.jdo.tck.pc.company.Address">
+    <bean id="addr3" factory-bean="companyFactory" factory-method="newAddress">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Market St.</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>San Francisco</value></constructor-arg>
@@ -177,43 +177,44 @@
         <constructor-arg index="5" type="java.lang.String"><value>USA</value></constructor-arg>
     </bean>
 
-    <bean id="medicalIns1" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns1" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>PPO</value></constructor-arg>
     </bean>
 
-    <bean id="medicalIns2" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns2" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier2</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>HMO</value></constructor-arg>
     </bean>
 
-    <bean id="medicalIns3" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns3" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier2</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>HMO</value></constructor-arg>
     </bean>
 
-    <bean id="dentalIns1" class="org.apache.jdo.tck.pc.company.DentalInsurance">
+    <bean id="dentalIns1" factory-bean="companyFactory" factory-method="newDentalInsurance">
         <constructor-arg index="0" type="long"><value>4</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier2</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>99.999</value></constructor-arg>
     </bean>
 
-    <bean id="proj1" class="org.apache.jdo.tck.pc.company.Project">
+    <bean id="proj1" factory-bean="companyFactory" factory-method="newProject">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>orange</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>2500000.99</value></constructor-arg>
     </bean>
-    <bean id="proj2" class="org.apache.jdo.tck.pc.company.Project">
+    <bean id="proj2" factory-bean="companyFactory" factory-method="newProject">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>blue</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>50000.00</value></constructor-arg>
     </bean>
-    <bean id="proj3" class="org.apache.jdo.tck.pc.company.Project">
+    <bean id="proj3" factory-bean="companyFactory" factory-method="newProject">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>green</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>2000.99</value></constructor-arg>
     </bean>
 </beans>
+

Modified: incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyAllRelationships.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyAllRelationships.xml?rev=279234&r1=279233&r2=279234&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyAllRelationships.xml (original)
+++ incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyAllRelationships.xml Tue Sep  6 21:00:18 2005
@@ -12,7 +12,7 @@
         </constructor-arg>
     </bean>
 
-    <bean id="company1" class="org.apache.jdo.tck.pc.company.Company">
+    <bean id="company1" factory-bean="companyFactory" factory-method="newCompany">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Sun Microsystems, Inc.</value></constructor-arg>
         <constructor-arg index="2" type="java.util.Date"><value>11/Apr/1952</value></constructor-arg>
@@ -25,7 +25,7 @@
         </property>
     </bean>
 
-    <bean id="dept1" class="org.apache.jdo.tck.pc.company.Department">
+    <bean id="dept1" factory-bean="companyFactory" factory-method="newDepartment">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String" ><value>Development</value></constructor-arg>
         <property name="company"><ref bean="company1"/></property>
@@ -44,7 +44,7 @@
         </property>
     </bean>
 
-    <bean id="dept2" class="org.apache.jdo.tck.pc.company.Department">
+    <bean id="dept2" factory-bean="companyFactory" factory-method="newDepartment">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String" ><value>Human Resources</value></constructor-arg>
         <property name="company"><ref bean="company1"/></property>
@@ -63,7 +63,7 @@
         </property>
     </bean>
 
-    <bean id="emp1" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp1" factory-bean="companyFactory" factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp1First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp1Last</value></constructor-arg>
@@ -98,7 +98,7 @@
             </set>
         </property>
     </bean>
-    <bean id="emp2" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp2" factory-bean="companyFactory" factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp2First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp2Last</value></constructor-arg>
@@ -136,7 +136,7 @@
             </set>
         </property>
     </bean>
-    <bean id="emp3" class="org.apache.jdo.tck.pc.company.PartTimeEmployee">
+    <bean id="emp3" factory-bean="companyFactory" factory-method="newPartTimeEmployee">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp3First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp3Last</value></constructor-arg>
@@ -167,7 +167,7 @@
             </set>
         </property>
     </bean>
-    <bean id="emp4" class="org.apache.jdo.tck.pc.company.PartTimeEmployee">
+    <bean id="emp4" factory-bean="companyFactory" factory-method="newPartTimeEmployee">
         <constructor-arg index="0" type="long"><value>4</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp4First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp4Last</value></constructor-arg>
@@ -201,7 +201,7 @@
             </set>
         </property>
     </bean>
-    <bean id="emp5" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp5" factory-bean="companyFactory" factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>5</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp5First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp5Last</value></constructor-arg>
@@ -243,7 +243,7 @@
         </property>
     </bean>
 
-    <bean id="addr1" class="org.apache.jdo.tck.pc.company.Address">
+    <bean id="addr1" factory-bean="companyFactory" factory-method="newAddress">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Unter den Linden 1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>Berlin</value></constructor-arg>
@@ -251,7 +251,7 @@
         <constructor-arg index="4" type="java.lang.String"><value>12345</value></constructor-arg>
         <constructor-arg index="5" type="java.lang.String"><value>Germany</value></constructor-arg>
     </bean>
-    <bean id="addr2" class="org.apache.jdo.tck.pc.company.Address">
+    <bean id="addr2" factory-bean="companyFactory" factory-method="newAddress">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Broadway 1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>New York</value></constructor-arg>
@@ -259,7 +259,7 @@
         <constructor-arg index="4" type="java.lang.String"><value>10000</value></constructor-arg>
         <constructor-arg index="5" type="java.lang.String"><value>USA</value></constructor-arg>
     </bean>
-    <bean id="addr3" class="org.apache.jdo.tck.pc.company.Address">
+    <bean id="addr3" factory-bean="companyFactory" factory-method="newAddress">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Market St.</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>San Francisco</value></constructor-arg>
@@ -268,77 +268,77 @@
         <constructor-arg index="5" type="java.lang.String"><value>USA</value></constructor-arg>
     </bean>
 
-    <bean id="medicalIns1" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns1" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>PPO</value></constructor-arg>
         <property name="employee"><ref bean="emp1"/></property>
     </bean>
 
-    <bean id="medicalIns2" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns2" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier2</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>HMO</value></constructor-arg>
         <property name="employee"><ref bean="emp2"/></property>
     </bean>
 
-    <bean id="medicalIns3" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns3" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier3</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>HMO</value></constructor-arg>
         <property name="employee"><ref bean="emp3"/></property>
     </bean>
 
-    <bean id="medicalIns4" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns4" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>4</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier4</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>HMO</value></constructor-arg>
         <property name="employee"><ref bean="emp4"/></property>
     </bean>
 
-    <bean id="medicalIns5" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns5" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>5</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier5</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>HMO</value></constructor-arg>
         <property name="employee"><ref bean="emp5"/></property>
     </bean>
 
-    <bean id="dentalIns1" class="org.apache.jdo.tck.pc.company.DentalInsurance">
+    <bean id="dentalIns1" factory-bean="companyFactory" factory-method="newDentalInsurance">
         <constructor-arg index="0" type="long"><value>11</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier1</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>99.999</value></constructor-arg>
         <property name="employee"><ref bean="emp1"/></property>
     </bean>
 
-    <bean id="dentalIns2" class="org.apache.jdo.tck.pc.company.DentalInsurance">
+    <bean id="dentalIns2" factory-bean="companyFactory" factory-method="newDentalInsurance">
         <constructor-arg index="0" type="long"><value>12</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier2</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>99.999</value></constructor-arg>
         <property name="employee"><ref bean="emp2"/></property>
     </bean>
 
-    <bean id="dentalIns3" class="org.apache.jdo.tck.pc.company.DentalInsurance">
+    <bean id="dentalIns3" factory-bean="companyFactory" factory-method="newDentalInsurance">
         <constructor-arg index="0" type="long"><value>13</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier3</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>99.999</value></constructor-arg>
         <property name="employee"><ref bean="emp3"/></property>
     </bean>
 
-    <bean id="dentalIns4" class="org.apache.jdo.tck.pc.company.DentalInsurance">
+    <bean id="dentalIns4" factory-bean="companyFactory" factory-method="newDentalInsurance">
         <constructor-arg index="0" type="long"><value>14</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier4</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>99.999</value></constructor-arg>
         <property name="employee"><ref bean="emp4"/></property>
     </bean>
 
-    <bean id="dentalIns5" class="org.apache.jdo.tck.pc.company.DentalInsurance">
+    <bean id="dentalIns5" factory-bean="companyFactory" factory-method="newDentalInsurance">
         <constructor-arg index="0" type="long"><value>15</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier5</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>99.999</value></constructor-arg>
         <property name="employee"><ref bean="emp5"/></property>
     </bean>
 
-    <bean id="proj1" class="org.apache.jdo.tck.pc.company.Project">
+    <bean id="proj1" factory-bean="companyFactory" factory-method="newProject">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>orange</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>2500000.99</value></constructor-arg>
@@ -350,7 +350,7 @@
             </set>
         </property>
     </bean>
-    <bean id="proj2" class="org.apache.jdo.tck.pc.company.Project">
+    <bean id="proj2" factory-bean="companyFactory" factory-method="newProject">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>blue</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>50000.00</value></constructor-arg>
@@ -367,7 +367,7 @@
             </set>
         </property>
     </bean>
-    <bean id="proj3" class="org.apache.jdo.tck.pc.company.Project">
+    <bean id="proj3" factory-bean="companyFactory" factory-method="newProject">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>green</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>2000.99</value></constructor-arg>
@@ -384,3 +384,4 @@
         </property>
     </bean>
 </beans>
+

Modified: incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyEmbedded.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyEmbedded.xml?rev=279234&r1=279233&r2=279234&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyEmbedded.xml (original)
+++ incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyEmbedded.xml Tue Sep  6 21:00:18 2005
@@ -26,24 +26,24 @@
         </constructor-arg>
     </bean>
 
-    <bean id="company1" class="org.apache.jdo.tck.pc.company.Company">
+    <bean id="company1" factory-bean="companyFactory" factory-method="newCompany">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Sun Microsystems, Inc.</value></constructor-arg>
         <constructor-arg index="2" type="java.util.Date"><value>11/Apr/1952</value></constructor-arg>
         <constructor-arg index="3" type="org.apache.jdo.tck.pc.company.IAddress"><ref local="addr1"/></constructor-arg>
     </bean>
 
-    <bean id="dept1" class="org.apache.jdo.tck.pc.company.Department">
+    <bean id="dept1" factory-bean="companyFactory" factory-method="newDepartment">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String" ><value>Development</value></constructor-arg>
     </bean>
 
-    <bean id="dept2" class="org.apache.jdo.tck.pc.company.Department">
+    <bean id="dept2" factory-bean="companyFactory" factory-method="newDepartment">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String" ><value>Human Resources</value></constructor-arg>
     </bean>
 
-    <bean id="emp1" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp1" factory-bean="companyFactory" factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp1First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp1Last</value></constructor-arg>
@@ -60,7 +60,7 @@
             </map>
 	    </property>
     </bean>
-    <bean id="emp2" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp2" factory-bean="companyFactory" factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp2First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp2Last</value></constructor-arg>
@@ -77,7 +77,7 @@
             </map>
 	    </property>
     </bean>
-    <bean id="emp3" class="org.apache.jdo.tck.pc.company.PartTimeEmployee">
+    <bean id="emp3" factory-bean="companyFactory" factory-method="newPartTimeEmployee">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp3First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp3Last</value></constructor-arg>
@@ -94,7 +94,7 @@
             </map>
 	    </property>
     </bean>
-    <bean id="emp4" class="org.apache.jdo.tck.pc.company.PartTimeEmployee">
+    <bean id="emp4" factory-bean="companyFactory" factory-method="newPartTimeEmployee">
         <constructor-arg index="0" type="long"><value>4</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp4First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp4Last</value></constructor-arg>
@@ -110,7 +110,7 @@
             </map>
 	    </property>
     </bean>
-    <bean id="emp5" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp5" factory-bean="companyFactory" factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>5</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp5First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp5Last</value></constructor-arg>
@@ -127,7 +127,7 @@
 	    </property>
     </bean>
 
-    <bean id="addr1" class="org.apache.jdo.tck.pc.company.Address">
+    <bean id="addr1" factory-bean="companyFactory" factory-method="newAddress">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Unter den Linden 1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>Berlin</value></constructor-arg>
@@ -135,7 +135,7 @@
         <constructor-arg index="4" type="java.lang.String"><value>12345</value></constructor-arg>
         <constructor-arg index="5" type="java.lang.String"><value>Germany</value></constructor-arg>
     </bean>
-    <bean id="addr2" class="org.apache.jdo.tck.pc.company.Address">
+    <bean id="addr2" factory-bean="companyFactory" factory-method="newAddress">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Broadway 1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>New York</value></constructor-arg>
@@ -143,7 +143,7 @@
         <constructor-arg index="4" type="java.lang.String"><value>10000</value></constructor-arg>
         <constructor-arg index="5" type="java.lang.String"><value>USA</value></constructor-arg>
     </bean>
-    <bean id="addr3" class="org.apache.jdo.tck.pc.company.Address">
+    <bean id="addr3" factory-bean="companyFactory" factory-method="newAddress">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Market St.</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>San Francisco</value></constructor-arg>
@@ -152,41 +152,41 @@
         <constructor-arg index="5" type="java.lang.String"><value>USA</value></constructor-arg>
     </bean>
 
-    <bean id="medicalIns1" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns1" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>PPO</value></constructor-arg>
     </bean>
 
-    <bean id="medicalIns2" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns2" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier2</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>HMO</value></constructor-arg>
     </bean>
 
-    <bean id="medicalIns3" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns3" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier2</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>HMO</value></constructor-arg>
     </bean>
 
-    <bean id="dentalIns1" class="org.apache.jdo.tck.pc.company.DentalInsurance">
+    <bean id="dentalIns1" factory-bean="companyFactory" factory-method="newDentalInsurance">
         <constructor-arg index="0" type="long"><value>4</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier2</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>99.999</value></constructor-arg>
     </bean>
 
-    <bean id="proj1" class="org.apache.jdo.tck.pc.company.Project">
+    <bean id="proj1" factory-bean="companyFactory" factory-method="newProject">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>orange</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>2500000.99</value></constructor-arg>
     </bean>
-    <bean id="proj2" class="org.apache.jdo.tck.pc.company.Project">
+    <bean id="proj2" factory-bean="companyFactory" factory-method="newProject">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>blue</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>50000.00</value></constructor-arg>
     </bean>
-    <bean id="proj3" class="org.apache.jdo.tck.pc.company.Project">
+    <bean id="proj3" factory-bean="companyFactory" factory-method="newProject">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>green</value></constructor-arg>
         <constructor-arg index="2" type="java.math.BigDecimal"><value>2000.99</value></constructor-arg>

Modified: incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyForQueryTests.xml
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyForQueryTests.xml?rev=279234&r1=279233&r2=279234&view=diff
==============================================================================
--- incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyForQueryTests.xml (original)
+++ incubator/jdo/trunk/tck20/test/testdata/org/apache/jdo/tck/pc/company/companyForQueryTests.xml Tue Sep  6 21:00:18 2005
@@ -12,7 +12,7 @@
         </constructor-arg>
     </bean>
 
-    <bean id="dept1" class="org.apache.jdo.tck.pc.company.Department">
+    <bean id="dept1" factory-bean="companyFactory" factory-method="newDepartment">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String" ><value>Development</value></constructor-arg>
         <property name="employees">
@@ -24,7 +24,7 @@
         </property>
     </bean>
 
-    <bean id="emp1" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp1" factory-bean="companyFactory" factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp1First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp1Last</value></constructor-arg>
@@ -42,7 +42,7 @@
             </map>
 	</property>
     </bean>
-    <bean id="emp2" class="org.apache.jdo.tck.pc.company.FullTimeEmployee">
+    <bean id="emp2" factory-bean="companyFactory" factory-method="newFullTimeEmployee">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp2First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp2Last</value></constructor-arg>
@@ -59,7 +59,7 @@
             </map>
 	</property>
     </bean>
-    <bean id="emp3" class="org.apache.jdo.tck.pc.company.PartTimeEmployee">
+    <bean id="emp3" factory-bean="companyFactory" factory-method="newPartTimeEmployee">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>emp3First</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>emp3Last</value></constructor-arg>
@@ -77,7 +77,7 @@
 	</property>
     </bean>
 
-    <bean id="addr1" class="org.apache.jdo.tck.pc.company.Address">
+    <bean id="addr1" factory-bean="companyFactory" factory-method="newAddress">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Unter den Linden 1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>Berlin</value></constructor-arg>
@@ -85,7 +85,7 @@
         <constructor-arg index="4" type="java.lang.String"><value>12345</value></constructor-arg>
         <constructor-arg index="5" type="java.lang.String"><value>Germany</value></constructor-arg>
     </bean>
-    <bean id="addr2" class="org.apache.jdo.tck.pc.company.Address">
+    <bean id="addr2" factory-bean="companyFactory" factory-method="newAddress">
         <constructor-arg index="0" type="long"><value>2</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Broadway 1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>New York</value></constructor-arg>
@@ -93,7 +93,7 @@
         <constructor-arg index="4" type="java.lang.String"><value>10000</value></constructor-arg>
         <constructor-arg index="5" type="java.lang.String"><value>USA</value></constructor-arg>
     </bean>
-    <bean id="addr3" class="org.apache.jdo.tck.pc.company.Address">
+    <bean id="addr3" factory-bean="companyFactory" factory-method="newAddress">
         <constructor-arg index="0" type="long"><value>3</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Market St.</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>San Francisco</value></constructor-arg>
@@ -102,7 +102,7 @@
         <constructor-arg index="5" type="java.lang.String"><value>USA</value></constructor-arg>
     </bean>
 
-    <bean id="medicalIns1" class="org.apache.jdo.tck.pc.company.MedicalInsurance">
+    <bean id="medicalIns1" factory-bean="companyFactory" factory-method="newMedicalInsurance">
         <constructor-arg index="0" type="long"><value>1</value></constructor-arg>
         <constructor-arg index="1" type="java.lang.String"><value>Carrier1</value></constructor-arg>
         <constructor-arg index="2" type="java.lang.String"><value>PPO</value></constructor-arg>



Mime
View raw message