diff --git a/README.md b/README.md index bbe2e57ad..3afdd4422 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ While running the TCK, maven uses the following configuration files in src/conf: * test configuration files (*.conf). Each of these files sets values for * jdo.tck.testdescription : An optional string describing the purpose of these tests * jdo.tck.classes : A list of one or more test classes (required) - * jdo.tck.testdata : The fully qualified file name of the xml test data file(optional) + * jdo.tck.testdata : The fully qualified name of the class that creates test data (optional) * jdo.tck.mapping : The file designator that maven.xml uses to build a javax.jdo.option.Mapping value and corresponding schema name (required) * exclude.list : A list of test classes NOT to execute during a TCK test run diff --git a/exectck/pom.xml b/exectck/pom.xml index c59d00b7f..f307799c4 100644 --- a/exectck/pom.xml +++ b/exectck/pom.xml @@ -62,10 +62,6 @@ javax.jdo jdo-api - - org.springframework - spring-beans - org.eclipse.persistence javax.persistence diff --git a/exectck/src/main/java/org/apache/jdo/exectck/Enhance.java b/exectck/src/main/java/org/apache/jdo/exectck/Enhance.java index c7a6bbd73..e5611a6eb 100644 --- a/exectck/src/main/java/org/apache/jdo/exectck/Enhance.java +++ b/exectck/src/main/java/org/apache/jdo/exectck/Enhance.java @@ -137,7 +137,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { } String[] metadataExtensions = {"jdo", "jdoquery", "orm", "xml", "properties"}; - String[] srcDirs = {"jdo", "orm", "testdata"}; + String[] srcDirs = {"jdo", "orm"}; String classesDirName = buildDirectory + File.separator + "classes" + File.separator; // Copy metadata from src to enhanced @@ -209,13 +209,6 @@ private void copyMetadata( File toFile = new File(enhancedDirName + File.separator + pkgName); toFileName = toFile.toString(); FileUtils.copyFile(fromFile, toFile); - } else if (srcDir.equals("testdata")) { - startIdx = fromFileName.indexOf("org" + File.separator); - String pkgName = fromFileName.substring(startIdx); - File toFile = - new File(enhancedDirName + File.separator + idType + File.separator + pkgName); - toFileName = toFile.toString(); - FileUtils.copyFile(fromFile, toFile); } else { // idType not in pathname, do not copy } diff --git a/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java b/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java index 0b5e17320..f3d76e58c 100644 --- a/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java +++ b/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java @@ -103,7 +103,7 @@ public class RunTCK extends AbstractTCKMojo { private String cleanupaftertest; /** JVM properties. */ - @Parameter(property = "jdo.tck.jvmproperties", defaultValue = "-Xmx512m") + @Parameter(property = "jdo.tck.jvmproperties", defaultValue = "-Xmx1g") private String jvmproperties; /** Location of tck log file. */ diff --git a/parent-pom/pom.xml b/parent-pom/pom.xml index 3bf3632db..2b1abc492 100644 --- a/parent-pom/pom.xml +++ b/parent-pom/pom.xml @@ -175,7 +175,6 @@ 2.2.1 10.14.2.0 2.20.0 - 5.3.39 1.3.5 5.0.0 2.12.1 @@ -258,11 +257,6 @@ commons-io ${version.commons-io} - - org.springframework - spring-beans - ${version.spring-beans} - commons-logging commons-logging diff --git a/tck/RunRules.md b/tck/RunRules.md index 46ae879a7..72fd85f41 100644 --- a/tck/RunRules.md +++ b/tck/RunRules.md @@ -91,10 +91,6 @@ files: - `src` - this directory contains the test configuration files and directories: - - `testdata` - this directory contains data (represented as .xml - files) loaded into the datastore for tests. These files must - not be modified. - - `sql` - this directory contains DDL to define the tables used in the tests. The files distributed must not be modified. Files may be created for databases for which the DDL for the diff --git a/tck/pom.xml b/tck/pom.xml index eb8d53f95..e4627adcc 100644 --- a/tck/pom.xml +++ b/tck/pom.xml @@ -68,10 +68,6 @@ javax.transaction javax.transaction-api - - org.springframework - spring-beans - org.eclipse.persistence javax.persistence @@ -92,9 +88,6 @@ ${basedir}/src/main/resources/sql - - ${basedir}/src/main/resources/testdata - ${basedir}/src/main/resources/meta diff --git a/tck/src/main/java/org/apache/jdo/tck/AbstractReaderTest.java b/tck/src/main/java/org/apache/jdo/tck/AbstractReaderTest.java index e58504ad7..23a28eb5b 100644 --- a/tck/src/main/java/org/apache/jdo/tck/AbstractReaderTest.java +++ b/tck/src/main/java/org/apache/jdo/tck/AbstractReaderTest.java @@ -24,7 +24,7 @@ import java.util.Map; import javax.jdo.JDOFatalInternalException; import javax.jdo.LegacyJava; -import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; /* * Abstract class for managed relationship tests @@ -37,8 +37,8 @@ public abstract class AbstractReaderTest extends JDO_Test { /** The name of the root object in the bean collection. */ protected static final String ROOT_NAME = "root"; - /** The name of the file containing the bean collection (test data). */ - protected final String inputFilename = System.getProperty("jdo.tck.testdata"); + /** The name of the class that creates the test data). */ + protected final String inputClassname = System.getProperty("jdo.tck.testdata"); /** The map of String (bean name) to Object (bean). */ protected final Map oidMap = new HashMap<>(); @@ -50,12 +50,12 @@ public abstract class AbstractReaderTest extends JDO_Test { * @param name the name of the bean * @return the named object */ - protected Object getBean(final DefaultListableBeanFactory factory, final String name) { + protected Object getBean(final DefaultListableInstanceFactory factory, final String name) { return doPrivileged(() -> factory.getBean(name)); } protected T getBean( - final DefaultListableBeanFactory factory, Class clazz, final String name) { + final DefaultListableInstanceFactory factory, Class clazz, final String name) { return doPrivileged(() -> factory.getBean(name, clazz)); } @@ -78,7 +78,7 @@ private static T doPrivileged(PrivilegedAction privilegedAction) { * @return the List of objects */ @SuppressWarnings("unchecked") - protected List getRootList(DefaultListableBeanFactory factory) { + protected List getRootList(DefaultListableInstanceFactory factory) { return (List) getBean(factory, ROOT_NAME); } diff --git a/tck/src/main/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentFailsIfInstanceManagedByAnotherPersistenceManager.java b/tck/src/main/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentFailsIfInstanceManagedByAnotherPersistenceManager.java index 21ee3ded3..6e59880d4 100644 --- a/tck/src/main/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentFailsIfInstanceManagedByAnotherPersistenceManager.java +++ b/tck/src/main/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentFailsIfInstanceManagedByAnotherPersistenceManager.java @@ -92,7 +92,7 @@ private void createObjects(PersistenceManager pm) { pcPointArray = new PCPoint[2]; pcPointArray[0] = p4; - pcPointArray[0] = p5; + pcPointArray[1] = p5; tx.commit(); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); @@ -145,7 +145,7 @@ private void runTestDeletePersistentAll2(PersistenceManager pm) { tx.begin(); try { - pm.deletePersistentAll(pcPointArray); + pm.deletePersistentAll((Object[]) pcPointArray); fail( ASSERTION_FAILED, "pm.deletePersistent(Object[]) with pc instance(s) managed by another pm should throw exception"); diff --git a/tck/src/main/java/org/apache/jdo/tck/mapping/AbstractRelationshipTest.java b/tck/src/main/java/org/apache/jdo/tck/mapping/AbstractRelationshipTest.java index e54a964d0..6acd8b403 100644 --- a/tck/src/main/java/org/apache/jdo/tck/mapping/AbstractRelationshipTest.java +++ b/tck/src/main/java/org/apache/jdo/tck/mapping/AbstractRelationshipTest.java @@ -44,7 +44,7 @@ protected void localSetUp() { if (isTestToBePerformed()) { getPM(); CompanyFactoryRegistry.registerFactory(pm); - reader = new CompanyModelReader(inputFilename); + reader = new CompanyModelReader(inputClassname); addTearDownClass(reader.getTearDownClassesFromFactory()); // persist test data pm.currentTransaction().begin(); diff --git a/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTest.java b/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTest.java index 6e32e391b..56e89e91d 100644 --- a/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTest.java +++ b/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTest.java @@ -45,7 +45,7 @@ protected void localSetUp() { if (isTestToBePerformed()) { getPM(); CompanyFactoryRegistry.registerFactory(pm); - CompanyModelReader reader = new CompanyModelReader(inputFilename); + CompanyModelReader reader = new CompanyModelReader(inputClassname); addTearDownClass(reader.getTearDownClassesFromFactory()); // persist test data pm.currentTransaction().begin(); @@ -67,7 +67,7 @@ public void test() { // register the default factory CompanyFactoryRegistry.registerFactory(); // get new obj graph to compare persistent graph with - CompanyModelReader reader = new CompanyModelReader(inputFilename); + CompanyModelReader reader = new CompanyModelReader(inputClassname); List rootList = getRootList(reader); getPM(); diff --git a/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestJPA.java b/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestJPA.java index 8c157b07b..0126834a8 100644 --- a/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestJPA.java +++ b/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestJPA.java @@ -48,7 +48,7 @@ protected void localSetUp() { if (runsWithApplicationIdentity()) { getPM(); CompanyFactoryRegistry.registerFactory(pm); - CompanyModelReader reader = new CompanyModelReader(inputFilename); + CompanyModelReader reader = new CompanyModelReader(inputClassname); addTearDownClass(reader.getTearDownClassesFromFactory()); // persist test data pm.currentTransaction().begin(); @@ -70,7 +70,7 @@ public void test() { // register the default factory CompanyFactoryRegistry.registerFactory(); // get new obj graph to compare persistent graph with - CompanyModelReader reader = new CompanyModelReader(inputFilename); + CompanyModelReader reader = new CompanyModelReader(inputClassname); List rootList = getRootList(reader); getPM(); diff --git a/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestList.java b/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestList.java index 942fdddb7..ae020406e 100644 --- a/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestList.java +++ b/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestList.java @@ -48,7 +48,7 @@ protected void localSetUp() { if (isTestToBePerformed) { getPM(); CompanyFactoryRegistry.registerFactory(pm); - CompanyModelReader reader = new CompanyModelReader(inputFilename); + CompanyModelReader reader = new CompanyModelReader(inputClassname); addTearDownClass(reader.getTearDownClassesFromFactory()); // persist test data pm.currentTransaction().begin(); @@ -70,7 +70,7 @@ public void test() { // register the default factory CompanyFactoryRegistry.registerFactory(); // get new obj graph to compare persistent graph with - CompanyModelReader reader = new CompanyModelReader(inputFilename); + CompanyModelReader reader = new CompanyModelReader(inputClassname); List rootList = getRootList(reader); getPM(); diff --git a/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestMap.java b/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestMap.java index c32ed40a8..99890a975 100644 --- a/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestMap.java +++ b/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestMap.java @@ -48,7 +48,7 @@ protected void localSetUp() { if (isTestToBePerformed) { getPM(); CompanyFactoryRegistry.registerFactory(pm); - CompanyModelReader reader = new CompanyModelReader(inputFilename); + CompanyModelReader reader = new CompanyModelReader(inputClassname); addTearDownClass(reader.getTearDownClassesFromFactory()); // persist test data pm.currentTransaction().begin(); @@ -70,7 +70,7 @@ public void test() { // register the default factory CompanyFactoryRegistry.registerFactory(); // get new obj graph to compare persistent graph with - CompanyModelReader reader = new CompanyModelReader(inputFilename); + CompanyModelReader reader = new CompanyModelReader(inputClassname); List rootList = getRootList(reader); getPM(); diff --git a/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestOrder.java b/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestOrder.java index 0e4682753..bfb5ae527 100644 --- a/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestOrder.java +++ b/tck/src/main/java/org/apache/jdo/tck/mapping/CompletenessTestOrder.java @@ -48,7 +48,7 @@ protected void localSetUp() { if (runsWithApplicationIdentity()) { getPM(); OrderFactoryRegistry.registerFactory(pm); - OrderModelReader reader = new OrderModelReader(inputFilename); + OrderModelReader reader = new OrderModelReader(inputClassname); addTearDownClass(reader.getTearDownClassesFromFactory()); // persist test data pm.currentTransaction().begin(); @@ -70,7 +70,7 @@ public void test() { // register the default factory OrderFactoryRegistry.registerFactory(); // get new obj graph to compare persistent graph with - OrderModelReader reader = new OrderModelReader(inputFilename); + OrderModelReader reader = new OrderModelReader(inputClassname); List rootList = getRootList(reader); getPM(); diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java b/tck/src/main/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java index 04d7dab6b..7c978aff1 100644 --- a/tck/src/main/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java +++ b/tck/src/main/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java @@ -18,34 +18,20 @@ package org.apache.jdo.tck.pc.company; import java.util.Date; -import java.util.List; import java.util.Locale; import org.apache.jdo.tck.util.ConversionHelper; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; import org.apache.jdo.tck.util.JDOCustomDateEditor; -import org.springframework.beans.factory.support.DefaultListableBeanFactory; -import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; -import org.springframework.core.io.ClassPathResource; /** * Utility class to create a graph of company model instances from an xml representation. * * @author Michael Bouschen */ -public class CompanyModelReader extends DefaultListableBeanFactory { - - private static final long serialVersionUID = 1L; - - /** 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"; +public class CompanyModelReader extends DefaultListableInstanceFactory { /** The company factory instance. */ - private CompanyFactory companyFactory; - - /** Bean definition reader */ - private final XmlBeanDefinitionReader reader; + private final CompanyFactory companyFactory; /** * Create a CompanyModelReader for the specified resourceName. @@ -53,42 +39,8 @@ public class CompanyModelReader extends DefaultListableBeanFactory { * @param resourceName the name of the resource */ public CompanyModelReader(String resourceName) { - // Use the class loader of the Company class to find the resource - this(resourceName, Company.class.getClassLoader()); - } - - /** - * Create a CompanyModelReader for the specified resourceName. - * - * @param resourceName the name of the resource - * @param classLoader the ClassLoader for the lookup - */ - public CompanyModelReader(String resourceName, ClassLoader classLoader) { - super(); - configureFactory(); - this.reader = new XmlBeanDefinitionReader(this); - this.reader.loadBeanDefinitions(new ClassPathResource(resourceName, classLoader)); - } - - /** - * 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 - */ - @SuppressWarnings("unchecked") - public List getRootList() { - return (List) getBean(ROOT_LIST_NAME); - } - - /** - * Configure the CompanyModelReader, e.g. register CustomEditor classes to convert the string - * representation of a property into an instance of the right type. - */ - private void configureFactory() { - registerCustomEditor(Date.class, JDOCustomDateEditor.class); companyFactory = CompanyFactoryRegistry.getInstance(); - addSingleton(BEAN_FACTORY_NAME, companyFactory); + getDataSource(resourceName).init(companyFactory, this); } /** diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/company/data/CompanyDataSource.java b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/CompanyDataSource.java new file mode 100644 index 000000000..9c4239cec --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/CompanyDataSource.java @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.data; + +import org.apache.jdo.tck.pc.company.CompanyFactory; +import org.apache.jdo.tck.util.DataSource; + +public interface CompanyDataSource extends DataSource {} diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/company/data/EmbeddedTestData.java b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/EmbeddedTestData.java new file mode 100644 index 000000000..478e3bedd --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/EmbeddedTestData.java @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.data; + +import static org.apache.jdo.tck.util.DataSourceUtil.date; +import static org.apache.jdo.tck.util.DataSourceUtil.toMap; +import static org.apache.jdo.tck.util.DataSourceUtil.toSet; + +import java.math.BigDecimal; +import org.apache.jdo.tck.pc.company.CompanyFactory; +import org.apache.jdo.tck.pc.company.IAddress; +import org.apache.jdo.tck.pc.company.ICompany; +import org.apache.jdo.tck.pc.company.IDentalInsurance; +import org.apache.jdo.tck.pc.company.IDepartment; +import org.apache.jdo.tck.pc.company.IFullTimeEmployee; +import org.apache.jdo.tck.pc.company.IMedicalInsurance; +import org.apache.jdo.tck.pc.company.IPartTimeEmployee; +import org.apache.jdo.tck.pc.company.IProject; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; + +public class EmbeddedTestData implements CompanyDataSource { + + @Override + public void init(CompanyFactory factory, DefaultListableInstanceFactory registry) { + IAddress addr1 = + factory.newAddress(1, "Unter den Linden 1", "Berlin", " ", "12345", "Germany"); + IAddress addr2 = factory.newAddress(2, "Broadway 1", "New York", "NY", "10000", "USA"); + IAddress addr3 = factory.newAddress(3, "Market St.", "San Francisco", "CA", "94102", "USA"); + + // Insurance constructors + IMedicalInsurance medicalIns1 = factory.newMedicalInsurance(1, "Carrier1", "PPO"); + IMedicalInsurance medicalIns2 = factory.newMedicalInsurance(2, "Carrier2", "HMO"); + IMedicalInsurance medicalIns3 = factory.newMedicalInsurance(3, "Carrier3", "HMO"); + IDentalInsurance dentalIns1 = + factory.newDentalInsurance(4, "Carrier2", BigDecimal.valueOf(99.999)); + + // Project constructors + IProject proj1 = factory.newProject(1, "orange", BigDecimal.valueOf(2500000.99)); + IProject proj2 = factory.newProject(2, "blue", BigDecimal.valueOf(50000.00)); + IProject proj3 = factory.newProject(3, "green", BigDecimal.valueOf(2000.99)); + + // Company constructor + ICompany company1 = factory.newCompany(1L, "Sun Microsystems, Inc.", date(1952, 4, 11), addr1); + + // Meeting room constructors + + // Department Constructors + IDepartment dept1 = factory.newDepartment(1, "Development", company1); + IDepartment dept2 = factory.newDepartment(2, "Human Resources", company1); + company1.setDepartments(toSet(dept1, dept2)); + + // Employee Constructors + IFullTimeEmployee emp1 = + factory.newFullTimeEmployee( + 1, "emp1First", "emp1Last", "emp1Middle", null, addr1, null, 20000); + emp1.setBirthdate(date(1970, 6, 10)); + emp1.setHiredate(date(1999, 1, 1)); + IFullTimeEmployee emp2 = + factory.newFullTimeEmployee( + 2, "emp2First", "emp2Last", "emp2Middle", null, addr2, null, 10000); + emp2.setBirthdate(date(1975, 12, 22)); + emp2.setHiredate(date(2003, 7, 1)); + IPartTimeEmployee emp3 = + factory.newPartTimeEmployee( + 3, "emp3First", "emp3Last", "emp3Middle", null, addr3, null, 15); + emp3.setBirthdate(date(1972, 7, 5)); + emp3.setHiredate(date(2002, 8, 15)); + IPartTimeEmployee emp4 = + factory.newPartTimeEmployee( + 4, "emp4First", "emp4Last", "emp4Middle", null, addr3, null, 13); + emp4.setBirthdate(date(1973, 7, 6)); + emp4.setHiredate(date(2001, 4, 15)); + IFullTimeEmployee emp5 = + factory.newFullTimeEmployee( + 5, "emp5First", "emp5Last", "emp5Middle", null, addr3, null, 45000); + emp5.setBirthdate(date(1962, 7, 5)); + emp5.setHiredate(date(1998, 8, 15)); + + // Employee properties + emp1.setWeeklyhours(40); + emp1.setPhoneNumbers(toMap("home", "1111", "work", "123456-1")); + + emp2.setWeeklyhours(40); + emp2.setPhoneNumbers(toMap("home", "2222", "work", "123456-2")); + + emp3.setWeeklyhours(19); + emp3.setPhoneNumbers(toMap("home", "3333", "work", "123456-3")); + + emp4.setPhoneNumbers(toMap("home", "3343", "work", "124456-3")); + + emp5.setPhoneNumbers(toMap("home", "3363", "work", "126456-3")); + + // Department properties + + // Insurance properties + + // Project properties + + // root objects + registry.register("company1", company1); + registry.register("dept1", dept1); + registry.register("dept2", dept2); + registry.register("emp1", emp1); + registry.register("emp2", emp2); + registry.register("emp3", emp3); + registry.register("emp4", emp4); + registry.register("emp5", emp5); + registry.register("medicalIns1", medicalIns1); + registry.register("medicalIns2", medicalIns2); + registry.register("medicalIns3", medicalIns3); + registry.register("dentalIns1", dentalIns1); + registry.register("proj1", proj1); + registry.register("proj2", proj2); + registry.register("proj3", proj3); + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/company/data/NavigationTestData.java b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/NavigationTestData.java new file mode 100644 index 000000000..1c7bbf3f0 --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/NavigationTestData.java @@ -0,0 +1,307 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.data; + +import static org.apache.jdo.tck.util.DataSourceUtil.date; +import static org.apache.jdo.tck.util.DataSourceUtil.toMap; +import static org.apache.jdo.tck.util.DataSourceUtil.toSet; + +import java.math.BigDecimal; +import org.apache.jdo.tck.pc.company.CompanyFactory; +import org.apache.jdo.tck.pc.company.IAddress; +import org.apache.jdo.tck.pc.company.ICompany; +import org.apache.jdo.tck.pc.company.IDentalInsurance; +import org.apache.jdo.tck.pc.company.IDepartment; +import org.apache.jdo.tck.pc.company.IFullTimeEmployee; +import org.apache.jdo.tck.pc.company.IMedicalInsurance; +import org.apache.jdo.tck.pc.company.IMeetingRoom; +import org.apache.jdo.tck.pc.company.IPartTimeEmployee; +import org.apache.jdo.tck.pc.company.IProject; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; + +public class NavigationTestData implements CompanyDataSource { + + @Override + public void init(CompanyFactory factory, DefaultListableInstanceFactory registry) { + IAddress addr1 = + factory.newAddress(1, "Unter den Linden 1", "Berlin", " ", "12345", "Germany"); + IAddress addr2 = factory.newAddress(2, "Broadway 1", "New York", "NY", "10000", "USA"); + IAddress addr3 = factory.newAddress(3, "Market St.", "San Francisco", "CA", "94102", "USA"); + + // Insurance constructors + IMedicalInsurance medicalIns1 = factory.newMedicalInsurance(1, "Carrier1", "PPO"); + IMedicalInsurance medicalIns2 = factory.newMedicalInsurance(2, "Carrier2", "HMO"); + IMedicalInsurance medicalIns3 = factory.newMedicalInsurance(3, "Carrier3", "HMO"); + IMedicalInsurance medicalIns4 = factory.newMedicalInsurance(4, "Carrier4", "HMO"); + IMedicalInsurance medicalIns5 = factory.newMedicalInsurance(5, "Carrier5", "HMO"); + IMedicalInsurance medicalIns98 = factory.newMedicalInsurance(98, "Carrier98", "HMO"); + IDentalInsurance dentalIns1 = + factory.newDentalInsurance(11, "Carrier1", BigDecimal.valueOf(99.995)); + IDentalInsurance dentalIns2 = + factory.newDentalInsurance(12, "Carrier2", BigDecimal.valueOf(99.996)); + IDentalInsurance dentalIns3 = + factory.newDentalInsurance(13, "Carrier3", BigDecimal.valueOf(99.997)); + IDentalInsurance dentalIns4 = + factory.newDentalInsurance(14, "Carrier4", BigDecimal.valueOf(99.998)); + IDentalInsurance dentalIns5 = + factory.newDentalInsurance(15, "Carrier5", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns99 = factory.newDentalInsurance(99, "Carrier99", null); + + // Project constructors + IProject proj1 = factory.newProject(1, "orange", BigDecimal.valueOf(2500000.99)); + IProject proj2 = factory.newProject(2, "blue", BigDecimal.valueOf(50000.00)); + IProject proj3 = factory.newProject(3, "green", BigDecimal.valueOf(2000.99)); + + // Company constructor + ICompany company1 = factory.newCompany(1L, "Sun Microsystems, Inc.", date(1952, 4, 11), addr1); + + // Meeting room constructors + IMeetingRoom room1 = factory.newMeetingRoom(1, "Comfy Room"); + IMeetingRoom room2 = factory.newMeetingRoom(2, "Large Discussion Room"); + IMeetingRoom room3 = factory.newMeetingRoom(3, "Conference Room"); + + // Department Constructors + IDepartment dept1 = factory.newDepartment(1, "Development", company1); + IDepartment dept2 = factory.newDepartment(2, "Human Resources", company1); + company1.setDepartments(toSet(dept1, dept2)); + + // Employee Constructors + IFullTimeEmployee emp0 = + factory.newFullTimeEmployee( + 0, "emp0First", "emp0Last", "emp0Middle", null, addr1, null, 50000); + emp0.setBirthdate(date(1962, 7, 10)); + emp0.setHiredate(date(1997, 1, 1)); + IFullTimeEmployee emp1 = + factory.newFullTimeEmployee( + 1, "emp1First", "emp1Last", "emp1Middle", null, addr1, null, 20000); + emp1.setBirthdate(date(1970, 6, 10)); + emp1.setHiredate(date(1999, 1, 1)); + IFullTimeEmployee emp2 = + factory.newFullTimeEmployee( + 2, "emp2First", "emp2Last", "emp2Middle", null, addr2, null, 10000); + emp2.setBirthdate(date(1975, 12, 22)); + emp2.setHiredate(date(2003, 7, 1)); + IPartTimeEmployee emp3 = + factory.newPartTimeEmployee( + 3, "emp3First", "emp3Last", "emp3Middle", null, addr3, null, 15); + emp3.setBirthdate(date(1972, 7, 5)); + emp3.setHiredate(date(2002, 8, 15)); + IPartTimeEmployee emp4 = + factory.newPartTimeEmployee( + 4, "emp4First", "emp4Last", "emp4Middle", null, addr3, null, 25000); + emp4.setBirthdate(date(1973, 7, 6)); + emp4.setHiredate(date(2001, 4, 15)); + IFullTimeEmployee emp5 = + factory.newFullTimeEmployee( + 5, "emp5First", "emp5Last", "emp5Middle", null, addr3, null, 18000); + emp5.setBirthdate(date(1962, 7, 5)); + emp5.setHiredate(date(2002, 11, 1)); + IFullTimeEmployee emp6 = + factory.newFullTimeEmployee( + 6, "emp6First", "emp6Last", "emp6Middle", null, addr3, null, 22000); + emp6.setBirthdate(date(1969, 6, 10)); + emp6.setHiredate(date(2002, 6, 1)); + IFullTimeEmployee emp7 = + factory.newFullTimeEmployee( + 7, "emp7First", "emp7Last", "emp7Middle", null, addr1, null, 40000); + emp7.setBirthdate(date(1970, 6, 10)); + emp7.setHiredate(date(2000, 1, 1)); + IFullTimeEmployee emp8 = + factory.newFullTimeEmployee( + 8, "emp8First", "emp8Last", "emp8Middle", null, addr2, null, 10000); + emp8.setBirthdate(date(1975, 12, 22)); + emp8.setHiredate(date(2003, 8, 1)); + IFullTimeEmployee emp9 = + factory.newFullTimeEmployee( + 9, "emp9First", "emp9Last", "emp9Middle", null, addr3, null, 12000); + emp9.setBirthdate(date(1972, 7, 5)); + emp9.setHiredate(date(2002, 5, 1)); + IFullTimeEmployee emp10 = + factory.newFullTimeEmployee( + 10, "emp10First", "emp10Last", "emp10Middle", null, addr3, null, 24000); + emp10.setBirthdate(date(1972, 7, 5)); + emp10.setHiredate(date(2002, 10, 1)); + + // Employee properties + emp0.setWeeklyhours(40); + emp0.setMedicalInsurance(null); + emp0.setDentalInsurance(null); + emp0.setPhoneNumbers(toMap("home", "3232", "work", "223311-1")); + emp0.setDepartment(dept1); + emp0.setFundingDept(dept2); + emp0.setManager(null); + emp0.setTeam(toSet(emp1)); + emp0.setMentor(null); + emp0.setProtege(null); + emp0.setHradvisor(emp5); + emp0.setReviewedProjects(toSet(proj3)); + emp0.setProjects(toSet(proj1)); + + emp1.setWeeklyhours(40); + emp1.setMedicalInsurance(medicalIns1); + emp1.setDentalInsurance(dentalIns1); + emp1.setPhoneNumbers(toMap("home", "1111", "work", "123456-1")); + emp1.setDepartment(dept1); + emp1.setFundingDept(dept2); + emp1.setManager(emp2); + emp1.setTeam(toSet(emp2, emp3, emp10)); + emp1.setMentor(emp2); + emp1.setProtege(emp5); + emp1.setHradvisor(emp5); + emp1.setReviewedProjects(toSet(proj3)); + emp1.setProjects(toSet(proj1)); + + emp2.setWeeklyhours(40); + emp2.setMedicalInsurance(medicalIns2); + emp2.setDentalInsurance(dentalIns2); + emp2.setPhoneNumbers(toMap("home", "2222", "work", "123456-2")); + emp2.setDepartment(dept1); + emp2.setFundingDept(dept1); + emp2.setMentor(emp3); + emp2.setProtege(emp1); + emp2.setHradvisor(emp5); + emp2.setProjects(toSet(proj1, proj2)); + + emp3.setWeeklyhours(19); + emp3.setMedicalInsurance(medicalIns3); + emp3.setDentalInsurance(dentalIns3); + emp3.setPhoneNumbers(toMap("home", "3333", "work", "123456-3")); + emp3.setDepartment(dept1); + emp3.setFundingDept(dept1); + emp3.setManager(emp1); + emp3.setTeam(toSet()); + emp3.setMentor(emp4); + emp3.setProtege(emp2); + emp3.setHradvisor(emp5); + emp3.setProjects(toSet(proj1, proj2)); + + emp4.setWeeklyhours(40); + emp4.setMedicalInsurance(medicalIns4); + emp4.setDentalInsurance(dentalIns4); + emp4.setPhoneNumbers(toMap("home", "3343", "work", "124456-3")); + emp4.setDepartment(dept1); + emp4.setFundingDept(dept2); + emp4.setManager(null); + emp4.setTeam(toSet(emp5, emp6)); + emp4.setMentor(emp5); + emp4.setProtege(emp3); + emp4.setHradvisor(emp5); + emp4.setProjects(toSet(proj3)); + emp4.setReviewedProjects(toSet(proj2)); + + emp5.setWeeklyhours(35); + emp5.setMedicalInsurance(medicalIns5); + emp5.setDentalInsurance(dentalIns5); + emp5.setPhoneNumbers(toMap("home", "3363", "work", "126456-3")); + emp5.setDepartment(dept1); + emp5.setFundingDept(dept2); + emp5.setManager(emp4); + emp5.setTeam(toSet()); + emp5.setMentor(emp1); + emp5.setProtege(emp4); + emp5.setProjects(toSet(proj3)); + emp5.setReviewedProjects(toSet(proj2)); + emp5.setHradvisees(toSet(emp1, emp2, emp3, emp4)); + + emp6.setWeeklyhours(60); + emp6.setDepartment(dept1); + emp6.setManager(emp4); + emp6.setTeam(toSet()); + + emp7.setWeeklyhours(40); + emp7.setDepartment(dept2); + emp7.setManager(null); + emp7.setTeam(toSet(emp8, emp9)); + + emp8.setWeeklyhours(15); + emp8.setDepartment(dept2); + emp8.setManager(emp7); + emp8.setTeam(toSet()); + + emp9.setWeeklyhours(20); + emp9.setDepartment(dept2); + emp9.setManager(emp7); + emp9.setTeam(toSet()); + + emp10.setWeeklyhours(40); + emp10.setDepartment(dept2); + emp10.setManager(emp1); + emp10.setTeam(toSet()); + + // Department properties + dept1.setEmployees(toSet(emp1, emp2, emp3, emp4, emp5, emp6)); + + dept2.setEmployees(toSet(emp7, emp8, emp9, emp10)); + + // Insurance properties + medicalIns1.setEmployee(emp1); + medicalIns2.setEmployee(emp2); + medicalIns3.setEmployee(emp3); + medicalIns4.setEmployee(emp4); + medicalIns5.setEmployee(emp5); + medicalIns98.setEmployee(null); + dentalIns1.setEmployee(emp1); + dentalIns2.setEmployee(emp2); + dentalIns3.setEmployee(emp3); + dentalIns4.setEmployee(emp4); + dentalIns5.setEmployee(emp5); + dentalIns99.setEmployee(null); + + // Project properties + proj1.setMembers(toSet(emp1, emp2, emp3)); + proj2.setReviewers(toSet(emp4, emp5)); + proj2.setMembers(toSet(emp2, emp3)); + proj3.setReviewers(toSet(emp1)); + proj3.setMembers(toSet(emp4, emp5)); + + // root objects + registry.register("company1", company1); + registry.register("medicalIns98", medicalIns98); + registry.register("dentalIns99", dentalIns99); + + registry.register("dept1", dept1); + registry.register("dept2", dept2); + registry.register("emp0", emp0); + registry.register("emp1", emp1); + registry.register("emp2", emp2); + registry.register("emp3", emp3); + registry.register("emp4", emp4); + registry.register("emp5", emp5); + registry.register("emp6", emp6); + registry.register("emp7", emp7); + registry.register("emp8", emp8); + registry.register("emp9", emp9); + registry.register("emp10", emp10); + registry.register("proj1", proj1); + registry.register("proj2", proj2); + registry.register("proj3", proj3); + registry.register("dentalIns1", dentalIns1); + registry.register("dentalIns2", dentalIns2); + registry.register("dentalIns3", dentalIns3); + registry.register("dentalIns4", dentalIns4); + registry.register("dentalIns5", dentalIns5); + registry.register("medicalIns1", medicalIns1); + registry.register("medicalIns2", medicalIns2); + registry.register("medicalIns3", medicalIns3); + registry.register("medicalIns4", medicalIns4); + registry.register("medicalIns5", medicalIns5); + registry.register("room1", room1); + registry.register("room2", room2); + registry.register("room3", room3); + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/company/data/QueryTestData.java b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/QueryTestData.java new file mode 100644 index 000000000..be8e7a587 --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/QueryTestData.java @@ -0,0 +1,227 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.data; + +import static org.apache.jdo.tck.util.DataSourceUtil.date; +import static org.apache.jdo.tck.util.DataSourceUtil.toList; +import static org.apache.jdo.tck.util.DataSourceUtil.toMap; +import static org.apache.jdo.tck.util.DataSourceUtil.toSet; + +import java.math.BigDecimal; +import org.apache.jdo.tck.pc.company.CompanyFactory; +import org.apache.jdo.tck.pc.company.IAddress; +import org.apache.jdo.tck.pc.company.ICompany; +import org.apache.jdo.tck.pc.company.IDentalInsurance; +import org.apache.jdo.tck.pc.company.IDepartment; +import org.apache.jdo.tck.pc.company.IFullTimeEmployee; +import org.apache.jdo.tck.pc.company.IMedicalInsurance; +import org.apache.jdo.tck.pc.company.IMeetingRoom; +import org.apache.jdo.tck.pc.company.IPartTimeEmployee; +import org.apache.jdo.tck.pc.company.IProject; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; + +public class QueryTestData implements CompanyDataSource { + + @Override + public void init(CompanyFactory factory, DefaultListableInstanceFactory registry) { + IAddress addr1 = + factory.newAddress(1, "Unter den Linden 1", "Berlin", " ", "12345", "Germany"); + IAddress addr2 = factory.newAddress(2, "Broadway 1", "New York", "NY", "10000", "USA"); + IAddress addr3 = factory.newAddress(3, "Market St.", "San Francisco", "CA", "94102", "USA"); + + // Insurance constructors + IMedicalInsurance medicalIns1 = factory.newMedicalInsurance(1, "Carrier1", "PPO"); + IMedicalInsurance medicalIns2 = factory.newMedicalInsurance(2, "Carrier2", "HMO"); + IMedicalInsurance medicalIns3 = factory.newMedicalInsurance(3, "Carrier3", "HMO"); + IMedicalInsurance medicalIns4 = factory.newMedicalInsurance(4, "Carrier4", "HMO"); + IMedicalInsurance medicalIns5 = factory.newMedicalInsurance(5, "Carrier5", "HMO"); + IDentalInsurance dentalIns1 = + factory.newDentalInsurance(11, "Carrier1", BigDecimal.valueOf(99.995)); + IDentalInsurance dentalIns2 = + factory.newDentalInsurance(12, "Carrier2", BigDecimal.valueOf(99.996)); + IDentalInsurance dentalIns3 = + factory.newDentalInsurance(13, "Carrier3", BigDecimal.valueOf(99.997)); + IDentalInsurance dentalIns4 = + factory.newDentalInsurance(14, "Carrier4", BigDecimal.valueOf(99.998)); + IDentalInsurance dentalIns5 = + factory.newDentalInsurance(15, "Carrier5", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns99 = factory.newDentalInsurance(99, "Carrier99", null); + + // Project constructors + IProject proj1 = factory.newProject(1, "orange", BigDecimal.valueOf(2500000.99)); + IProject proj2 = factory.newProject(2, "blue", BigDecimal.valueOf(50000.00)); + IProject proj3 = factory.newProject(3, "green", BigDecimal.valueOf(2000.99)); + + // Company constructor + ICompany company1 = factory.newCompany(1L, "Sun Microsystems, Inc.", date(1952, 4, 11), addr1); + + // Meeting room constructors + IMeetingRoom room1 = factory.newMeetingRoom(1, "Comfy Room"); + IMeetingRoom room2 = factory.newMeetingRoom(2, "Large Discussion Room"); + IMeetingRoom room3 = factory.newMeetingRoom(3, "Conference Room"); + + // Department Constructors + IDepartment dept1 = factory.newDepartment(1, "Development", company1); + IDepartment dept2 = factory.newDepartment(2, "Human Resources", company1); + company1.setDepartments(toSet(dept1, dept2)); + + // Employee Constructors + IFullTimeEmployee emp1 = + factory.newFullTimeEmployee( + 1, "emp1First", "emp1Last", "emp1Middle", null, addr1, null, 20000); + emp1.setBirthdate(date(1970, 6, 10)); + emp1.setHiredate(date(1999, 1, 1)); + IFullTimeEmployee emp2 = + factory.newFullTimeEmployee( + 2, "emp2First", "emp2Last", "emp2Middle", null, addr2, null, 10000); + emp2.setBirthdate(date(1975, 12, 22)); + emp2.setHiredate(date(2003, 7, 1)); + IPartTimeEmployee emp3 = + factory.newPartTimeEmployee( + 3, "emp3First", "emp3Last", "emp3Middle", null, addr3, null, 15); + emp3.setBirthdate(date(1972, 7, 5)); + emp3.setHiredate(date(2002, 8, 15)); + IPartTimeEmployee emp4 = + factory.newPartTimeEmployee( + 4, "emp4First", "emp4Last", "emp4Middle", null, addr3, null, 13); + emp4.setBirthdate(date(1973, 7, 6)); + emp4.setHiredate(date(2001, 4, 15)); + IFullTimeEmployee emp5 = + factory.newFullTimeEmployee( + 5, "emp5First", "emp5Last", "emp5Middle", null, addr3, null, 45000); + emp5.setBirthdate(date(1962, 7, 5)); + emp5.setHiredate(date(1998, 8, 15)); + + // Employee properties + emp1.setWeeklyhours(40); + emp1.setMedicalInsurance(medicalIns1); + emp1.setDentalInsurance(dentalIns1); + emp1.setPhoneNumbers(toMap("home", "1111", "work", "123456-1")); + emp1.setDepartment(dept1); + emp1.setFundingDept(dept2); + emp1.setManager(emp2); + emp1.setMentor(emp2); + emp1.setProtege(emp5); + emp1.setHradvisor(emp5); + emp1.setReviewedProjects(toSet(proj3)); + emp1.setProjects(toSet(proj1)); + + emp2.setWeeklyhours(40); + emp2.setMedicalInsurance(medicalIns2); + emp2.setDentalInsurance(dentalIns2); + emp2.setPhoneNumbers(toMap("home", "2222", "work", "123456-2")); + emp2.setDepartment(dept1); + emp2.setFundingDept(dept1); + emp2.setMentor(emp3); + emp2.setProtege(emp1); + emp2.setHradvisor(emp5); + emp2.setProjects(toSet(proj1, proj2)); + emp2.setTeam(toSet(emp1, emp3, emp4, emp5)); + + emp3.setWeeklyhours(19); + emp3.setMedicalInsurance(medicalIns3); + emp3.setDentalInsurance(dentalIns3); + emp3.setPhoneNumbers(toMap("home", "3333", "work", "123456-3")); + emp3.setDepartment(dept1); + emp3.setFundingDept(dept1); + emp3.setManager(emp2); + emp3.setMentor(emp4); + emp3.setProtege(emp2); + emp3.setHradvisor(emp5); + emp3.setProjects(toSet(proj1, proj2)); + + emp4.setMedicalInsurance(medicalIns4); + emp4.setDentalInsurance(dentalIns4); + emp4.setPhoneNumbers(toMap("home", "3343", "work", "124456-3")); + emp4.setDepartment(dept2); + emp4.setFundingDept(dept2); + emp4.setManager(emp2); + emp4.setMentor(emp5); + emp4.setProtege(emp3); + emp4.setHradvisor(emp5); + emp4.setProjects(toSet(proj3)); + emp4.setReviewedProjects(toSet(proj2)); + + emp5.setMedicalInsurance(medicalIns5); + emp5.setDentalInsurance(dentalIns5); + emp5.setPhoneNumbers(toMap("home", "3363", "work", "126456-3")); + emp5.setDepartment(dept2); + emp5.setFundingDept(dept2); + emp5.setManager(emp2); + emp5.setMentor(emp1); + emp5.setProtege(emp4); + emp5.setProjects(toSet(proj3)); + emp5.setReviewedProjects(toSet(proj2)); + emp5.setHradvisees(toSet(emp1, emp2, emp3, emp4)); + + // Department properties + dept1.setEmployees(toSet(emp1, emp2, emp3)); + dept1.setFundedEmps(toSet(emp2, emp3)); + dept1.setMeetingRooms(toList(room1, room2, room3)); + + dept2.setEmployees(toSet(emp4, emp5)); + dept2.setFundedEmps(toSet(emp1, emp4, emp5)); + dept2.setMeetingRooms(toList()); + + // Insurance properties + medicalIns1.setEmployee(emp1); + medicalIns2.setEmployee(emp2); + medicalIns3.setEmployee(emp3); + medicalIns4.setEmployee(emp4); + medicalIns5.setEmployee(emp5); + dentalIns1.setEmployee(emp1); + dentalIns2.setEmployee(emp2); + dentalIns3.setEmployee(emp3); + dentalIns4.setEmployee(emp4); + dentalIns5.setEmployee(emp5); + + // Project properties + proj1.setMembers(toSet(emp1, emp2, emp3)); + proj2.setReviewers(toSet(emp4, emp5)); + proj2.setMembers(toSet(emp2, emp3)); + proj3.setReviewers(toSet(emp1)); + proj3.setMembers(toSet(emp4, emp5)); + + // root objects + registry.register("company1", company1); + registry.register("dentalIns99", dentalIns99); + + registry.register("dept1", dept1); + registry.register("dept2", dept2); + registry.register("emp1", emp1); + registry.register("emp2", emp2); + registry.register("emp3", emp3); + registry.register("emp4", emp4); + registry.register("emp5", emp5); + registry.register("proj1", proj1); + registry.register("proj2", proj2); + registry.register("proj3", proj3); + registry.register("dentalIns1", dentalIns1); + registry.register("dentalIns2", dentalIns2); + registry.register("dentalIns3", dentalIns3); + registry.register("dentalIns4", dentalIns4); + registry.register("dentalIns5", dentalIns5); + registry.register("medicalIns1", medicalIns1); + registry.register("medicalIns2", medicalIns2); + registry.register("medicalIns3", medicalIns3); + registry.register("medicalIns4", medicalIns4); + registry.register("medicalIns5", medicalIns5); + registry.register("room1", room1); + registry.register("room2", room2); + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/company/data/Relationships1_1Data.java b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/Relationships1_1Data.java new file mode 100644 index 000000000..001b3054f --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/Relationships1_1Data.java @@ -0,0 +1,162 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.data; + +import static org.apache.jdo.tck.util.DataSourceUtil.date; +import static org.apache.jdo.tck.util.DataSourceUtil.toSet; + +import java.math.BigDecimal; +import org.apache.jdo.tck.pc.company.CompanyFactory; +import org.apache.jdo.tck.pc.company.IAddress; +import org.apache.jdo.tck.pc.company.ICompany; +import org.apache.jdo.tck.pc.company.IDentalInsurance; +import org.apache.jdo.tck.pc.company.IDepartment; +import org.apache.jdo.tck.pc.company.IFullTimeEmployee; +import org.apache.jdo.tck.pc.company.IMedicalInsurance; +import org.apache.jdo.tck.pc.company.IPartTimeEmployee; +import org.apache.jdo.tck.pc.company.IProject; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; + +public class Relationships1_1Data implements CompanyDataSource { + + @Override + public void init(CompanyFactory factory, DefaultListableInstanceFactory registry) { + IAddress addr1 = + factory.newAddress(1, "Unter den Linden 1", "Berlin", " ", "12345", "Germany"); + IAddress addr2 = factory.newAddress(2, "Broadway 1", "New York", "NY", "10000", "USA"); + IAddress addr3 = factory.newAddress(3, "Market St.", "San Francisco", "CA", "94102", "USA"); + + // Insurance constructors + IMedicalInsurance medicalIns1 = factory.newMedicalInsurance(1, "Carrier1", "PPO"); + IMedicalInsurance medicalIns2 = factory.newMedicalInsurance(2, "Carrier2", "HMO"); + IMedicalInsurance medicalIns3 = factory.newMedicalInsurance(3, "Carrier3", "HMO"); + IMedicalInsurance medicalIns4 = factory.newMedicalInsurance(4, "Carrier4", "HMO"); + IMedicalInsurance medicalIns5 = factory.newMedicalInsurance(5, "Carrier5", "HMO"); + IDentalInsurance dentalIns1 = + factory.newDentalInsurance(11, "Carrier1", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns2 = + factory.newDentalInsurance(12, "Carrier2", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns3 = + factory.newDentalInsurance(13, "Carrier3", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns4 = + factory.newDentalInsurance(14, "Carrier4", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns5 = + factory.newDentalInsurance(15, "Carrier5", BigDecimal.valueOf(99.999)); + + // Project constructors + IProject proj1 = factory.newProject(1, "orange", BigDecimal.valueOf(2500000.99)); + IProject proj2 = factory.newProject(2, "blue", BigDecimal.valueOf(50000.00)); + IProject proj3 = factory.newProject(3, "green", BigDecimal.valueOf(2000.99)); + + // Company constructor + ICompany company1 = factory.newCompany(1L, "Sun Microsystems, Inc.", date(1952, 4, 11), addr1); + + // Meeting room constructors + + // Department Constructors + IDepartment dept1 = factory.newDepartment(1, "Development", company1); + IDepartment dept2 = factory.newDepartment(2, "Human Resources", company1); + company1.setDepartments(toSet(dept1, dept2)); + + // Employee Constructors + IFullTimeEmployee emp1 = + factory.newFullTimeEmployee( + 1, "emp1First", "emp1Last", "emp1Middle", null, addr1, null, 20000); + emp1.setBirthdate(date(1970, 6, 10)); + emp1.setHiredate(date(1999, 1, 1)); + IFullTimeEmployee emp2 = + factory.newFullTimeEmployee( + 2, "emp2First", "emp2Last", "emp2Middle", null, addr2, null, 10000); + emp2.setBirthdate(date(1975, 12, 22)); + emp2.setHiredate(date(2003, 7, 1)); + IPartTimeEmployee emp3 = + factory.newPartTimeEmployee( + 3, "emp3First", "emp3Last", "emp3Middle", null, addr3, null, 15); + emp3.setBirthdate(date(1972, 7, 5)); + emp3.setHiredate(date(2002, 8, 15)); + IPartTimeEmployee emp4 = + factory.newPartTimeEmployee( + 4, "emp4First", "emp4Last", "emp4Middle", null, addr3, null, 13); + emp4.setBirthdate(date(1973, 7, 6)); + emp4.setHiredate(date(2001, 4, 15)); + IFullTimeEmployee emp5 = + factory.newFullTimeEmployee( + 5, "emp5First", "emp5Last", "emp5Middle", null, addr3, null, 45000); + emp5.setBirthdate(date(1962, 7, 5)); + emp5.setHiredate(date(1998, 8, 15)); + + // Employee properties + emp1.setWeeklyhours(40); + emp1.setMedicalInsurance(medicalIns1); + emp1.setDentalInsurance(dentalIns1); + emp1.setMentor(emp2); + emp1.setProtege(emp5); + + emp2.setWeeklyhours(40); + emp2.setMedicalInsurance(medicalIns2); + emp2.setDentalInsurance(dentalIns2); + emp2.setMentor(emp3); + emp2.setProtege(emp1); + + emp3.setWeeklyhours(19); + emp3.setMedicalInsurance(medicalIns3); + emp3.setDentalInsurance(dentalIns3); + emp3.setMentor(emp4); + emp3.setProtege(emp2); + + emp4.setMedicalInsurance(medicalIns4); + emp4.setDentalInsurance(dentalIns4); + emp4.setMentor(emp5); + emp4.setProtege(emp3); + + emp5.setMedicalInsurance(medicalIns5); + emp5.setDentalInsurance(dentalIns5); + emp5.setMentor(emp1); + emp5.setProtege(emp4); + + // Department properties + + // Insurance properties + medicalIns1.setEmployee(emp1); + medicalIns2.setEmployee(emp2); + medicalIns3.setEmployee(emp3); + medicalIns4.setEmployee(emp4); + medicalIns5.setEmployee(emp5); + + dentalIns1.setEmployee(emp1); + dentalIns2.setEmployee(emp2); + dentalIns3.setEmployee(emp3); + dentalIns4.setEmployee(emp4); + dentalIns5.setEmployee(emp5); + + // Project properties + + // root objects + registry.register("company1", company1); + registry.register("dept1", dept1); + registry.register("dept2", dept2); + registry.register("emp1", emp1); + registry.register("emp2", emp2); + registry.register("emp3", emp3); + registry.register("emp4", emp4); + registry.register("emp5", emp5); + registry.register("proj1", proj1); + registry.register("proj2", proj2); + registry.register("proj3", proj3); + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/company/data/Relationships1_MData.java b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/Relationships1_MData.java new file mode 100644 index 000000000..741e1e7ae --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/Relationships1_MData.java @@ -0,0 +1,152 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.data; + +import static org.apache.jdo.tck.util.DataSourceUtil.date; +import static org.apache.jdo.tck.util.DataSourceUtil.toSet; + +import java.math.BigDecimal; +import org.apache.jdo.tck.pc.company.CompanyFactory; +import org.apache.jdo.tck.pc.company.IAddress; +import org.apache.jdo.tck.pc.company.ICompany; +import org.apache.jdo.tck.pc.company.IDentalInsurance; +import org.apache.jdo.tck.pc.company.IDepartment; +import org.apache.jdo.tck.pc.company.IFullTimeEmployee; +import org.apache.jdo.tck.pc.company.IMedicalInsurance; +import org.apache.jdo.tck.pc.company.IPartTimeEmployee; +import org.apache.jdo.tck.pc.company.IProject; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; + +public class Relationships1_MData implements CompanyDataSource { + + @Override + public void init(CompanyFactory factory, DefaultListableInstanceFactory registry) { + IAddress addr1 = + factory.newAddress(1, "Unter den Linden 1", "Berlin", " ", "12345", "Germany"); + IAddress addr2 = factory.newAddress(2, "Broadway 1", "New York", "NY", "10000", "USA"); + IAddress addr3 = factory.newAddress(3, "Market St.", "San Francisco", "CA", "94102", "USA"); + + // Insurance constructors + IMedicalInsurance medicalIns1 = factory.newMedicalInsurance(1, "Carrier1", "PPO"); + IMedicalInsurance medicalIns2 = factory.newMedicalInsurance(2, "Carrier2", "HMO"); + IMedicalInsurance medicalIns3 = factory.newMedicalInsurance(3, "Carrier3", "HMO"); + IMedicalInsurance medicalIns4 = factory.newMedicalInsurance(4, "Carrier4", "HMO"); + IMedicalInsurance medicalIns5 = factory.newMedicalInsurance(5, "Carrier5", "HMO"); + IDentalInsurance dentalIns1 = + factory.newDentalInsurance(11, "Carrier1", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns2 = + factory.newDentalInsurance(12, "Carrier2", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns3 = + factory.newDentalInsurance(13, "Carrier3", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns4 = + factory.newDentalInsurance(14, "Carrier4", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns5 = + factory.newDentalInsurance(15, "Carrier5", BigDecimal.valueOf(99.999)); + + // Project constructors + IProject proj1 = factory.newProject(1, "orange", BigDecimal.valueOf(2500000.99)); + IProject proj2 = factory.newProject(2, "blue", BigDecimal.valueOf(50000.00)); + IProject proj3 = factory.newProject(3, "green", BigDecimal.valueOf(2000.99)); + + // Company constructor + ICompany company1 = factory.newCompany(1L, "Sun Microsystems, Inc.", date(1952, 4, 11), addr1); + + // Meeting room constructors + + // Department Constructors + IDepartment dept1 = factory.newDepartment(1, "Development", company1); + IDepartment dept2 = factory.newDepartment(2, "Human Resources", company1); + company1.setDepartments(toSet(dept1, dept2)); + + // Employee Constructors + IFullTimeEmployee emp1 = + factory.newFullTimeEmployee( + 1, "emp1First", "emp1Last", "emp1Middle", null, addr1, null, 20000); + emp1.setBirthdate(date(1970, 6, 10)); + emp1.setHiredate(date(1999, 1, 1)); + IFullTimeEmployee emp2 = + factory.newFullTimeEmployee( + 2, "emp2First", "emp2Last", "emp2Middle", null, addr2, null, 10000); + emp2.setBirthdate(date(1975, 12, 22)); + emp2.setHiredate(date(2003, 7, 1)); + IPartTimeEmployee emp3 = + factory.newPartTimeEmployee( + 3, "emp3First", "emp3Last", "emp3Middle", null, addr3, null, 15); + emp3.setBirthdate(date(1972, 7, 5)); + emp3.setHiredate(date(2002, 8, 15)); + IPartTimeEmployee emp4 = + factory.newPartTimeEmployee( + 4, "emp4First", "emp4Last", "emp4Middle", null, addr3, null, 13); + emp4.setBirthdate(date(1973, 7, 6)); + emp4.setHiredate(date(2001, 4, 15)); + IFullTimeEmployee emp5 = + factory.newFullTimeEmployee( + 5, "emp5First", "emp5Last", "emp5Middle", null, addr3, null, 45000); + emp5.setBirthdate(date(1962, 7, 5)); + emp5.setHiredate(date(1998, 8, 15)); + + // Employee properties + emp1.setWeeklyhours(40); + emp1.setDepartment(dept1); + emp1.setFundingDept(dept2); + emp1.setManager(emp2); + emp1.setHradvisor(emp5); + + emp2.setWeeklyhours(40); + emp2.setDepartment(dept1); + emp2.setFundingDept(dept1); + emp2.setHradvisor(emp5); + emp2.setTeam(toSet(emp1, emp3, emp4, emp5)); + + emp3.setDepartment(dept1); + emp3.setFundingDept(dept1); + emp3.setManager(emp2); + emp3.setHradvisor(emp5); + + emp4.setDepartment(dept2); + emp4.setFundingDept(dept2); + emp4.setManager(emp2); + emp4.setHradvisor(emp5); + + emp5.setDepartment(dept2); + emp5.setFundingDept(dept2); + emp5.setManager(emp2); + emp5.setHradvisees(toSet(emp1, emp2, emp3, emp4)); + + // Department properties + dept1.setEmployees(toSet(emp1, emp2, emp3)); + dept1.setFundedEmps(toSet(emp2, emp3)); + + dept2.setEmployees(toSet(emp4, emp5)); + dept2.setFundedEmps(toSet(emp1, emp4, emp5)); + + // Insurance properties + + // Project properties + + // root objects + registry.register("company1", company1); + registry.register("medicalIns1", medicalIns1); + registry.register("medicalIns2", medicalIns2); + registry.register("medicalIns3", medicalIns3); + registry.register("dentalIns1", dentalIns1); + registry.register("proj1", proj1); + registry.register("proj2", proj2); + registry.register("proj3", proj3); + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/company/data/RelationshipsAllData.java b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/RelationshipsAllData.java new file mode 100644 index 000000000..a979dfff1 --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/RelationshipsAllData.java @@ -0,0 +1,213 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.data; + +import static org.apache.jdo.tck.util.DataSourceUtil.date; +import static org.apache.jdo.tck.util.DataSourceUtil.toMap; +import static org.apache.jdo.tck.util.DataSourceUtil.toSet; + +import java.math.BigDecimal; +import org.apache.jdo.tck.pc.company.CompanyFactory; +import org.apache.jdo.tck.pc.company.IAddress; +import org.apache.jdo.tck.pc.company.ICompany; +import org.apache.jdo.tck.pc.company.IDentalInsurance; +import org.apache.jdo.tck.pc.company.IDepartment; +import org.apache.jdo.tck.pc.company.IFullTimeEmployee; +import org.apache.jdo.tck.pc.company.IMedicalInsurance; +import org.apache.jdo.tck.pc.company.IPartTimeEmployee; +import org.apache.jdo.tck.pc.company.IProject; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; + +public class RelationshipsAllData implements CompanyDataSource { + + @Override + public void init(CompanyFactory factory, DefaultListableInstanceFactory registry) { + IAddress addr1 = + factory.newAddress(1, "Unter den Linden 1", "Berlin", " ", "12345", "Germany"); + IAddress addr2 = factory.newAddress(2, "Broadway 1", "New York", "NY", "10000", "USA"); + IAddress addr3 = factory.newAddress(3, "Market St.", "San Francisco", "CA", "94102", "USA"); + + // Insurance constructors + IMedicalInsurance medicalIns1 = factory.newMedicalInsurance(1, "Carrier1", "PPO"); + IMedicalInsurance medicalIns2 = factory.newMedicalInsurance(2, "Carrier2", "HMO"); + IMedicalInsurance medicalIns3 = factory.newMedicalInsurance(3, "Carrier3", "HMO"); + IMedicalInsurance medicalIns4 = factory.newMedicalInsurance(4, "Carrier4", "HMO"); + IMedicalInsurance medicalIns5 = factory.newMedicalInsurance(5, "Carrier5", "HMO"); + IDentalInsurance dentalIns1 = + factory.newDentalInsurance(11, "Carrier1", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns2 = + factory.newDentalInsurance(12, "Carrier2", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns3 = + factory.newDentalInsurance(13, "Carrier3", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns4 = + factory.newDentalInsurance(14, "Carrier4", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns5 = + factory.newDentalInsurance(15, "Carrier5", BigDecimal.valueOf(99.999)); + + // Project constructors + IProject proj1 = factory.newProject(1, "orange", BigDecimal.valueOf(2500000.99)); + IProject proj2 = factory.newProject(2, "blue", BigDecimal.valueOf(50000.00)); + IProject proj3 = factory.newProject(3, "green", BigDecimal.valueOf(2000.99)); + + // Company constructor + ICompany company1 = factory.newCompany(1L, "Sun Microsystems, Inc.", date(1952, 4, 11), addr1); + + // Meeting room constructors + + // Department Constructors + IDepartment dept1 = factory.newDepartment(1, "Development", company1); + IDepartment dept2 = factory.newDepartment(2, "Human Resources", company1); + company1.setDepartments(toSet(dept1, dept2)); + + // Employee Constructors + IFullTimeEmployee emp1 = + factory.newFullTimeEmployee( + 1, "emp1First", "emp1Last", "emp1Middle", null, addr1, null, 20000); + emp1.setBirthdate(date(1970, 6, 10)); + emp1.setHiredate(date(1999, 1, 1)); + IFullTimeEmployee emp2 = + factory.newFullTimeEmployee( + 2, "emp2First", "emp2Last", "emp2Middle", null, addr2, null, 10000); + emp2.setBirthdate(date(1975, 12, 22)); + emp2.setHiredate(date(2003, 7, 1)); + IPartTimeEmployee emp3 = + factory.newPartTimeEmployee( + 3, "emp3First", "emp3Last", "emp3Middle", null, addr3, null, 15); + emp3.setBirthdate(date(1972, 7, 5)); + emp3.setHiredate(date(2002, 8, 15)); + IPartTimeEmployee emp4 = + factory.newPartTimeEmployee( + 4, "emp4First", "emp4Last", "emp4Middle", null, addr3, null, 13); + emp4.setBirthdate(date(1973, 7, 6)); + emp4.setHiredate(date(2001, 4, 15)); + IFullTimeEmployee emp5 = + factory.newFullTimeEmployee( + 5, "emp5First", "emp5Last", "emp5Middle", null, addr3, null, 45000); + emp5.setBirthdate(date(1962, 7, 5)); + emp5.setHiredate(date(1998, 8, 15)); + + // Employee properties + emp1.setWeeklyhours(40); + emp1.setMedicalInsurance(medicalIns1); + emp1.setDentalInsurance(dentalIns1); + emp1.setPhoneNumbers(toMap("home", "1111", "work", "123456-1")); + emp1.setDepartment(dept1); + emp1.setFundingDept(dept2); + emp1.setManager(emp2); + emp1.setMentor(emp2); + emp1.setProtege(emp5); + emp1.setHradvisor(emp5); + emp1.setReviewedProjects(toSet(proj3)); + emp1.setProjects(toSet(proj1)); + + emp2.setWeeklyhours(40); + emp2.setMedicalInsurance(medicalIns2); + emp2.setDentalInsurance(dentalIns2); + emp2.setPhoneNumbers(toMap("home", "2222", "work", "123456-2")); + emp2.setDepartment(dept1); + emp2.setFundingDept(dept1); + emp2.setMentor(emp3); + emp2.setProtege(emp1); + emp2.setHradvisor(emp5); + emp2.setProjects(toSet(proj1, proj2)); + emp2.setTeam(toSet(emp1, emp3, emp4, emp5)); + + emp3.setWeeklyhours(19); + emp3.setMedicalInsurance(medicalIns3); + emp3.setDentalInsurance(dentalIns3); + emp3.setPhoneNumbers(toMap("home", "3333", "work", "123456-3")); + emp3.setDepartment(dept1); + emp3.setFundingDept(dept1); + emp3.setManager(emp2); + emp3.setMentor(emp4); + emp3.setProtege(emp2); + emp3.setHradvisor(emp5); + emp3.setProjects(toSet(proj1, proj2)); + + emp4.setMedicalInsurance(medicalIns4); + emp4.setDentalInsurance(dentalIns4); + emp4.setPhoneNumbers(toMap("home", "3343", "work", "124456-3")); + emp4.setDepartment(dept2); + emp4.setFundingDept(dept2); + emp4.setManager(emp2); + emp4.setMentor(emp5); + emp4.setProtege(emp3); + emp4.setHradvisor(emp5); + emp4.setReviewedProjects(toSet(proj2)); + emp4.setProjects(toSet(proj3)); + + emp5.setMedicalInsurance(medicalIns5); + emp5.setDentalInsurance(dentalIns5); + emp5.setPhoneNumbers(toMap("home", "3363", "work", "126456-3")); + emp5.setDepartment(dept2); + emp5.setFundingDept(dept2); + emp5.setManager(emp2); + emp5.setMentor(emp1); + emp5.setProtege(emp4); + emp5.setReviewedProjects(toSet(proj2)); + emp5.setProjects(toSet(proj3)); + emp5.setHradvisees(toSet(emp1, emp2, emp3, emp4)); + + // Department properties + dept1.setEmployeeOfTheMonth(emp1); + dept1.setEmployees(toSet(emp1, emp2, emp3)); + dept1.setFundedEmps(toSet(emp2, emp3)); + + dept2.setEmployees(toSet(emp4, emp5)); + dept2.setFundedEmps(toSet(emp1, emp4, emp5)); + + // Insurance properties + medicalIns1.setEmployee(emp1); + medicalIns2.setEmployee(emp2); + medicalIns3.setEmployee(emp3); + medicalIns4.setEmployee(emp4); + medicalIns5.setEmployee(emp5); + + dentalIns1.setEmployee(emp1); + dentalIns2.setEmployee(emp2); + dentalIns3.setEmployee(emp3); + dentalIns4.setEmployee(emp4); + dentalIns5.setEmployee(emp5); + + // Project properties + proj1.setMembers(toSet(emp1, emp2, emp3)); + + proj2.setReviewers(toSet(emp4, emp5)); + proj2.setMembers(toSet(emp2, emp3)); + + proj3.setReviewers(toSet(emp1)); + proj3.setMembers(toSet(emp4, emp5)); + + // root objects + registry.register("company1", company1); + registry.register("dept1", dept1); + registry.register("dept2", dept2); + registry.register("emp1", emp1); + registry.register("emp2", emp2); + registry.register("emp3", emp3); + registry.register("emp4", emp4); + registry.register("emp5", emp5); + registry.register("medicalIns1", medicalIns1); + registry.register("medicalIns2", medicalIns2); + registry.register("medicalIns3", medicalIns3); + registry.register("dentalIns1", dentalIns1); + registry.register("proj1", proj1); + registry.register("proj2", proj2); + registry.register("proj3", proj3); + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/company/data/RelationshipsM_MData.java b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/RelationshipsM_MData.java new file mode 100644 index 000000000..26b9ba9a3 --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/RelationshipsM_MData.java @@ -0,0 +1,147 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.data; + +import static org.apache.jdo.tck.util.DataSourceUtil.date; +import static org.apache.jdo.tck.util.DataSourceUtil.toSet; + +import java.math.BigDecimal; +import org.apache.jdo.tck.pc.company.CompanyFactory; +import org.apache.jdo.tck.pc.company.IAddress; +import org.apache.jdo.tck.pc.company.ICompany; +import org.apache.jdo.tck.pc.company.IDentalInsurance; +import org.apache.jdo.tck.pc.company.IDepartment; +import org.apache.jdo.tck.pc.company.IFullTimeEmployee; +import org.apache.jdo.tck.pc.company.IMedicalInsurance; +import org.apache.jdo.tck.pc.company.IPartTimeEmployee; +import org.apache.jdo.tck.pc.company.IProject; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; + +public class RelationshipsM_MData implements CompanyDataSource { + + @Override + public void init(CompanyFactory factory, DefaultListableInstanceFactory registry) { + IAddress addr1 = + factory.newAddress(1, "Unter den Linden 1", "Berlin", " ", "12345", "Germany"); + IAddress addr2 = factory.newAddress(2, "Broadway 1", "New York", "NY", "10000", "USA"); + IAddress addr3 = factory.newAddress(3, "Market St.", "San Francisco", "CA", "94102", "USA"); + + // Insurance constructors + IMedicalInsurance medicalIns1 = factory.newMedicalInsurance(1, "Carrier1", "PPO"); + IMedicalInsurance medicalIns2 = factory.newMedicalInsurance(2, "Carrier2", "HMO"); + IMedicalInsurance medicalIns3 = factory.newMedicalInsurance(3, "Carrier3", "HMO"); + IMedicalInsurance medicalIns4 = factory.newMedicalInsurance(4, "Carrier4", "HMO"); + IMedicalInsurance medicalIns5 = factory.newMedicalInsurance(5, "Carrier5", "HMO"); + IDentalInsurance dentalIns1 = + factory.newDentalInsurance(11, "Carrier1", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns2 = + factory.newDentalInsurance(12, "Carrier2", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns3 = + factory.newDentalInsurance(13, "Carrier3", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns4 = + factory.newDentalInsurance(14, "Carrier4", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns5 = + factory.newDentalInsurance(15, "Carrier5", BigDecimal.valueOf(99.999)); + + // Project constructors + IProject proj1 = factory.newProject(1, "orange", BigDecimal.valueOf(2500000.99)); + IProject proj2 = factory.newProject(2, "blue", BigDecimal.valueOf(50000.00)); + IProject proj3 = factory.newProject(3, "green", BigDecimal.valueOf(2000.99)); + + // Company constructor + ICompany company1 = factory.newCompany(1L, "Sun Microsystems, Inc.", date(1952, 4, 11), addr1); + + // Meeting room constructors + + // Department Constructors + IDepartment dept1 = factory.newDepartment(1, "Development", company1); + IDepartment dept2 = factory.newDepartment(2, "Human Resources", company1); + company1.setDepartments(toSet(dept1, dept2)); + + // Employee Constructors + IFullTimeEmployee emp1 = + factory.newFullTimeEmployee( + 1, "emp1First", "emp1Last", "emp1Middle", null, addr1, null, 20000); + emp1.setBirthdate(date(1970, 6, 10)); + emp1.setHiredate(date(1999, 1, 1)); + IFullTimeEmployee emp2 = + factory.newFullTimeEmployee( + 2, "emp2First", "emp2Last", "emp2Middle", null, addr2, null, 10000); + emp2.setBirthdate(date(1975, 12, 22)); + emp2.setHiredate(date(2003, 7, 1)); + IPartTimeEmployee emp3 = + factory.newPartTimeEmployee( + 3, "emp3First", "emp3Last", "emp3Middle", null, addr3, null, 15); + emp3.setBirthdate(date(1972, 7, 5)); + emp3.setHiredate(date(2002, 8, 15)); + IPartTimeEmployee emp4 = + factory.newPartTimeEmployee( + 4, "emp4First", "emp4Last", "emp4Middle", null, addr3, null, 13); + emp4.setBirthdate(date(1973, 7, 6)); + emp4.setHiredate(date(2001, 4, 15)); + IFullTimeEmployee emp5 = + factory.newFullTimeEmployee( + 5, "emp5First", "emp5Last", "emp5Middle", null, addr3, null, 45000); + emp5.setBirthdate(date(1962, 7, 5)); + emp5.setHiredate(date(1998, 8, 15)); + + // Employee properties + emp1.setWeeklyhours(40); + emp1.setReviewedProjects(toSet(proj3)); + emp1.setProjects(toSet(proj1)); + + emp2.setWeeklyhours(40); + emp2.setProjects(toSet(proj1, proj2)); + + emp3.setWeeklyhours(19); + emp3.setProjects(toSet(proj1, proj2)); + + emp4.setReviewedProjects(toSet(proj2)); + emp4.setProjects(toSet(proj3)); + + emp5.setReviewedProjects(toSet(proj2)); + emp5.setProjects(toSet(proj3)); + + // Department properties + + // Insurance properties + + // Project properties + proj1.setMembers(toSet(emp1, emp2, emp3)); + + proj2.setReviewers(toSet(emp4, emp5)); + proj2.setMembers(toSet(emp2, emp3)); + + proj3.setReviewers(toSet(emp1)); + proj3.setMembers(toSet(emp4, emp5)); + + // root objects + registry.register("company1", company1); + registry.register("dept1", dept1); + registry.register("dept2", dept2); + registry.register("emp1", emp1); + registry.register("emp2", emp2); + registry.register("emp3", emp3); + registry.register("emp4", emp4); + registry.register("emp5", emp5); + registry.register("medicalIns1", medicalIns1); + registry.register("medicalIns2", medicalIns2); + registry.register("medicalIns3", medicalIns3); + registry.register("dentalIns1", dentalIns1); + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/company/data/RelationshipsNoData.java b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/RelationshipsNoData.java new file mode 100644 index 000000000..e80d244cd --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/RelationshipsNoData.java @@ -0,0 +1,133 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.data; + +import static org.apache.jdo.tck.util.DataSourceUtil.date; +import static org.apache.jdo.tck.util.DataSourceUtil.toSet; + +import java.math.BigDecimal; +import org.apache.jdo.tck.pc.company.CompanyFactory; +import org.apache.jdo.tck.pc.company.IAddress; +import org.apache.jdo.tck.pc.company.ICompany; +import org.apache.jdo.tck.pc.company.IDentalInsurance; +import org.apache.jdo.tck.pc.company.IDepartment; +import org.apache.jdo.tck.pc.company.IFullTimeEmployee; +import org.apache.jdo.tck.pc.company.IMedicalInsurance; +import org.apache.jdo.tck.pc.company.IPartTimeEmployee; +import org.apache.jdo.tck.pc.company.IProject; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; + +public class RelationshipsNoData implements CompanyDataSource { + + @Override + public void init(CompanyFactory factory, DefaultListableInstanceFactory registry) { + IAddress addr1 = + factory.newAddress(1, "Unter den Linden 1", "Berlin", " ", "12345", "Germany"); + IAddress addr2 = factory.newAddress(2, "Broadway 1", "New York", "NY", "10000", "USA"); + IAddress addr3 = factory.newAddress(3, "Market St.", "San Francisco", "CA", "94102", "USA"); + + // Insurance constructors + IMedicalInsurance medicalIns1 = factory.newMedicalInsurance(1, "Carrier1", "PPO"); + IMedicalInsurance medicalIns2 = factory.newMedicalInsurance(2, "Carrier2", "HMO"); + IMedicalInsurance medicalIns3 = factory.newMedicalInsurance(3, "Carrier3", "HMO"); + IMedicalInsurance medicalIns4 = factory.newMedicalInsurance(4, "Carrier4", "HMO"); + IMedicalInsurance medicalIns5 = factory.newMedicalInsurance(5, "Carrier5", "HMO"); + IDentalInsurance dentalIns1 = + factory.newDentalInsurance(11, "Carrier1", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns2 = + factory.newDentalInsurance(12, "Carrier2", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns3 = + factory.newDentalInsurance(13, "Carrier3", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns4 = + factory.newDentalInsurance(14, "Carrier4", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns5 = + factory.newDentalInsurance(15, "Carrier5", BigDecimal.valueOf(99.999)); + + // Project constructors + IProject proj1 = factory.newProject(1, "orange", BigDecimal.valueOf(2500000.99)); + IProject proj2 = factory.newProject(2, "blue", BigDecimal.valueOf(50000.00)); + IProject proj3 = factory.newProject(3, "green", BigDecimal.valueOf(2000.99)); + + // Company constructor + ICompany company1 = factory.newCompany(1L, "Sun Microsystems, Inc.", date(1952, 4, 11), addr1); + + // Meeting room constructors + + // Department Constructors + IDepartment dept1 = factory.newDepartment(1, "Development", company1); + IDepartment dept2 = factory.newDepartment(2, "Human Resources", company1); + company1.setDepartments(toSet(dept1, dept2)); + + // Employee Constructors + IFullTimeEmployee emp1 = + factory.newFullTimeEmployee( + 1, "emp1First", "emp1Last", "emp1Middle", null, addr1, null, 20000); + emp1.setBirthdate(date(1970, 6, 10)); + emp1.setHiredate(date(1999, 1, 1)); + IFullTimeEmployee emp2 = + factory.newFullTimeEmployee( + 2, "emp2First", "emp2Last", "emp2Middle", null, addr2, null, 10000); + emp2.setBirthdate(date(1975, 12, 22)); + emp2.setHiredate(date(2003, 7, 1)); + IPartTimeEmployee emp3 = + factory.newPartTimeEmployee( + 3, "emp3First", "emp3Last", "emp3Middle", null, addr3, null, 15); + emp3.setBirthdate(date(1972, 7, 5)); + emp3.setHiredate(date(2002, 8, 15)); + IPartTimeEmployee emp4 = + factory.newPartTimeEmployee( + 4, "emp4First", "emp4Last", "emp4Middle", null, addr3, null, 13); + emp4.setBirthdate(date(1973, 7, 6)); + emp4.setHiredate(date(2001, 4, 15)); + IFullTimeEmployee emp5 = + factory.newFullTimeEmployee( + 5, "emp5First", "emp5Last", "emp5Middle", null, addr3, null, 45000); + emp5.setBirthdate(date(1962, 7, 5)); + emp5.setHiredate(date(1998, 8, 15)); + + // Employee properties + emp1.setWeeklyhours(40); + + emp2.setWeeklyhours(40); + + emp3.setWeeklyhours(19); + + // Department properties + + // Insurance properties + + // Project properties + + // root objects + registry.register("company1", company1); + registry.register("dept1", dept1); + registry.register("dept2", dept2); + registry.register("emp1", emp1); + registry.register("emp2", emp2); + registry.register("emp3", emp3); + registry.register("emp4", emp4); + registry.register("emp5", emp5); + registry.register("medicalIns1", medicalIns1); + registry.register("medicalIns2", medicalIns2); + registry.register("medicalIns3", medicalIns3); + registry.register("dentalIns1", dentalIns1); + registry.register("proj1", proj1); + registry.register("proj2", proj2); + registry.register("proj3", proj3); + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/company/data/SampleQueryTestData.java b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/SampleQueryTestData.java new file mode 100644 index 000000000..1552b9a91 --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/SampleQueryTestData.java @@ -0,0 +1,234 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.data; + +import static org.apache.jdo.tck.util.DataSourceUtil.date; +import static org.apache.jdo.tck.util.DataSourceUtil.toList; +import static org.apache.jdo.tck.util.DataSourceUtil.toMap; +import static org.apache.jdo.tck.util.DataSourceUtil.toSet; + +import java.math.BigDecimal; +import org.apache.jdo.tck.pc.company.CompanyFactory; +import org.apache.jdo.tck.pc.company.IAddress; +import org.apache.jdo.tck.pc.company.ICompany; +import org.apache.jdo.tck.pc.company.IDentalInsurance; +import org.apache.jdo.tck.pc.company.IDepartment; +import org.apache.jdo.tck.pc.company.IFullTimeEmployee; +import org.apache.jdo.tck.pc.company.IMedicalInsurance; +import org.apache.jdo.tck.pc.company.IMeetingRoom; +import org.apache.jdo.tck.pc.company.IPartTimeEmployee; +import org.apache.jdo.tck.pc.company.IProject; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; + +public class SampleQueryTestData implements CompanyDataSource { + + @Override + public void init(CompanyFactory factory, DefaultListableInstanceFactory registry) { + IAddress addr1 = + factory.newAddress(1, "Unter den Linden 1", "Berlin", " ", "12345", "Germany"); + IAddress addr2 = factory.newAddress(2, "Broadway 1", "New York", "NY", "10000", "USA"); + IAddress addr3 = factory.newAddress(3, "Market St.", "San Francisco", "CA", "94102", "USA"); + + // Insurance constructors + IMedicalInsurance medicalIns1 = factory.newMedicalInsurance(1, "Carrier1", "PPO"); + IMedicalInsurance medicalIns2 = factory.newMedicalInsurance(2, "Carrier2", "HMO"); + IMedicalInsurance medicalIns3 = factory.newMedicalInsurance(3, "Carrier3", "HMO"); + IMedicalInsurance medicalIns4 = factory.newMedicalInsurance(4, "Carrier4", "HMO"); + IMedicalInsurance medicalIns5 = factory.newMedicalInsurance(5, "Carrier5", "HMO"); + IDentalInsurance dentalIns1 = + factory.newDentalInsurance(11, "Carrier1", BigDecimal.valueOf(99.995)); + IDentalInsurance dentalIns2 = + factory.newDentalInsurance(12, "Carrier2", BigDecimal.valueOf(99.996)); + IDentalInsurance dentalIns3 = + factory.newDentalInsurance(13, "Carrier3", BigDecimal.valueOf(99.997)); + IDentalInsurance dentalIns4 = + factory.newDentalInsurance(14, "Carrier4", BigDecimal.valueOf(99.998)); + IDentalInsurance dentalIns5 = + factory.newDentalInsurance(15, "Carrier5", BigDecimal.valueOf(99.999)); + IDentalInsurance dentalIns99 = factory.newDentalInsurance(99, "Carrier99", null); + + // Project constructors + IProject proj1 = factory.newProject(1, "orange", BigDecimal.valueOf(2500000.99)); + IProject proj2 = factory.newProject(2, "blue", BigDecimal.valueOf(50000.00)); + IProject proj3 = factory.newProject(3, "green", BigDecimal.valueOf(2000.99)); + + // Company constructor + ICompany company1 = factory.newCompany(1L, "Sun Microsystems, Inc.", date(1952, 4, 11), addr1); + + // Meeting room constructors + IMeetingRoom room1 = factory.newMeetingRoom(1, "Comfy Room"); + IMeetingRoom room2 = factory.newMeetingRoom(2, "Large Discussion Room"); + IMeetingRoom room3 = factory.newMeetingRoom(3, "Conference Room"); + + // Department Constructors + IDepartment dept1 = factory.newDepartment(1, "R&D", company1); + IDepartment dept2 = factory.newDepartment(2, "Sales", company1); + IDepartment dept3 = factory.newDepartment(3, "Marketing", company1); + company1.setDepartments(toSet(dept1, dept2)); + + // Employee Constructors + IFullTimeEmployee emp1 = + factory.newFullTimeEmployee(1, "Michael", "Bouschen", "", null, addr1, null, 40000); + emp1.setBirthdate(date(1970, 6, 10)); + emp1.setHiredate(date(1999, 1, 1)); + IFullTimeEmployee emp2 = + factory.newFullTimeEmployee(2, "Craig", "Russell", "L.", null, addr2, null, 50000); + emp2.setBirthdate(date(1975, 12, 22)); + emp2.setHiredate(date(2003, 7, 1)); + IPartTimeEmployee emp3 = + factory.newPartTimeEmployee(3, "Joe", "Doe", "", null, addr3, null, 15); + emp3.setBirthdate(date(1972, 7, 5)); + emp3.setHiredate(date(2002, 8, 15)); + IPartTimeEmployee emp4 = + factory.newPartTimeEmployee(4, "Jane", "Roe", "", null, addr3, null, 13); + emp4.setBirthdate(date(1973, 7, 6)); + emp4.setHiredate(date(2001, 4, 15)); + IFullTimeEmployee emp5 = + factory.newFullTimeEmployee(5, "Tilmann", "Zäschke", "", null, addr3, null, 45000); + emp5.setBirthdate(date(1979, 7, 5)); + emp5.setHiredate(date(1999, 8, 15)); + + // Employee properties + emp1.setWeeklyhours(40); + emp1.setMedicalInsurance(medicalIns1); + emp1.setDentalInsurance(dentalIns1); + emp1.setPhoneNumbers(toMap("home", "1111", "work", "123456-1")); + emp1.setLanguages(toSet("German", "English")); + emp1.setDepartment(dept1); + emp1.setFundingDept(dept2); + emp1.setManager(emp2); + emp1.setMentor(emp2); + emp1.setProtege(emp5); + emp1.setHradvisor(emp5); + emp1.setReviewedProjects(toSet(proj3)); + emp1.setProjects(toSet(proj1)); + + emp2.setWeeklyhours(40); + emp2.setMedicalInsurance(medicalIns2); + emp2.setDentalInsurance(dentalIns2); + emp2.setPhoneNumbers(toMap("home", "2222", "work", "123456-2")); + emp2.setLanguages(toSet("English", "Japanese")); + emp2.setDepartment(dept1); + emp2.setFundingDept(dept1); + emp2.setMentor(emp3); + emp2.setProtege(emp1); + emp2.setHradvisor(emp5); + emp2.setProjects(toSet(proj1, proj2)); + emp2.setTeam(toSet(emp1, emp3, emp4, emp5)); + + emp3.setWeeklyhours(19); + emp3.setMedicalInsurance(medicalIns3); + emp3.setDentalInsurance(dentalIns3); + emp3.setPhoneNumbers(toMap("home", "3333", "work", "123456-3")); + emp3.setLanguages(toSet("English", "French")); + emp3.setDepartment(dept1); + emp3.setFundingDept(dept1); + emp3.setManager(emp2); + emp3.setMentor(emp4); + emp3.setProtege(emp2); + emp3.setHradvisor(emp5); + emp3.setProjects(toSet(proj1, proj2)); + + emp4.setMedicalInsurance(medicalIns4); + emp4.setDentalInsurance(dentalIns4); + emp4.setPhoneNumbers(toMap("home", "3343", "work", "124456-3")); + emp4.setLanguages(toSet("English")); + emp4.setDepartment(dept2); + emp4.setFundingDept(dept2); + emp4.setManager(emp2); + emp4.setMentor(emp5); + emp4.setProtege(emp3); + emp4.setHradvisor(emp5); + emp4.setProjects(toSet(proj3)); + emp4.setReviewedProjects(toSet(proj2)); + + emp5.setMedicalInsurance(medicalIns5); + emp5.setDentalInsurance(dentalIns5); + emp5.setPhoneNumbers(toMap("home", "3363", "work", "126456-3")); + emp5.setLanguages(toSet("German", "English", "French", "Japanese")); + emp5.setDepartment(dept2); + emp5.setFundingDept(dept2); + emp5.setManager(emp2); + emp5.setMentor(emp1); + emp5.setProtege(emp4); + emp5.setProjects(toSet(proj3)); + emp5.setReviewedProjects(toSet(proj2)); + emp5.setHradvisees(toSet(emp1, emp2, emp3, emp4)); + + // Department properties + dept1.setEmployees(toSet(emp1, emp2, emp3)); + dept1.setFundedEmps(toSet(emp2, emp3)); + dept1.setMeetingRooms(toList(room1, room2, room3)); + + dept2.setEmployees(toSet(emp4, emp5)); + dept2.setFundedEmps(toSet(emp1, emp4, emp5)); + dept2.setMeetingRooms(toList()); + + dept3.setEmployees(toSet()); + dept3.setFundedEmps(toSet()); + dept3.setMeetingRooms(toList()); + + // Insurance properties + medicalIns1.setEmployee(emp1); + medicalIns2.setEmployee(emp2); + medicalIns3.setEmployee(emp3); + medicalIns4.setEmployee(emp4); + medicalIns5.setEmployee(emp5); + dentalIns1.setEmployee(emp1); + dentalIns2.setEmployee(emp2); + dentalIns3.setEmployee(emp3); + dentalIns4.setEmployee(emp4); + dentalIns5.setEmployee(emp5); + + // Project properties + proj1.setMembers(toSet(emp1, emp2, emp3)); + proj2.setReviewers(toSet(emp4, emp5)); + proj2.setMembers(toSet(emp2, emp3)); + proj3.setReviewers(toSet(emp1)); + proj3.setMembers(toSet(emp4, emp5)); + + // root objects + registry.register("company1", company1); + registry.register("dentalIns99", dentalIns99); + + registry.register("dept1", dept1); + registry.register("dept2", dept2); + registry.register("dept3", dept3); + registry.register("emp1", emp1); + registry.register("emp2", emp2); + registry.register("emp3", emp3); + registry.register("emp4", emp4); + registry.register("emp5", emp5); + registry.register("proj1", proj1); + registry.register("proj2", proj2); + registry.register("proj3", proj3); + registry.register("dentalIns1", dentalIns1); + registry.register("dentalIns2", dentalIns2); + registry.register("dentalIns3", dentalIns3); + registry.register("dentalIns4", dentalIns4); + registry.register("dentalIns5", dentalIns5); + registry.register("medicalIns1", medicalIns1); + registry.register("medicalIns2", medicalIns2); + registry.register("medicalIns3", medicalIns3); + registry.register("medicalIns4", medicalIns4); + registry.register("medicalIns5", medicalIns5); + registry.register("room1", room1); + registry.register("room2", room2); + registry.register("room3", room3); + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/company/data/SubqueryTestData.java b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/SubqueryTestData.java new file mode 100644 index 000000000..1062cd123 --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/pc/company/data/SubqueryTestData.java @@ -0,0 +1,183 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.data; + +import static org.apache.jdo.tck.util.DataSourceUtil.date; +import static org.apache.jdo.tck.util.DataSourceUtil.toList; +import static org.apache.jdo.tck.util.DataSourceUtil.toSet; + +import org.apache.jdo.tck.pc.company.CompanyFactory; +import org.apache.jdo.tck.pc.company.IAddress; +import org.apache.jdo.tck.pc.company.ICompany; +import org.apache.jdo.tck.pc.company.IDepartment; +import org.apache.jdo.tck.pc.company.IFullTimeEmployee; +import org.apache.jdo.tck.pc.company.IMeetingRoom; +import org.apache.jdo.tck.pc.company.IPartTimeEmployee; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; + +public class SubqueryTestData implements CompanyDataSource { + + @Override + public void init(CompanyFactory factory, DefaultListableInstanceFactory registry) { + IAddress addr1 = + factory.newAddress(1, "Unter den Linden 1", "Berlin", " ", "12345", "Germany"); + IAddress addr2 = factory.newAddress(2, "Broadway 1", "New York", "NY", "10000", "USA"); + IAddress addr3 = factory.newAddress(3, "Market St.", "San Francisco", "CA", "94102", "USA"); + + // Company constructor + ICompany company1 = factory.newCompany(1L, "Sun Microsystems, Inc.", date(1952, 4, 11), addr1); + + // Meeting room constructors + IMeetingRoom room1 = factory.newMeetingRoom(1, "Comfy Room"); + IMeetingRoom room2 = factory.newMeetingRoom(2, "Large Discussion Room"); + IMeetingRoom room3 = factory.newMeetingRoom(3, "Conference Room"); + + // Department Constructors + IDepartment dept1 = factory.newDepartment(1, "Development", company1); + IDepartment dept2 = factory.newDepartment(2, "Human Resources", company1); + company1.setDepartments(toSet(dept1, dept2)); + + // Employee Constructors + IFullTimeEmployee emp1 = + factory.newFullTimeEmployee( + 1, "emp1First", "emp1Last", "emp1Middle", null, addr1, null, 30000); + emp1.setBirthdate(date(1970, 6, 10)); + emp1.setHiredate(date(1999, 1, 1)); + IFullTimeEmployee emp2 = + factory.newFullTimeEmployee( + 2, "emp2First", "emp2Last", "emp2Middle", null, addr2, null, 20000); + emp2.setBirthdate(date(1975, 12, 22)); + emp2.setHiredate(date(2003, 7, 1)); + IPartTimeEmployee emp3 = + factory.newPartTimeEmployee( + 3, "emp3First", "emp3Last", "emp3Middle", null, addr3, null, 10000); + emp3.setBirthdate(date(1972, 7, 5)); + emp3.setHiredate(date(2002, 8, 15)); + IPartTimeEmployee emp4 = + factory.newPartTimeEmployee( + 4, "emp4First", "emp4Last", "emp4Middle", null, addr2, null, 25000); + emp4.setBirthdate(date(1973, 7, 6)); + emp4.setHiredate(date(2001, 4, 15)); + IFullTimeEmployee emp5 = + factory.newFullTimeEmployee( + 5, "emp5First", "emp5Last", "emp5Middle", null, addr2, null, 18000); + emp5.setBirthdate(date(1962, 7, 5)); + emp5.setHiredate(date(2002, 11, 1)); + IFullTimeEmployee emp6 = + factory.newFullTimeEmployee( + 6, "emp6First", "emp6Last", "emp6Middle", null, addr3, null, 22000); + emp6.setBirthdate(date(1969, 6, 10)); + emp6.setHiredate(date(2002, 6, 1)); + IFullTimeEmployee emp7 = + factory.newFullTimeEmployee( + 7, "emp7First", "emp7Last", "emp7Middle", null, addr1, null, 40000); + emp7.setBirthdate(date(1970, 6, 10)); + emp7.setHiredate(date(2000, 1, 1)); + IFullTimeEmployee emp8 = + factory.newFullTimeEmployee( + 8, "emp8First", "emp8Last", "emp8Middle", null, addr2, null, 10000); + emp8.setBirthdate(date(1975, 12, 22)); + emp8.setHiredate(date(2003, 8, 1)); + IFullTimeEmployee emp9 = + factory.newFullTimeEmployee( + 9, "emp9First", "emp9Last", "emp9Middle", null, addr3, null, 12000); + emp9.setBirthdate(date(1972, 7, 5)); + emp9.setHiredate(date(2002, 5, 1)); + IFullTimeEmployee emp10 = + factory.newFullTimeEmployee( + 10, "emp10First", "emp10Last", "emp10Middle", null, addr3, null, 24000); + emp10.setBirthdate(date(1972, 7, 5)); + emp10.setHiredate(date(2002, 10, 1)); + + // Employee properties + emp1.setWeeklyhours(40); + emp1.setDepartment(dept1); + emp1.setManager(null); + emp1.setTeam(toSet(emp2, emp3, emp10)); + + emp2.setWeeklyhours(40); + emp2.setDepartment(dept1); + emp2.setManager(emp1); + emp2.setTeam(toSet()); + + emp3.setWeeklyhours(25); + emp3.setDepartment(dept1); + emp3.setManager(emp1); + emp3.setTeam(toSet()); + + emp4.setWeeklyhours(40); + emp4.setDepartment(dept1); + emp4.setManager(null); + emp4.setTeam(toSet(emp5, emp6)); + + emp5.setWeeklyhours(35); + emp5.setDepartment(dept1); + emp5.setManager(emp4); + emp5.setTeam(toSet()); + + emp6.setWeeklyhours(40); + emp6.setDepartment(dept1); + emp6.setManager(emp4); + emp6.setTeam(toSet()); + + emp7.setWeeklyhours(40); + emp7.setDepartment(dept2); + emp7.setManager(null); + emp7.setTeam(toSet(emp8, emp9)); + + emp8.setWeeklyhours(15); + emp8.setDepartment(dept2); + emp8.setManager(emp7); + emp8.setTeam(toSet()); + + emp9.setWeeklyhours(20); + emp9.setDepartment(dept2); + emp9.setManager(emp7); + emp9.setTeam(toSet()); + + emp10.setWeeklyhours(40); + emp10.setDepartment(dept2); + emp10.setManager(emp1); + emp10.setTeam(toSet()); + + // Department properties + dept1.setEmployees(toSet(emp1, emp2, emp3, emp4, emp5, emp6)); + dept1.setMeetingRooms(toList(room1, room2)); + + dept2.setEmployees(toSet(emp7, emp8, emp9, emp10)); + dept2.setMeetingRooms(toList(room3)); + + // root objects + registry.register("company1", company1); + + registry.register("dept1", dept1); + registry.register("dept2", dept2); + registry.register("emp1", emp1); + registry.register("emp2", emp2); + registry.register("emp3", emp3); + registry.register("emp4", emp4); + registry.register("emp5", emp5); + registry.register("emp6", emp6); + registry.register("emp7", emp7); + registry.register("emp8", emp8); + registry.register("emp9", emp9); + registry.register("emp10", emp10); + registry.register("room1", room1); + registry.register("room2", room2); + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/companyListWithoutJoin/CompanyModelReader.java b/tck/src/main/java/org/apache/jdo/tck/pc/companyListWithoutJoin/CompanyModelReader.java index 67cb2857a..5c49d35fe 100644 --- a/tck/src/main/java/org/apache/jdo/tck/pc/companyListWithoutJoin/CompanyModelReader.java +++ b/tck/src/main/java/org/apache/jdo/tck/pc/companyListWithoutJoin/CompanyModelReader.java @@ -18,35 +18,21 @@ package org.apache.jdo.tck.pc.companyListWithoutJoin; import java.util.Date; -import java.util.List; import java.util.Locale; import org.apache.jdo.tck.util.ConversionHelper; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; import org.apache.jdo.tck.util.JDOCustomDateEditor; -import org.springframework.beans.factory.support.DefaultListableBeanFactory; -import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; -import org.springframework.core.io.ClassPathResource; /** * Utility class to create a graph of company model instances from an xml representation. * * @author Michael Bouschen */ -public class CompanyModelReader extends DefaultListableBeanFactory { - - private static final long serialVersionUID = 1L; - - /** 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"; +public class CompanyModelReader extends DefaultListableInstanceFactory { /** The company factory instance. */ private CompanyFactory companyFactory; - /** Bean definition reader */ - private final XmlBeanDefinitionReader reader; - /** * Create a CompanyModelReader for the specified resourceName. * @@ -64,31 +50,8 @@ public CompanyModelReader(String resourceName) { * @param classLoader the ClassLoader for the lookup */ public CompanyModelReader(String resourceName, ClassLoader classLoader) { - super(); - configureFactory(); - this.reader = new XmlBeanDefinitionReader(this); - this.reader.loadBeanDefinitions(new ClassPathResource(resourceName, classLoader)); - } - - /** - * 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 - */ - @SuppressWarnings("unchecked") - public List getRootList() { - return (List) getBean(ROOT_LIST_NAME); - } - - /** - * Configure the CompanyModelReader, e.g. register CustomEditor classes to convert the string - * representation of a property into an instance of the right type. - */ - private void configureFactory() { - registerCustomEditor(Date.class, JDOCustomDateEditor.class); companyFactory = CompanyFactoryRegistry.getInstance(); - addSingleton(BEAN_FACTORY_NAME, companyFactory); + getDataSource(resourceName).init(companyFactory, this); } // Convenience methods diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/companyListWithoutJoin/CompanyModelTestData.java b/tck/src/main/java/org/apache/jdo/tck/pc/companyListWithoutJoin/CompanyModelTestData.java new file mode 100644 index 000000000..117a93167 --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/pc/companyListWithoutJoin/CompanyModelTestData.java @@ -0,0 +1,101 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.companyListWithoutJoin; + +import static org.apache.jdo.tck.util.DataSourceUtil.date; +import static org.apache.jdo.tck.util.DataSourceUtil.toList; +import static org.apache.jdo.tck.util.DataSourceUtil.toSet; + +import org.apache.jdo.tck.util.DataSource; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; + +/** + * Utility class to create a graph of company model instances. + * + * @author Michael Bouschen + */ +public class CompanyModelTestData implements DataSource { + + /** Company instances for CompletenessTest with Map without join table. */ + @Override + public void init(CompanyFactory factory, DefaultListableInstanceFactory registry) { + + // Instances / Constructors + + ICompany company1 = factory.newCompany(1L, "Sun Microsystems, Inc.", date(1952, 4, 11)); + + IDepartment dept1 = factory.newDepartment(1, "Development", company1); + IDepartment dept2 = factory.newDepartment(2, "Human Resources", company1); + company1.setDepartments(toSet(dept1, dept2)); + + IFullTimeEmployee emp1 = + factory.newFullTimeEmployee( + 1, "emp1First", "emp1Last", "emp1Middle", date(1970, 6, 10), date(1999, 1, 1), 60000); + + IFullTimeEmployee emp2 = + factory.newFullTimeEmployee( + 2, "emp2First", "emp2Last", "emp2Middle", date(1975, 12, 22), date(2003, 7, 1), 47000); + + IFullTimeEmployee emp3 = + factory.newFullTimeEmployee( + 3, "emp3First", "emp3Last", "emp3Middle", date(1972, 7, 5), date(2002, 8, 15), 67.00); + + IFullTimeEmployee emp4 = + factory.newFullTimeEmployee( + 4, "emp4First", "emp4Last", "emp4Middle", date(1973, 7, 6), date(2001, 4, 15), 37.00); + + IFullTimeEmployee emp5 = + factory.newFullTimeEmployee( + 5, "emp5First", "emp5Last", "emp5Middle", date(1962, 7, 5), date(1998, 8, 15), 73000); + + emp1.setWeeklyhours(40); + emp1.setDepartment(dept1); + emp1.setFundingDept(dept2); + emp1.setManager(emp2); + emp1.setHradvisor(emp5); + + emp2.setWeeklyhours(40); + emp2.setDepartment(dept1); + emp2.setFundingDept(dept1); + emp2.setHradvisor(emp5); + emp2.setTeam(toSet(emp1, emp3, emp4, emp5)); + + emp3.setWeeklyhours(19); + emp3.setDepartment(dept1); + emp3.setFundingDept(dept1); + emp3.setManager(emp2); + emp3.setHradvisor(emp5); + + emp4.setDepartment(dept2); + emp4.setFundingDept(dept2); + emp4.setManager(emp2); + emp4.setHradvisor(emp5); + + emp5.setDepartment(dept2); + emp5.setFundingDept(dept2); + emp5.setManager(emp2); + emp5.setHradvisees(toSet(emp1, emp2, emp3, emp4)); + + dept1.setEmployees(toList(emp1, emp2, emp3)); + dept2.setEmployees(toList(emp4, emp5)); + + // Register named objects + + registry.register("company1", company1); + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/CompanyModelReader.java b/tck/src/main/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/CompanyModelReader.java index 80ac84b40..3bff8a4e8 100644 --- a/tck/src/main/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/CompanyModelReader.java +++ b/tck/src/main/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/CompanyModelReader.java @@ -18,77 +18,29 @@ package org.apache.jdo.tck.pc.companyMapWithoutJoin; import java.util.Date; -import java.util.List; import java.util.Locale; import org.apache.jdo.tck.util.ConversionHelper; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; import org.apache.jdo.tck.util.JDOCustomDateEditor; -import org.springframework.beans.factory.support.DefaultListableBeanFactory; -import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; -import org.springframework.core.io.ClassPathResource; /** - * Utility class to create a graph of company model instances from an xml representation. + * Utility class to create a graph of company model instances. * * @author Michael Bouschen */ -public class CompanyModelReader extends DefaultListableBeanFactory { - - private static final long serialVersionUID = 1L; - - /** 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"; +public class CompanyModelReader extends DefaultListableInstanceFactory { /** The company factory instance. */ private CompanyFactory companyFactory; - /** Bean definition reader */ - private final XmlBeanDefinitionReader reader; - /** * Create a CompanyModelReader for the specified resourceName. * * @param resourceName the name of the resource */ public CompanyModelReader(String resourceName) { - // Use the class loader of the Company class to find the resource - this(resourceName, Company.class.getClassLoader()); - } - - /** - * Create a CompanyModelReader for the specified resourceName. - * - * @param resourceName the name of the resource - * @param classLoader the ClassLoader for the lookup - */ - public CompanyModelReader(String resourceName, ClassLoader classLoader) { - super(); - configureFactory(); - this.reader = new XmlBeanDefinitionReader(this); - this.reader.loadBeanDefinitions(new ClassPathResource(resourceName, classLoader)); - } - - /** - * 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 - */ - @SuppressWarnings("unchecked") - public List getRootList() { - return (List) getBean(ROOT_LIST_NAME); - } - - /** - * Configure the CompanyModelReader, e.g. register CustomEditor classes to convert the string - * representation of a property into an instance of the right type. - */ - private void configureFactory() { - registerCustomEditor(Date.class, JDOCustomDateEditor.class); companyFactory = CompanyFactoryRegistry.getInstance(); - addSingleton(BEAN_FACTORY_NAME, companyFactory); + getDataSource(resourceName).init(companyFactory, this); } // Convenience methods diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/CompanyModelTestData.java b/tck/src/main/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/CompanyModelTestData.java new file mode 100644 index 000000000..8984e8fd6 --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/CompanyModelTestData.java @@ -0,0 +1,138 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.companyMapWithoutJoin; + +import static org.apache.jdo.tck.util.DataSourceUtil.date; +import static org.apache.jdo.tck.util.DataSourceUtil.toMap; +import static org.apache.jdo.tck.util.DataSourceUtil.toSet; + +import org.apache.jdo.tck.util.DataSource; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; + +/** + * Utility class to create a graph of company model instances. + * + * @author Tilmann Zäschke + */ +public class CompanyModelTestData implements DataSource { + + /** Company instances for CompletenessTest with Map without join table. */ + @Override + public void init(CompanyFactory factory, DefaultListableInstanceFactory registry) { + + // Instances / Constructors + + ICompany company1 = factory.newCompany(1L, "Sun Microsystems, Inc.", date(1952, 4, 11)); + + IDepartment dept1 = factory.newDepartment(1, "Development", company1); + IDepartment dept2 = factory.newDepartment(2, "Human Resources", company1); + company1.setDepartments(toSet(dept1, dept2)); + + IFullTimeEmployee emp1 = + factory.newFullTimeEmployee( + 1, + "emp1First", + "emp1Last", + "emp1Middle", + date(1970, 6, 10), + date(1999, 1, 1), + "role1", + 60000); + + IFullTimeEmployee emp2 = + factory.newFullTimeEmployee( + 2, + "emp2First", + "emp2Last", + "emp2Middle", + date(1975, 12, 22), + date(2003, 7, 1), + "role2", + 47000); + + IFullTimeEmployee emp3 = + factory.newFullTimeEmployee( + 3, + "emp3First", + "emp3Last", + "emp3Middle", + date(1972, 7, 5), + date(2002, 8, 15), + "role3", + 67.00); + + IFullTimeEmployee emp4 = + factory.newFullTimeEmployee( + 4, + "emp4First", + "emp4Last", + "emp4Middle", + date(1973, 7, 6), + date(2001, 4, 15), + "role4", + 37.00); + + IFullTimeEmployee emp5 = + factory.newFullTimeEmployee( + 5, + "emp5First", + "emp5Last", + "emp5Middle", + date(1962, 7, 5), + date(1998, 8, 15), + "role5", + 73000); + + // Properties + + emp1.setWeeklyhours(40); + emp1.setDepartment(dept1); + emp1.setFundingDept(dept2); + emp1.setManager(emp2); + emp1.setHradvisor(emp5); + + emp2.setWeeklyhours(40); + emp2.setDepartment(dept1); + emp2.setFundingDept(dept1); + emp2.setHradvisor(emp5); + emp2.setTeam(toSet(emp1, emp3, emp4, emp5)); + + emp3.setWeeklyhours(19); + emp3.setDepartment(dept1); + emp3.setFundingDept(dept1); + emp3.setManager(emp2); + emp3.setHradvisor(emp5); + + emp4.setDepartment(dept2); + emp4.setFundingDept(dept2); + emp4.setManager(emp2); + emp4.setHradvisor(emp5); + + emp5.setDepartment(dept2); + emp5.setFundingDept(dept2); + emp5.setManager(emp2); + emp5.setHradvisees(toSet(emp1, emp2, emp3, emp4)); + + dept1.setRoles(toMap(IEmployee::getRole, emp1, emp2, emp3)); + dept2.setRoles(toMap(IEmployee::getRole, emp4, emp5)); + + // Register named objects + + registry.register("company1", company1); + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/mylib/MylibReader.java b/tck/src/main/java/org/apache/jdo/tck/pc/mylib/MylibReader.java index 3751f078d..587095c69 100644 --- a/tck/src/main/java/org/apache/jdo/tck/pc/mylib/MylibReader.java +++ b/tck/src/main/java/org/apache/jdo/tck/pc/mylib/MylibReader.java @@ -17,69 +17,23 @@ package org.apache.jdo.tck.pc.mylib; -import java.util.Date; -import java.util.List; -import org.apache.jdo.tck.util.JDOCustomDateEditor; -import org.springframework.beans.factory.support.DefaultListableBeanFactory; -import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; -import org.springframework.core.io.ClassPathResource; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; -/** Utility class to create a mylib instances from an xml representation. */ -public class MylibReader extends DefaultListableBeanFactory { - - private static final long serialVersionUID = 1L; - - /** The name of the root list bean. */ - public static final String ROOT_LIST_NAME = "root"; +/** Utility class to create mylib test data instances. */ +public class MylibReader extends DefaultListableInstanceFactory { /** Teardown classes */ - @SuppressWarnings("rawtypes") private static final Class[] tearDownClasses = new Class[] {PrimitiveTypes.class, PCClass.class}; - /** Bean definition reader */ - private final XmlBeanDefinitionReader reader; - /** * Create a MylibReader for the specified resourceName. * * @param resourceName the name of the resource */ public MylibReader(String resourceName) { - // Use the class loader of the PrimitiveTypes class to find the resource - this(resourceName, PrimitiveTypes.class.getClassLoader()); - } - - /** - * Create a MylibReader for the specified resourceName. - * - * @param resourceName the name of the resource - * @param classLoader the ClassLoader for the lookup - */ - public MylibReader(String resourceName, ClassLoader classLoader) { super(); - configureFactory(); - this.reader = new XmlBeanDefinitionReader(this); - this.reader.loadBeanDefinitions(new ClassPathResource(resourceName, classLoader)); - } - - /** - * 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 - */ - @SuppressWarnings("unchecked") - public List getRootList() { - return (List) getBean(ROOT_LIST_NAME); - } - - /** - * Configure the MylibReader, e.g. register CustomEditor classes to convert the string - * representation of a property into an instance of the right type. - */ - private void configureFactory() { - registerCustomEditor(Date.class, JDOCustomDateEditor.class); + new MylibTestData().init(this, this); } // Convenience methods @@ -89,7 +43,7 @@ private void configureFactory() { * null if there is no Address bean with the specified name. * * @param name the name of the bean to return. - * @return the instance of the bean or null if there no Address bean. + * @return the instance of the bean or null if there is no Address bean. */ public PrimitiveTypes getPrimitiveTypes(String name) { return getBean(name, PrimitiveTypes.class); diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/mylib/MylibTestData.java b/tck/src/main/java/org/apache/jdo/tck/pc/mylib/MylibTestData.java new file mode 100644 index 000000000..599b981fa --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/pc/mylib/MylibTestData.java @@ -0,0 +1,71 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.mylib; + +import org.apache.jdo.tck.util.DataSource; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; + +/** Utility class to create a mylib instances for unit tests. */ +public class MylibTestData implements DataSource { + + @Override + public void init( + DefaultListableInstanceFactory factory, DefaultListableInstanceFactory registry) { + PrimitiveTypes primitiveTypesPositive = + new PrimitiveTypes( + 1L, + false, + null, + (byte) 0, + null, + (short) 0, + null, + 4, + 4, + 4, + Long.valueOf(4), + 4.0f, + 4.0f, + 4.0, + 4.0, + (char) 0, + null, + null, + null, + null, + null, + null); + PrimitiveTypes primitiveTypesNegative = + new PrimitiveTypes( + 2L, false, null, (byte) 0, null, (short) 0, null, -4, -4, -4, -4L, -4.0f, -4.0f, -4.0, + -4.0, (char) 0, null, null, null, null, null, null); + PCClass pcClass1 = new PCClass(1, 10, 10, 0, 0); + PCClass pcClass2 = new PCClass(2, 20, 20, 0, 0); + PrimitiveTypes primitiveTypesCharacterStringLiterals = + new PrimitiveTypes( + 3, false, null, (byte) 0, null, (short) 0, null, 0, null, 0, null, 0, null, 0, null, + (char) 0, (char) 0, null, "Even", null, null, null); + + registry.register("primitiveTypesPositive", primitiveTypesPositive); + registry.register("primitiveTypesNegative", primitiveTypesNegative); + registry.register("pcClass1", pcClass1); + registry.register("pcClass2", pcClass2); + registry.register( + "primitiveTypesCharacterStringLiterals", primitiveTypesCharacterStringLiterals); + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/mylib/PCClass.java b/tck/src/main/java/org/apache/jdo/tck/pc/mylib/PCClass.java index 207d9e660..4a33bd006 100644 --- a/tck/src/main/java/org/apache/jdo/tck/pc/mylib/PCClass.java +++ b/tck/src/main/java/org/apache/jdo/tck/pc/mylib/PCClass.java @@ -31,6 +31,14 @@ public class PCClass implements LoadCallback { public PCClass() {} + public PCClass(long id, int number1, int number2, int transientNumber1, int transientNumber2) { + this.id = id; + this.number1 = number1; + this.number2 = number2; + this.transientNumber1 = transientNumber1; + this.transientNumber2 = transientNumber2; + } + /** * @see LoadCallback#jdoPostLoad() */ diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/order/OrderModelReader.java b/tck/src/main/java/org/apache/jdo/tck/pc/order/OrderModelReader.java index e0be14b64..b3a064bfe 100644 --- a/tck/src/main/java/org/apache/jdo/tck/pc/order/OrderModelReader.java +++ b/tck/src/main/java/org/apache/jdo/tck/pc/order/OrderModelReader.java @@ -18,73 +18,25 @@ package org.apache.jdo.tck.pc.order; import java.util.Date; -import java.util.List; import java.util.Locale; import org.apache.jdo.tck.util.ConversionHelper; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; import org.apache.jdo.tck.util.JDOCustomDateEditor; -import org.springframework.beans.factory.support.DefaultListableBeanFactory; -import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; -import org.springframework.core.io.ClassPathResource; /** Utility class to create a graph of order model instances from an xml representation. */ -public class OrderModelReader extends DefaultListableBeanFactory { - - private static final long serialVersionUID = 1L; - - /** 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 = "orderFactory"; +public class OrderModelReader extends DefaultListableInstanceFactory { /** The order factory instance. */ private OrderFactory orderFactory; - /** Bean definition reader */ - private final XmlBeanDefinitionReader reader; - /** * Create a OrderModelReader for the specified resourceName. * * @param resourceName the name of the resource */ public OrderModelReader(String resourceName) { - // Use the class loader of the Order class to find the resource - this(resourceName, Order.class.getClassLoader()); - } - - /** - * Create a OrderModelReader for the specified resourceName. - * - * @param resourceName the name of the resource - * @param classLoader the ClassLOader for the lookup - */ - public OrderModelReader(String resourceName, ClassLoader classLoader) { - super(); - configureFactory(); - this.reader = new XmlBeanDefinitionReader(this); - this.reader.loadBeanDefinitions(new ClassPathResource(resourceName, classLoader)); - } - - /** - * 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 - */ - @SuppressWarnings("unchecked") - public List getRootList() { - return (List) getBean(ROOT_LIST_NAME); - } - - /** - * Configure the OrderModelReader, e.g. register CustomEditor classes to convert the string - * representation of a property into an instance of the right type. - */ - private void configureFactory() { - registerCustomEditor(Date.class, JDOCustomDateEditor.class); orderFactory = OrderFactoryRegistry.getInstance(); - addSingleton(BEAN_FACTORY_NAME, orderFactory); + getDataSource(resourceName).init(orderFactory, this); } // Convenience methods diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/order/OrderModelTestData.java b/tck/src/main/java/org/apache/jdo/tck/pc/order/OrderModelTestData.java new file mode 100644 index 000000000..6a204c079 --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/pc/order/OrderModelTestData.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.order; + +import static org.apache.jdo.tck.util.DataSourceUtil.toSet; + +import org.apache.jdo.tck.util.DataSource; +import org.apache.jdo.tck.util.DefaultListableInstanceFactory; + +/** Utility class to create a graph of order model instances. */ +public class OrderModelTestData implements DataSource { + + @Override + public void init(OrderFactory factory, DefaultListableInstanceFactory registry) { + Order order1 = factory.newOrder(1, 3); + OrderItem item1 = factory.newOrderItem(order1, 1, "SunRay", 15); + OrderItem item2 = factory.newOrderItem(order1, 1, "Sun Ultra 40", 3); + order1.setItems(toSet(item1, item2)); + registry.register("order1", order1); + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/query/QueryTest.java b/tck/src/main/java/org/apache/jdo/tck/query/QueryTest.java index a4ab73f57..c99838436 100644 --- a/tck/src/main/java/org/apache/jdo/tck/query/QueryTest.java +++ b/tck/src/main/java/org/apache/jdo/tck/query/QueryTest.java @@ -50,11 +50,10 @@ public abstract class QueryTest extends AbstractReaderTest { public static final String SERIALZED_QUERY = "query.ser"; /** */ - public static final String COMPANY_TESTDATA = - "org/apache/jdo/tck/pc/company/companyForQueryTests.xml"; + public static final String COMPANY_TESTDATA = "org.apache.jdo.tck.pc.company.data.QueryTestData"; /** */ - public static final String MYLIB_TESTDATA = "org/apache/jdo/tck/pc/mylib/mylibForQueryTests.xml"; + public static final String MYLIB_TESTDATA = "org.apache.jdo.tck.pc.mylib.MylibTestData"; /** List of inserted instances (see methods insertPCPoints and getFromInserted). */ protected final List persistentPCPoints = new ArrayList<>(); diff --git a/tck/src/main/java/org/apache/jdo/tck/query/api/SampleModifyQueries.java b/tck/src/main/java/org/apache/jdo/tck/query/api/SampleModifyQueries.java index 851018c5b..c6b2da3ad 100644 --- a/tck/src/main/java/org/apache/jdo/tck/query/api/SampleModifyQueries.java +++ b/tck/src/main/java/org/apache/jdo/tck/query/api/SampleModifyQueries.java @@ -54,7 +54,7 @@ public class SampleModifyQueries extends QueryTest { /** */ private static final String SAMPLE_QUERIES_TEST_COMPANY_TESTDATA = - "org/apache/jdo/tck/pc/company/companyForSampleQueriesTest.xml"; + "org.apache.jdo.tck.pc.company.data.SampleQueryTestData"; /** * Deleting Multiple Instances. diff --git a/tck/src/main/java/org/apache/jdo/tck/query/api/SampleReadQueries.java b/tck/src/main/java/org/apache/jdo/tck/query/api/SampleReadQueries.java index a533a415c..5199961b0 100644 --- a/tck/src/main/java/org/apache/jdo/tck/query/api/SampleReadQueries.java +++ b/tck/src/main/java/org/apache/jdo/tck/query/api/SampleReadQueries.java @@ -74,7 +74,7 @@ public class SampleReadQueries extends QueryTest { /** */ private static final String SAMPLE_QUERIES_TEST_COMPANY_TESTDATA = - "org/apache/jdo/tck/pc/company/companyForSampleQueriesTest.xml"; + "org.apache.jdo.tck.pc.company.data.SampleQueryTestData"; private static final String SINGLE_STRING_QUERY_01 = "select from org.apache.jdo.tck.pc.company.FullTimeEmployee where salary > 30000"; diff --git a/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationComparisonWithNull.java b/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationComparisonWithNull.java index 403ca5f62..b992447c1 100644 --- a/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationComparisonWithNull.java +++ b/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationComparisonWithNull.java @@ -50,7 +50,7 @@ public class NavigationComparisonWithNull extends QueryTest { /** */ public static final String NAVIGATION_TEST_COMPANY_TESTDATA = - "org/apache/jdo/tck/pc/company/companyForNavigationTests.xml"; + "org.apache.jdo.tck.pc.company.data.NavigationTestData"; /** * Returns the name of the company test data resource. diff --git a/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationThroughACollectionField.java b/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationThroughACollectionField.java index aadee8126..0e67fc8dd 100644 --- a/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationThroughACollectionField.java +++ b/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationThroughACollectionField.java @@ -43,7 +43,7 @@ public class NavigationThroughACollectionField extends QueryTest { /** */ public static final String NAVIGATION_TEST_COMPANY_TESTDATA = - "org/apache/jdo/tck/pc/company/companyForNavigationTests.xml"; + "org.apache.jdo.tck.pc.company.data.NavigationTestData"; /** * Returns the name of the company test data resource. diff --git a/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationThroughANullValuedField.java b/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationThroughANullValuedField.java index e595a0462..8f0bd8910 100644 --- a/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationThroughANullValuedField.java +++ b/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationThroughANullValuedField.java @@ -52,7 +52,7 @@ public class NavigationThroughANullValuedField extends QueryTest { /** */ public static final String NAVIGATION_TEST_COMPANY_TESTDATA = - "org/apache/jdo/tck/pc/company/companyForNavigationTests.xml"; + "org.apache.jdo.tck.pc.company.data.NavigationTestData"; /** * Returns the name of the company test data resource. diff --git a/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationThroughReferencesUsesDotOperator.java b/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationThroughReferencesUsesDotOperator.java index 98755d04e..85b8d8374 100644 --- a/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationThroughReferencesUsesDotOperator.java +++ b/tck/src/main/java/org/apache/jdo/tck/query/jdoql/NavigationThroughReferencesUsesDotOperator.java @@ -50,7 +50,7 @@ public class NavigationThroughReferencesUsesDotOperator extends QueryTest { /** */ public static final String NAVIGATION_TEST_COMPANY_TESTDATA = - "org/apache/jdo/tck/pc/company/companyForNavigationTests.xml"; + "org.apache.jdo.tck.pc.company.data.NavigationTestData"; /** * Returns the name of the company test data resource. diff --git a/tck/src/main/java/org/apache/jdo/tck/query/jdoql/subqueries/SubqueriesTest.java b/tck/src/main/java/org/apache/jdo/tck/query/jdoql/subqueries/SubqueriesTest.java index fd4cf55a7..0a219a345 100644 --- a/tck/src/main/java/org/apache/jdo/tck/query/jdoql/subqueries/SubqueriesTest.java +++ b/tck/src/main/java/org/apache/jdo/tck/query/jdoql/subqueries/SubqueriesTest.java @@ -28,7 +28,7 @@ public abstract class SubqueriesTest extends QueryTest { /** */ public static final String SUBQUERIES_TEST_COMPANY_TESTDATA = - "org/apache/jdo/tck/pc/company/companyForSubqueriesTests.xml"; + "org.apache.jdo.tck.pc.company.data.SubqueryTestData"; /** * Returns the name of the company test data resource. diff --git a/tck/src/main/java/org/apache/jdo/tck/query/jdoql/variables/StringVariables.java b/tck/src/main/java/org/apache/jdo/tck/query/jdoql/variables/StringVariables.java index be48e185e..0f67a28e6 100644 --- a/tck/src/main/java/org/apache/jdo/tck/query/jdoql/variables/StringVariables.java +++ b/tck/src/main/java/org/apache/jdo/tck/query/jdoql/variables/StringVariables.java @@ -49,7 +49,7 @@ public class StringVariables extends QueryTest { /** */ private static final String SAMPLE_QUERIES_TEST_COMPANY_TESTDATA = - "org/apache/jdo/tck/pc/company/companyForSampleQueriesTest.xml"; + "org.apache.jdo.tck.pc.company.data.SampleQueryTestData"; private static final String COLLECTION_STRING_VARIABLE_SSQ = "select from org.apache.jdo.tck.pc.company.FullTimeEmployee " diff --git a/tck/src/main/java/org/apache/jdo/tck/util/DataSource.java b/tck/src/main/java/org/apache/jdo/tck/util/DataSource.java new file mode 100644 index 000000000..97016dc00 --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/util/DataSource.java @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.util; + +/** + * Common interface for classes that generate data for tests. + * + * @param Factory class. + */ +public interface DataSource { + /** + * Implementations should generate test data objects and register them with the registry. + * + *

The "init()" Methods are usually structured as follows:
+ * - Creation of all instances, using the factory if one is available.
+ * - Setting of all properties of all instances.
+ * - Registration of instance with names (root names and bean names) insofar as it is required by + * the tests.
+ * + *

The test class name is usually given as argument to the constructor of the factory class. + * Often the name is read from the "org.tck.testdata" property in the config files. + * + * @param factory Factory instance. May be "null" if no factory is used. + * @param registry Registry for named objects (formerly "roots" and "beans"). + */ + void init(F factory, DefaultListableInstanceFactory registry); +} diff --git a/tck/src/main/java/org/apache/jdo/tck/util/DataSourceUtil.java b/tck/src/main/java/org/apache/jdo/tck/util/DataSourceUtil.java new file mode 100644 index 000000000..4e325a44e --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/util/DataSourceUtil.java @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * https://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.util; + +import java.util.Arrays; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Function; +import java.util.stream.Collectors; + +public interface DataSourceUtil { + + static Date date(int y, int m, int d) { + return new GregorianCalendar(y, m - 1, d, 0, 0, 0).getTime(); + } + + @SafeVarargs + static List toList(T... objs) { + return Arrays.stream(objs).collect(Collectors.toList()); + } + + static Map toMap(String... objs) { + Map map = new HashMap<>(); + for (int i = 0; i < objs.length; i += 2) { + map.put(objs[i], objs[i + 1]); + } + return map; + } + + static Map toMap(Function keyFn, V... objs) { + Map map = new HashMap<>(); + for (int i = 0; i < objs.length; i++) { + map.put(keyFn.apply(objs[i]), objs[i]); + } + return map; + } + + @SafeVarargs + static Set toSet(T... objs) { + return Arrays.stream(objs).collect(Collectors.toSet()); + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/util/DefaultListableInstanceFactory.java b/tck/src/main/java/org/apache/jdo/tck/util/DefaultListableInstanceFactory.java new file mode 100644 index 000000000..bee9e272f --- /dev/null +++ b/tck/src/main/java/org/apache/jdo/tck/util/DefaultListableInstanceFactory.java @@ -0,0 +1,56 @@ +package org.apache.jdo.tck.util; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; + +public class DefaultListableInstanceFactory { + + private final HashMap rootMap = new HashMap<>(); + private final List rootList = new ArrayList<>(); + + public final synchronized Object getBean(String name) { + if ("root".equals(name)) { + return getRootList(); + } + return rootMap.get(name); + } + + public final synchronized T getBean(String name, Class clazz) { + return clazz.cast(getBean(name)); + } + + public synchronized void register(String name, Object obj) { + rootMap.put(name, obj); + rootList.add(obj); + } + + /** + * 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 final synchronized List getRootList() { + return Collections.unmodifiableList(rootList); + } + + @SuppressWarnings("unchecked") + public static DataSource getDataSource(String resourceName) { + try { + Class> cls = (Class>) Class.forName(resourceName); + Constructor> cstr = cls.getConstructor(); + return cstr.newInstance(); + } catch (ClassNotFoundException + | InvocationTargetException + | NoSuchMethodException + | InstantiationException + | IllegalAccessException + | NullPointerException e) { + throw new IllegalArgumentException("Error executing test data class: " + resourceName, e); + } + } +} diff --git a/tck/src/main/java/org/apache/jdo/tck/util/JDOCustomDateEditor.java b/tck/src/main/java/org/apache/jdo/tck/util/JDOCustomDateEditor.java index 124d14698..c58ef43b0 100644 --- a/tck/src/main/java/org/apache/jdo/tck/util/JDOCustomDateEditor.java +++ b/tck/src/main/java/org/apache/jdo/tck/util/JDOCustomDateEditor.java @@ -19,20 +19,16 @@ import java.text.SimpleDateFormat; import java.util.Date; -import java.util.Locale; -import org.springframework.beans.propertyeditors.CustomDateEditor; -public class JDOCustomDateEditor extends CustomDateEditor { +public class JDOCustomDateEditor { /** The format of date values in the xml representation */ public static final String DATE_PATTERN = "d/MMM/yyyy"; - public JDOCustomDateEditor() { - super(new SimpleDateFormat(DATE_PATTERN, Locale.US), true); - } + private JDOCustomDateEditor() {} /** - * Redturs a string representation of the specified date using DATE_PATTERN as date formatter + * Returns a string representation of the specified date using DATE_PATTERN as date formatter * pattern. * * @param date the date diff --git a/tck/src/main/java/org/apache/jdo/tck/util/jndi/MockContext.java b/tck/src/main/java/org/apache/jdo/tck/util/jndi/MockContext.java index 3a469a987..61a106a1a 100644 --- a/tck/src/main/java/org/apache/jdo/tck/util/jndi/MockContext.java +++ b/tck/src/main/java/org/apache/jdo/tck/util/jndi/MockContext.java @@ -19,7 +19,13 @@ import java.util.Hashtable; import java.util.Map; -import javax.naming.*; +import javax.naming.Binding; +import javax.naming.Context; +import javax.naming.Name; +import javax.naming.NameClassPair; +import javax.naming.NameParser; +import javax.naming.NamingEnumeration; +import javax.naming.NamingException; public class MockContext implements Context { private final Map map; diff --git a/tck/src/main/resources/conf/company1-1Relationships.conf b/tck/src/main/resources/conf/company1-1Relationships.conf index 2bd5652f5..ce797d143 100644 --- a/tck/src/main/resources/conf/company1-1Relationships.conf +++ b/tck/src/main/resources/conf/company1-1Relationships.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with 1-1 relationships. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/company1-1Relationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.Relationships1_1Data jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/company1-MRelationships.conf b/tck/src/main/resources/conf/company1-MRelationships.conf index 825f3aa6f..189fb9feb 100644 --- a/tck/src/main/resources/conf/company1-MRelationships.conf +++ b/tck/src/main/resources/conf/company1-MRelationships.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with 1-M relationships. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/company1-MRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.Relationships1_MData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAllRelationships.conf b/tck/src/main/resources/conf/companyAllRelationships.conf index 606ccce93..b9d944075 100644 --- a/tck/src/main/resources/conf/companyAllRelationships.conf +++ b/tck/src/main/resources/conf/companyAllRelationships.conf @@ -17,6 +17,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata wi and embedded objects. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotated1-1RelationshipsFCPM.conf b/tck/src/main/resources/conf/companyAnnotated1-1RelationshipsFCPM.conf index f4d91eef3..f71ff09a5 100644 --- a/tck/src/main/resources/conf/companyAnnotated1-1RelationshipsFCPM.conf +++ b/tck/src/main/resources/conf/companyAnnotated1-1RelationshipsFCPM.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with 1-1 relationships, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/company1-1Relationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.Relationships1_1Data jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotated1-MRelationshipsFCPM.conf b/tck/src/main/resources/conf/companyAnnotated1-MRelationshipsFCPM.conf index 19bdea0a8..550d7aa56 100644 --- a/tck/src/main/resources/conf/companyAnnotated1-MRelationshipsFCPM.conf +++ b/tck/src/main/resources/conf/companyAnnotated1-MRelationshipsFCPM.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with 1-M relationships, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/company1-MRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.Relationships1_MData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsFCConcrete.conf b/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsFCConcrete.conf index 436322a8a..5c32eea5e 100644 --- a/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsFCConcrete.conf +++ b/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsFCConcrete.conf @@ -17,6 +17,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata wi and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCConcreteDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsFCPM.conf b/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsFCPM.conf index 181a879c3..46f51d7d1 100644 --- a/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsFCPM.conf +++ b/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsFCPM.conf @@ -17,6 +17,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata wi and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsJPAConcrete.conf b/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsJPAConcrete.conf index 4013a7760..d7232287c 100644 --- a/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsJPAConcrete.conf +++ b/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsJPAConcrete.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with M-M relationships, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedJPA.CompanyFactoryAnnotatedJPAAppConcrete jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTestJPA -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsJPAPM.conf b/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsJPAPM.conf index 9ea828b01..97b6a0b24 100644 --- a/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsJPAPM.conf +++ b/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsJPAPM.conf @@ -17,6 +17,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata wi and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedJPA.CompanyFactoryAnnotatedJPAAppPM jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTestJPA -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsPCConcrete.conf b/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsPCConcrete.conf index 80d6057f8..395668767 100644 --- a/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsPCConcrete.conf +++ b/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsPCConcrete.conf @@ -17,6 +17,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata wi and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedPC.CompanyFactoryAnnotatedPCConcreteDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsPCPM.conf b/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsPCPM.conf index 7fd69991c..8f891e6a1 100644 --- a/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsPCPM.conf +++ b/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsPCPM.conf @@ -17,6 +17,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata wi and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedPC.CompanyFactoryAnnotatedPCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsPIPM.conf b/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsPIPM.conf index 8f36c466c..01070bb01 100644 --- a/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsPIPM.conf +++ b/tck/src/main/resources/conf/companyAnnotatedAllRelationshipsPIPM.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedPI.CompanyFactoryAnnotatedPIPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedEmbeddedFCPM.conf b/tck/src/main/resources/conf/companyAnnotatedEmbeddedFCPM.conf index ac4402d7c..b1a60a192 100644 --- a/tck/src/main/resources/conf/companyAnnotatedEmbeddedFCPM.conf +++ b/tck/src/main/resources/conf/companyAnnotatedEmbeddedFCPM.conf @@ -17,6 +17,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata wi and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyEmbedded.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.EmbeddedTestData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedEmbeddedJPAConcrete.conf b/tck/src/main/resources/conf/companyAnnotatedEmbeddedJPAConcrete.conf index 8bb34979e..99d56c55b 100644 --- a/tck/src/main/resources/conf/companyAnnotatedEmbeddedJPAConcrete.conf +++ b/tck/src/main/resources/conf/companyAnnotatedEmbeddedJPAConcrete.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedJPA.CompanyFactoryAnnotatedJPAAppConcrete jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTestJPA -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyEmbedded.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.EmbeddedTestData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedEmbeddedJPAPM.conf b/tck/src/main/resources/conf/companyAnnotatedEmbeddedJPAPM.conf index bd77aacae..661472359 100644 --- a/tck/src/main/resources/conf/companyAnnotatedEmbeddedJPAPM.conf +++ b/tck/src/main/resources/conf/companyAnnotatedEmbeddedJPAPM.conf @@ -17,6 +17,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata wi and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedJPA.CompanyFactoryAnnotatedJPAAppPM jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTestJPA -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyEmbedded.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.EmbeddedTestData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedM-MRelationshipsFCConcrete.conf b/tck/src/main/resources/conf/companyAnnotatedM-MRelationshipsFCConcrete.conf index 86bed6e45..9b8dbd8be 100644 --- a/tck/src/main/resources/conf/companyAnnotatedM-MRelationshipsFCConcrete.conf +++ b/tck/src/main/resources/conf/companyAnnotatedM-MRelationshipsFCConcrete.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with M-M relationships, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCConcreteDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyM-MRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsM_MData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedM-MRelationshipsFCPM.conf b/tck/src/main/resources/conf/companyAnnotatedM-MRelationshipsFCPM.conf index 366248808..3b1f7501d 100644 --- a/tck/src/main/resources/conf/companyAnnotatedM-MRelationshipsFCPM.conf +++ b/tck/src/main/resources/conf/companyAnnotatedM-MRelationshipsFCPM.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with M-M relationships, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyM-MRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsM_MData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsFCConcrete.conf b/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsFCConcrete.conf index d4522468b..02d7b2fee 100644 --- a/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsFCConcrete.conf +++ b/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsFCConcrete.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCConcreteDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsNoData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsFCPM.conf b/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsFCPM.conf index 51420f1cd..9661fd420 100644 --- a/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsFCPM.conf +++ b/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsFCPM.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsNoData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsPCConcrete.conf b/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsPCConcrete.conf index 3660eae0a..128375aed 100644 --- a/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsPCConcrete.conf +++ b/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsPCConcrete.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedPC.CompanyFactoryAnnotatedPCConcreteDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsNoData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsPCPM.conf b/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsPCPM.conf index 07486898f..79beac8bf 100644 --- a/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsPCPM.conf +++ b/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsPCPM.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedPC.CompanyFactoryAnnotatedPCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsNoData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsPIPM.conf b/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsPIPM.conf index 80e2edbc4..6fcfac286 100644 --- a/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsPIPM.conf +++ b/tck/src/main/resources/conf/companyAnnotatedNoRelationshipsPIPM.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedPI.CompanyFactoryAnnotatedPIPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsNoData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyEmbedded.conf b/tck/src/main/resources/conf/companyEmbedded.conf index e3ae8ac68..387061d1d 100644 --- a/tck/src/main/resources/conf/companyEmbedded.conf +++ b/tck/src/main/resources/conf/companyEmbedded.conf @@ -17,6 +17,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata wi and embedded objects. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyEmbedded.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.EmbeddedTestData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyListWithoutJoin.conf b/tck/src/main/resources/conf/companyListWithoutJoin.conf index 270ebc359..f3d8139b6 100644 --- a/tck/src/main/resources/conf/companyListWithoutJoin.conf +++ b/tck/src/main/resources/conf/companyListWithoutJoin.conf @@ -15,7 +15,7 @@ jdo.tck.description = Completeness test with companyListWithoutJoin model. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyListWithoutJoin.CompanyFactoryPMClass -jdo.tck.testdata = org/apache/jdo/tck/pc/companyListWithoutJoin/companyListWithoutJoin.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.companyListWithoutJoin.CompanyModelTestData jdo.tck.mapping = 10 jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTestList jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyM-MRelationships.conf b/tck/src/main/resources/conf/companyM-MRelationships.conf index 8f3faf168..07dd6f728 100644 --- a/tck/src/main/resources/conf/companyM-MRelationships.conf +++ b/tck/src/main/resources/conf/companyM-MRelationships.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with M-M relationships. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyM-MRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsM_MData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyMapWithoutJoin.conf b/tck/src/main/resources/conf/companyMapWithoutJoin.conf index 0bb2275f4..497888222 100644 --- a/tck/src/main/resources/conf/companyMapWithoutJoin.conf +++ b/tck/src/main/resources/conf/companyMapWithoutJoin.conf @@ -15,7 +15,7 @@ jdo.tck.description = Completeness test with companyMapWithoutJoin model. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryPMClass -jdo.tck.testdata = org/apache/jdo/tck/pc/companyMapWithoutJoin/companyMapWithoutJoin.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyModelTestData jdo.tck.mapping = 9 jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTestMap jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyNoRelationships.conf b/tck/src/main/resources/conf/companyNoRelationships.conf index d15599fed..dad6d6369 100644 --- a/tck/src/main/resources/conf/companyNoRelationships.conf +++ b/tck/src/main/resources/conf/companyNoRelationships.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsNoData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyOverrideAnnotatedAllRelationshipsFCPM.conf b/tck/src/main/resources/conf/companyOverrideAnnotatedAllRelationshipsFCPM.conf index 22c990310..c60cc6919 100644 --- a/tck/src/main/resources/conf/companyOverrideAnnotatedAllRelationshipsFCPM.conf +++ b/tck/src/main/resources/conf/companyOverrideAnnotatedAllRelationshipsFCPM.conf @@ -17,6 +17,6 @@ jdo.tck.description = Completeness test with mapping 11 overriding annotations, and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 11 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyPMClass.conf b/tck/src/main/resources/conf/companyPMClass.conf index 79480643a..f68662234 100644 --- a/tck/src/main/resources/conf/companyPMClass.conf +++ b/tck/src/main/resources/conf/companyPMClass.conf @@ -17,6 +17,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata wi and embedded objects. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.company.CompanyFactoryPMClass jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/companyPMInterface.conf b/tck/src/main/resources/conf/companyPMInterface.conf index 54dead410..949c2285a 100644 --- a/tck/src/main/resources/conf/companyPMInterface.conf +++ b/tck/src/main/resources/conf/companyPMInterface.conf @@ -17,6 +17,6 @@ jdo.tck.description = Completeness test with standard mapping, basic testdata wi and embedded objects. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.company.CompanyFactoryPMInterface jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/compoundIdentity.conf b/tck/src/main/resources/conf/compoundIdentity.conf index 8ac42ca8a..c3e9550a3 100644 --- a/tck/src/main/resources/conf/compoundIdentity.conf +++ b/tck/src/main/resources/conf/compoundIdentity.conf @@ -16,6 +16,6 @@ jdo.tck.description = Completeness test with standard mapping using order model for compound identity testing jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.order.OrderFactoryPMClass jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTestOrder -jdo.tck.testdata = org/apache/jdo/tck/pc/order/order.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.order.OrderModelTestData jdo.tck.mapping = 0 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/inheritance1.conf b/tck/src/main/resources/conf/inheritance1.conf index 8e89157b2..b228554a8 100644 --- a/tck/src/main/resources/conf/inheritance1.conf +++ b/tck/src/main/resources/conf/inheritance1.conf @@ -19,6 +19,6 @@ Each table contains columns for the declared fields. \ Inheritance strategy: new-table for all classes. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 1 jdo.tck.requiredOptions = javax.jdo.option.mapping.JoinedTablePerClass diff --git a/tck/src/main/resources/conf/inheritance2.conf b/tck/src/main/resources/conf/inheritance2.conf index 9adef2a5b..f83a94f95 100644 --- a/tck/src/main/resources/conf/inheritance2.conf +++ b/tck/src/main/resources/conf/inheritance2.conf @@ -26,7 +26,7 @@ and parttime employees. \ Inheritance strategy: new-table for all classes. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 2 jdo.tck.requiredOptions = javax.jdo.option.mapping.NonJoinedTablePerConcreteClass \ javax.jdo.option.mapping.RelationSubclassTable diff --git a/tck/src/main/resources/conf/inheritance3.conf b/tck/src/main/resources/conf/inheritance3.conf index 3a0e8a088..514daa890 100644 --- a/tck/src/main/resources/conf/inheritance3.conf +++ b/tck/src/main/resources/conf/inheritance3.conf @@ -21,7 +21,7 @@ Insurance has inheritance strategy "subclass-table". \ MedicalInsurance and DentalInsurance have inheritance strategy "new-table". jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 3 jdo.tck.requiredOptions = javax.jdo.option.mapping.JoinedTablePerConcreteClass \ javax.jdo.option.mapping.RelationSubclassTable diff --git a/tck/src/main/resources/conf/inheritance4.conf b/tck/src/main/resources/conf/inheritance4.conf index 5a69ffd87..72cf837d9 100644 --- a/tck/src/main/resources/conf/inheritance4.conf +++ b/tck/src/main/resources/conf/inheritance4.conf @@ -19,6 +19,6 @@ PartTimeEmployee, FullTimeEmployee, MedicalInsurance, and DentalInsurance \ have inheritance strategy "superclass-table". jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 4 jdo.tck.requiredOptions = diff --git a/tck/src/main/resources/conf/iut-log4j.properties b/tck/src/main/resources/conf/iut-log4j.properties index c0a4505f1..83dc64aa9 100644 --- a/tck/src/main/resources/conf/iut-log4j.properties +++ b/tck/src/main/resources/conf/iut-log4j.properties @@ -25,12 +25,6 @@ log4j.rootLogger = ERROR, TCK log4j.logger.org.apache.jdo.tck = INFO, TCK log4j.additivity.org.apache.jdo.tck = false -# SpringFramework loggers -log4j.logger.org.springframework = ERROR, TCK -log4j.additivity.org.springframework = false -log4j.logger.org.apache.jdo.tck.pc.company.CompanyModelReader = ERROR, TCK -log4j.logger.org.apache.jdo.tck.pc.mylib.MylibReader = ERROR, TCK - # TCK appenders log4j.appender.TCK = org.apache.jdo.tck.util.TCKFileAppender log4j.appender.TCK.File = tck.txt diff --git a/tck/src/main/resources/conf/iut-log4j2.xml b/tck/src/main/resources/conf/iut-log4j2.xml index ddb94cef0..faf7e9b0e 100644 --- a/tck/src/main/resources/conf/iut-log4j2.xml +++ b/tck/src/main/resources/conf/iut-log4j2.xml @@ -41,16 +41,7 @@ - - - - - - - - - - + diff --git a/tck/src/main/resources/conf/jdori-log4j2.xml b/tck/src/main/resources/conf/jdori-log4j2.xml index 853dcfd0c..2aa6cd8a6 100644 --- a/tck/src/main/resources/conf/jdori-log4j2.xml +++ b/tck/src/main/resources/conf/jdori-log4j2.xml @@ -41,16 +41,7 @@ - - - - - - - - - - + diff --git a/tck/src/main/resources/conf/logging.properties b/tck/src/main/resources/conf/logging.properties index 8dc631fa4..06ea4f6dd 100644 --- a/tck/src/main/resources/conf/logging.properties +++ b/tck/src/main/resources/conf/logging.properties @@ -40,11 +40,6 @@ # TCK logger org.apache.jdo.tck.level = INFO -# SpringFramework loggers -org.springframework.level = SEVERE -org.apache.jdo.tck.pc.company.CompanyModelReader.level = SEVERE -org.apache.jdo.tck.pc.mylib.MylibReader = SEVERE - org.apache.jdo.tck.util.TCKFileHandler.fileName = tck.txt org.apache.jdo.tck.util.TCKFileHandler.level = FINEST diff --git a/tck/src/main/resources/conf/relationshipAllRelationships.conf b/tck/src/main/resources/conf/relationshipAllRelationships.conf index 9704cdb6c..1761e23b8 100644 --- a/tck/src/main/resources/conf/relationshipAllRelationships.conf +++ b/tck/src/main/resources/conf/relationshipAllRelationships.conf @@ -16,7 +16,7 @@ jdo.tck.description = Managed relationship tests with standard mapping, \ basic testdata with all relationships. jdo.tck.mapping.companyfactory = -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsAllData jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = org.apache.jdo.tck.mapping.Relationship1To1AllRelationships \ diff --git a/tck/src/main/resources/conf/relationshipNoRelationships.conf b/tck/src/main/resources/conf/relationshipNoRelationships.conf index 09e744365..0c12b05a0 100644 --- a/tck/src/main/resources/conf/relationshipNoRelationships.conf +++ b/tck/src/main/resources/conf/relationshipNoRelationships.conf @@ -16,7 +16,7 @@ jdo.tck.description = Managed relationship tests with standard mapping, \ basic testdata with no relationships. jdo.tck.mapping.companyfactory = -jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml +jdo.tck.testdata = org.apache.jdo.tck.pc.company.data.RelationshipsNoData jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = org.apache.jdo.tck.mapping.Relationship1To1NoRelationships \ diff --git a/tck/src/main/resources/conf/security.policy b/tck/src/main/resources/conf/security.policy index 7ba11d365..a151e5ee3 100644 --- a/tck/src/main/resources/conf/security.policy +++ b/tck/src/main/resources/conf/security.policy @@ -18,26 +18,10 @@ grant codeBase "file:/D:/users\\michael\\.maven/repository/junit/jars/junit-3.8. permission java.io.FilePermission "${user.home}${/}junit.properties", "read"; }; -// Springbeans code base -grant codeBase "file:/D:/users\\michael\\.maven/repository/org.springframework/jars/spring-beans-2.0.jar" { - permission java.lang.RuntimePermission "accessDeclaredMembers"; - permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; - permission java.lang.RuntimePermission "getClassLoader"; -}; - -// Springcore code base -grant codeBase "file:/D:/users\\michael\\.maven/repository/org.springframework/jars/spring-core-2.0.jar" { - permission java.lang.RuntimePermission "accessDeclaredMembers"; -}; - // TCK test classes grant codeBase "file:/D:/projects/jdo/workspace/jdo/trunk/tck2/target/classes/-" { permission javax.jdo.spi.JDOPermission "closePersistenceManagerFactory"; permission javax.jdo.spi.JDOPermission "setStateManager"; -// needed for Springbeans - permission java.lang.RuntimePermission "accessDeclaredMembers"; - permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; - permission java.lang.RuntimePermission "getClassLoader"; }; // TCK PC enhanced classes diff --git a/tck/src/main/resources/conf/simplelog.properties b/tck/src/main/resources/conf/simplelog.properties index fa0bd8c8f..af1f1d5d0 100644 --- a/tck/src/main/resources/conf/simplelog.properties +++ b/tck/src/main/resources/conf/simplelog.properties @@ -31,10 +31,5 @@ org.apache.commons.logging.simplelog.defaultlog = error # TCK logger org.apache.commons.logging.simplelog.log.org.apache.jdo.tck = info -# SpringFramework loggers -org.apache.commons.logging.simplelog.log.org.springframework = error -org.apache.commons.logging.simplelog.log.org.apache.jdo.tck.pc.company.CompanyModelReader = error -org.apache.commons.logging.simplelog.log.org.apache.jdo.tck.pc.mylib.MylibReader = error - # JDO vendor specific loggers #org.apache.commons.logging.simplelog.log. = info diff --git a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/company1-1Relationships.xml b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/company1-1Relationships.xml deleted file mode 100644 index 9cb7ac029..000000000 --- a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/company1-1Relationships.xml +++ /dev/null @@ -1,239 +0,0 @@ - - - - - Company instances for CompletenessTest with 1-1 relationships - - - - - - - - - - - - - - - - - - - - - 1 - Sun Microsystems, Inc. - 11/Apr/1952 - - - - 1 - Development - - - - 2 - Human Resources - - - - 1 - emp1First - emp1Last - emp1Middle - 10/Jun/1970 - 1/Jan/1999 - 20000 - 40 - - - - - - - 2 - emp2First - emp2Last - emp2Middle - 22/Dec/1975 - 1/Jul/2003 - 10000 - 40 - - - - - - - 3 - emp3First - emp3Last - emp3Middle - 5/Sep/1972 - 15/Aug/2002 - 15 - 19 - - - - - - - 4 - emp4First - emp4Last - emp4Middle - 6/Sep/1973 - 15/Apr/2001 - 13 - - - - - - - 5 - emp5First - emp5Last - emp5Middle - 5/Jul/1962 - 15/Aug/1998 - 45000 - - - - - - - - 1 - Unter den Linden 1 - Berlin - - 12345 - Germany - - - 2 - Broadway 1 - New York - NY - 10000 - USA - - - 3 - Market St. - San Francisco - CA - 94102 - USA - - - - 1 - Carrier1 - PPO - - - - - 2 - Carrier2 - HMO - - - - - 3 - Carrier3 - HMO - - - - - 4 - Carrier4 - HMO - - - - - 5 - Carrier5 - HMO - - - - - 11 - Carrier1 - 99.999 - - - - - 12 - Carrier2 - 99.999 - - - - - 13 - Carrier3 - 99.999 - - - - - 14 - Carrier4 - 99.999 - - - - - 15 - Carrier5 - 99.999 - - - - - 1 - orange - 2500000.99 - - - 2 - blue - 50000.00 - - - 3 - green - 2000.99 - - - diff --git a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/company1-MRelationships.xml b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/company1-MRelationships.xml deleted file mode 100644 index c4fb6aeee..000000000 --- a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/company1-MRelationships.xml +++ /dev/null @@ -1,238 +0,0 @@ - - - - - Company instances for CompletenessTest with 1-m relationships - - - - - - - - - - - - - - - - - - 1 - Sun Microsystems, Inc. - 11/Apr/1952 - - - - - - - - - - 1 - Development - - - - - - - - - - - - - - - - - - 2 - Human Resources - - - - - - - - - - - - - - - - - - 1 - emp1First - emp1Last - emp1Middle - 10/Jun/1970 - 1/Jan/1999 - 20000 - 40 - - - - - - - 2 - emp2First - emp2Last - emp2Middle - 22/Dec/1975 - 1/Jul/2003 - 10000 - 40 - - - - - - - - - - - - - - 3 - emp3First - emp3Last - emp3Middle - 5/Sep/1972 - 15/Aug/2002 - 15 - 19 - - - - - - - 4 - emp4First - emp4Last - emp4Middle - 6/Sep/1973 - 15/Apr/2001 - 13 - - - - - - - 5 - emp5First - emp5Last - emp5Middle - 5/Jul/1962 - 15/Aug/1998 - 45000 - - - - - - - - - - - - - - - 1 - Unter den Linden 1 - Berlin - - 12345 - Germany - - - 2 - Broadway 1 - New York - NY - 10000 - USA - - - 3 - Market St. - San Francisco - CA - 94102 - USA - - - - 1 - Carrier1 - PPO - - - - 2 - Carrier2 - HMO - - - - 3 - Carrier2 - HMO - - - - 4 - Carrier2 - 99.999 - - - - 1 - orange - 2500000.99 - - - 2 - blue - 50000.00 - - - 3 - green - 2000.99 - - - diff --git a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyAllRelationships.xml b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyAllRelationships.xml deleted file mode 100644 index afc493719..000000000 --- a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyAllRelationships.xml +++ /dev/null @@ -1,406 +0,0 @@ - - - - - Company instances for CompletenessTest with all relationships - - - - - - - - - - - 1 - Sun Microsystems, Inc. - 11/Apr/1952 - - - - - - - - - - - 1 - Development - - - - - - - - - - - - - - - - - - - 2 - Human Resources - - - - - - - - - - - - - - - - - - 1 - emp1First - emp1Last - emp1Middle - 10/Jun/1970 - - 1/Jan/1999 - 20000 - 40 - - - - - 1111 - 123456-1 - - - - - - - - - - - - - - - - - - - - - 2 - emp2First - emp2Last - emp2Middle - 22/Dec/1975 - - 1/Jul/2003 - 10000 - 40 - - - - - 2222 - 123456-2 - - - - - - - - - - - - - - - - - - - - - - - - 3 - emp3First - emp3Last - emp3Middle - 5/Sep/1972 - - 15/Aug/2002 - 15 - 19 - - - - - 3333 - 123456-3 - - - - - - - - - - - - - - - - - 4 - emp4First - emp4Last - emp4Middle - 6/Sep/1973 - - 15/Apr/2001 - 13 - - - - - 3343 - 124456-3 - - - - - - - - - - - - - - - - - - - - - 5 - emp5First - emp5Last - emp5Middle - 5/Jul/1962 - - 15/Aug/1998 - 45000 - - - - - 3363 - 126456-3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - Unter den Linden 1 - Berlin - - 12345 - Germany - - - 2 - Broadway 1 - New York - NY - 10000 - USA - - - 3 - Market St. - San Francisco - CA - 94102 - USA - - - - 1 - Carrier1 - PPO - - - - - 2 - Carrier2 - HMO - - - - - 3 - Carrier3 - HMO - - - - - 4 - Carrier4 - HMO - - - - - 5 - Carrier5 - HMO - - - - - 11 - Carrier1 - 99.999 - - - - - 12 - Carrier2 - 99.999 - - - - - 13 - Carrier3 - 99.999 - - - - - 14 - Carrier4 - 99.999 - - - - - 15 - Carrier5 - 99.999 - - - - - 1 - orange - 2500000.99 - - - - - - - - - - 2 - blue - 50000.00 - - - - - - - - - - - - - - - 3 - green - 2000.99 - - - - - - - - - - - - - - diff --git a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyEmbedded.xml b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyEmbedded.xml deleted file mode 100644 index 41c3eab6c..000000000 --- a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyEmbedded.xml +++ /dev/null @@ -1,212 +0,0 @@ - - - - - Company instances for CompletenessTest with embedded relationships - - - - - - - - - - - - - - - - - - - - - - - - - 1 - Sun Microsystems, Inc. - 11/Apr/1952 - - - - - 1 - Development - - - - 2 - Human Resources - - - - 1 - emp1First - emp1Last - emp1Middle - 10/Jun/1970 - - 1/Jan/1999 - 20000 - 40 - - - 1111 - 123456-1 - - - - - 2 - emp2First - emp2Last - emp2Middle - 22/Dec/1975 - - 1/Jul/2003 - 10000 - 40 - - - 2222 - 123456-2 - - - - - 3 - emp3First - emp3Last - emp3Middle - 5/Sep/1972 - - 15/Aug/2002 - 15 - 19 - - - 3333 - 123456-3 - - - - - 4 - emp4First - emp4Last - emp4Middle - 6/Sep/1973 - - 15/Apr/2001 - 13 - - - 3343 - 124456-3 - - - - - 5 - emp5First - emp5Last - emp5Middle - 5/Jul/1962 - - 15/Aug/1998 - 45000 - - - 3363 - 126456-3 - - - - - - 1 - Unter den Linden 1 - Berlin - - 12345 - Germany - - - 2 - Broadway 1 - New York - NY - 10000 - USA - - - 3 - Market St. - San Francisco - CA - 94102 - USA - - - - 1 - Carrier1 - PPO - - - - 2 - Carrier2 - HMO - - - - 3 - Carrier2 - HMO - - - - 4 - Carrier2 - 99.999 - - - - 1 - orange - 2500000.99 - - - 2 - blue - 50000.00 - - - 3 - green - 2000.99 - - diff --git a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForNavigationTests.xml b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForNavigationTests.xml deleted file mode 100644 index 13a5b7b87..000000000 --- a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForNavigationTests.xml +++ /dev/null @@ -1,562 +0,0 @@ - - - - - Company instances for navigation query testing - - - - - - - - - - - - - 1 - Sun Microsystems, Inc. - 11/Apr/1952 - - - - - - - - - - - 1 - Comfy Room - - - 2 - Large Discussion Room - - - 3 - Conference Room - - - - 1 - Development - - - - - - - - - - - - - - - 2 - Human Resources - - - - - - - - - - - - - 0 - emp0First - emp0Last - emp0Middle - 10/Jul/1962 - - 1/Jan/1997 - 50000 - 40 - - - - - 3232 - 223311-1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - emp1First - emp1Last - emp1Middle - 10/Jun/1970 - - 1/Jan/1999 - 20000 - 40 - - - - - 1111 - 123456-1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 - emp2First - emp2Last - emp2Middle - 22/Dec/1975 - - 1/Jul/2003 - 10000 - 40 - - - - - 2222 - 123456-2 - - - - - - - - - - - - - - - - - - - 3 - emp3First - emp3Last - emp3Middle - 5/Sep/1972 - - 15/Aug/2002 - 15 - 19 - - - - - 3333 - 123456-3 - - - - - - - - - - - - - - - - - - - 4 - emp4First - emp4Last - emp4Middle - 6/Sep/1973 - - 15/Apr/2001 - 25000 - 40 - - - - - 3343 - 124456-3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - emp5First - emp5Last - emp5Middle - 5/Jul/1962 - - 1/Nov/2002 - 18000 - 35 - - - - - 3363 - 126456-3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 - emp6First - emp6Last - emp6Middle - 10/Jun/1969 - - 1/Jun/2002 - 22000 - 40 - - - - - - - 7 - emp7First - emp7Last - emp7Middle - 10/Jun/1970 - - 1/Jan/2000 - 40000 - 40 - - - - - - - - - - - - 8 - emp8First - emp8Last - emp8Middle - 22/Dec/1975 - - 1/Aug/2003 - 10000 - 15 - - - - - - - 9 - emp9First - emp9Last - emp9Middle - 5/Sep/1972 - - 1/May/2002 - 12000 - 20 - - - - - - - 10 - emp10First - emp10Last - emp10Middle - 5/Sep/1972 - - 1/Oct/2002 - 24000 - 40 - - - - - - - 1 - Unter den Linden 1 - Berlin - - 12345 - Germany - - - 2 - Broadway 1 - New York - NY - 10000 - USA - - - 3 - Market St. - San Francisco - CA - 94102 - USA - - - - 1 - Carrier1 - PPO - - - - - 2 - Carrier2 - HMO - - - - - 3 - Carrier3 - HMO - - - - - 4 - Carrier4 - HMO - - - - - 5 - Carrier5 - HMO - - - - - 98 - Carrier98 - HMO - - - - - 11 - Carrier1 - 99.995 - - - - - 12 - Carrier2 - 99.996 - - - - - 13 - Carrier3 - 99.997 - - - - - 14 - Carrier4 - 99.998 - - - - - 15 - Carrier5 - 99.999 - - - - - 99 - Carrier99 - - - - - - 1 - orange - 2500000.99 - - - - - - - - - - 2 - blue - 50000.00 - - - - - - - - - - - - - - - 3 - green - 2000.99 - - - - - - - - - - - - - - diff --git a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForQueryTests.xml b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForQueryTests.xml deleted file mode 100644 index 755351aca..000000000 --- a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForQueryTests.xml +++ /dev/null @@ -1,437 +0,0 @@ - - - - - Company instances for query testing - - - - - - - - - - - - 1 - Sun Microsystems, Inc. - 11/Apr/1952 - - - - - - - - - - - 1 - Comfy Room - - - 2 - Large Discussion Room - - - 3 - Conference Room - - - - 1 - Development - - - - - - - - - - - - - - - - - - - - - - - - - 2 - Human Resources - - - - - - - - - - - - - - - - - - - - - - 1 - emp1First - emp1Last - emp1Middle - 10/Jun/1970 - - 1/Jan/1999 - 20000 - 40 - - - - - 1111 - 123456-1 - - - - - - - - - - - - - - - - - - - - - 2 - emp2First - emp2Last - emp2Middle - 22/Dec/1975 - - 1/Jul/2003 - 10000 - 40 - - - - - 2222 - 123456-2 - - - - - - - - - - - - - - - - - - - - - - - - 3 - emp3First - emp3Last - emp3Middle - 5/Sep/1972 - - 15/Aug/2002 - 15 - 19 - - - - - 3333 - 123456-3 - - - - - - - - - - - - - - - - - 4 - emp4First - emp4Last - emp4Middle - 6/Sep/1973 - - 15/Apr/2001 - 13 - - - - - 3343 - 124456-3 - - - - - - - - - - - - - - - - - - - - - 5 - emp5First - emp5Last - emp5Middle - 5/Jul/1962 - - 15/Aug/1998 - 45000 - - - - - 3363 - 126456-3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - Unter den Linden 1 - Berlin - - 12345 - Germany - - - 2 - Broadway 1 - New York - NY - 10000 - USA - - - 3 - Market St. - San Francisco - CA - 94102 - USA - - - - 1 - Carrier1 - PPO - - - - - 2 - Carrier2 - HMO - - - - - 3 - Carrier3 - HMO - - - - - 4 - Carrier4 - HMO - - - - - 5 - Carrier5 - HMO - - - - - 11 - Carrier1 - 99.995 - - - - - 12 - Carrier2 - 99.996 - - - - - 13 - Carrier3 - 99.997 - - - - - 14 - Carrier4 - 99.998 - - - - - 15 - Carrier5 - 99.999 - - - - - 99 - Carrier99 - - - - - 1 - orange - 2500000.99 - - - - - - - - - - 2 - blue - 50000.00 - - - - - - - - - - - - - - - 3 - green - 2000.99 - - - - - - - - - - - - - - - diff --git a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForSampleQueriesTest.xml b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForSampleQueriesTest.xml deleted file mode 100644 index 82fe49736..000000000 --- a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForSampleQueriesTest.xml +++ /dev/null @@ -1,486 +0,0 @@ - - - - - Company instances for query testing - - - - - - - - - - - - 1 - Sun Microsystems, Inc. - 11/Apr/1952 - - - - - - - - - - - - 1 - Comfy Room - - - 2 - Large Discussion Room - - - 3 - Conference Room - - - - 1 - R&D - - - - - - - - - - - - - - - - - - - - - - - - - 2 - Sales - - - - - - - - - - - - - - - - - - - - - - 3 - Marketing - - - - - - - - - - - - - - - - - 1 - Michael - Bouschen - - 10/Jun/1970 - - 1/Jan/1999 - 40000 - 40 - - - - - 1111 - 123456-1 - - - - - German - English - - - - - - - - - - - - - - - - - - - - - 2 - Craig - L. - Russell - 22/Dec/1975 - - 1/Jul/2003 - 50000 - 40 - - - - - 2222 - 123456-2 - - - - - English - Japanese - - - - - - - - - - - - - - - - - - - - - - - - 3 - Joe - Doe - - 5/Sep/1972 - - 15/Aug/2002 - 15 - 19 - - - - - 3333 - 123456-3 - - - - - English - French - - - - - - - - - - - - - - - - - 4 - Jane - Roe - - 6/Sep/1973 - - 15/Apr/2001 - 13 - - - - - 3343 - 124456-3 - - - - - English - - - - - - - - - - - - - - - - - - - - - 5 - Tillmann - Zäschke - - 5/Jul/1979 - - 15/Aug/1999 - 45000 - - - - - 3363 - 126456-3 - - - - - German - English - French - Japanese - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - Unter den Linden 1 - Berlin - - 12345 - Germany - - - 2 - Broadway 1 - New York - NY - 10000 - USA - - - 3 - Market St. - San Francisco - CA - 94102 - USA - - - - 1 - Carrier1 - PPO - - - - - 2 - Carrier2 - HMO - - - - - 3 - Carrier3 - HMO - - - - - 4 - Carrier4 - HMO - - - - - 5 - Carrier5 - HMO - - - - - 11 - Carrier1 - 99.995 - - - - - 12 - Carrier2 - 99.996 - - - - - 13 - Carrier3 - 99.997 - - - - - 14 - Carrier4 - 99.998 - - - - - 15 - Carrier5 - 99.999 - - - - - 99 - Carrier99 - - - - - 1 - orange - 2500000.99 - - - - - - - - - - 2 - blue - 50000.00 - - - - - - - - - - - - - - - 3 - green - 2000.99 - - - - - - - - - - - - - - diff --git a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForSubqueriesTests.xml b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForSubqueriesTests.xml deleted file mode 100644 index 389bb7f53..000000000 --- a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForSubqueriesTests.xml +++ /dev/null @@ -1,282 +0,0 @@ - - - - - Company instances for query testing - - - - - - - - - - - 1 - Sun Microsystems, Inc. - 11/Apr/1952 - - - - - - - - - - - 1 - Comfy Room - - - 2 - Large Discussion Room - - - 3 - Conference Room - - - - 1 - Development - - - - - - - - - - - - - - - - - - - - - 2 - Human Resources - - - - - - - - - - - - - - - - - - 1 - emp1First - emp1Last - emp1Middle - 10/Jun/1970 - - 1/Jan/1999 - 30000 - 40 - - - - - - - - - - - - 2 - emp2First - emp2Last - emp2Middle - 22/Dec/1975 - - 1/Jul/2003 - 20000 - 40 - - - - - - 3 - emp3First - emp3Last - emp3Middle - 5/Sep/1972 - - 15/Aug/2002 - 10000 - 25 - - - - - - 4 - emp4First - emp4Last - emp4Middle - 6/Sep/1973 - - 15/Apr/2001 - 25000 - 40 - - - - - - - - - - - 5 - emp5First - emp5Last - emp5Middle - 5/Jul/1962 - - 1/Nov/2002 - 18000 - 35 - - - - - - 6 - emp6First - emp6Last - emp6Middle - 10/Jun/1969 - - 1/Jun/2002 - 22000 - 40 - - - - - - 7 - emp7First - emp7Last - emp7Middle - 10/Jun/1970 - - 1/Jan/2000 - 40000 - 40 - - - - - - - - - - - 8 - emp8First - emp8Last - emp8Middle - 22/Dec/1975 - - 1/Aug/2003 - 10000 - 15 - - - - - - 9 - emp9First - emp9Last - emp9Middle - 5/Sep/1972 - - 1/May/2002 - 12000 - 20 - - - - - - 10 - emp10First - emp10Last - emp10Middle - 5/Sep/1972 - - 1/Oct/2002 - 24000 - 40 - - - - - - - 1 - Unter den Linden 1 - Berlin - - 12345 - Germany - - - 2 - Broadway 1 - New York - NY - 10000 - USA - - - 3 - Market St. - San Francisco - CA - 94102 - USA - - - diff --git a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyM-MRelationships.xml b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyM-MRelationships.xml deleted file mode 100644 index 310d02848..000000000 --- a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyM-MRelationships.xml +++ /dev/null @@ -1,246 +0,0 @@ - - - - - Company instances for CompletenessTest with m-m relationships - - - - - - - - - - - - - - - - - - - - - - 1 - Sun Microsystems, Inc. - 11/Apr/1952 - - - - 1 - Development - - - - 2 - Human Resources - - - - 1 - emp1First - emp1Last - emp1Middle - 10/Jun/1970 - 1/Jan/1999 - 20000 - 40 - - - - - - - - - - - - - 2 - emp2First - emp2Last - emp2Middle - 22/Dec/1975 - 1/Jul/2003 - 10000 - 40 - - - - - - - - - 3 - emp3First - emp3Last - emp3Middle - 5/Sep/1972 - 15/Aug/2002 - 15 - 19 - - - - - - - - - 4 - emp4First - emp4Last - emp4Middle - 6/Sep/1973 - 15/Apr/2001 - 13 - - - - - - - - - - - - - 5 - emp5First - emp5Last - emp5Middle - 5/Jul/1962 - 15/Aug/1998 - 45000 - - - - - - - - - - - - - - 1 - Unter den Linden 1 - Berlin - - 12345 - Germany - - - 2 - Broadway 1 - New York - NY - 10000 - USA - - - 3 - Market St. - San Francisco - CA - 94102 - USA - - - - 1 - Carrier1 - PPO - - - - 2 - Carrier2 - HMO - - - - 3 - Carrier2 - HMO - - - - 4 - Carrier2 - 99.999 - - - - 1 - orange - 2500000.99 - - - - - - - - - - 2 - blue - 50000.00 - - - - - - - - - - - - - - - 3 - green - 2000.99 - - - - - - - - - - - - - - diff --git a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyNoRelationships.xml b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyNoRelationships.xml deleted file mode 100644 index 683c97718..000000000 --- a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyNoRelationships.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - Company instances for CompletenessTest with no relationships - - - - - - - - - - - - - - - - - - - - - - - - - 1 - Sun Microsystems, Inc. - 11/Apr/1952 - - - - 1 - Development - - - - 2 - Human Resources - - - - 1 - emp1First - emp1Last - emp1Middle - 10/Jun/1970 - 1/Jan/1999 - 20000 - 40 - - - 2 - emp2First - emp2Last - emp2Middle - 22/Dec/1975 - 1/Jul/2003 - 10000 - 40 - - - 3 - emp3First - emp3Last - emp3Middle - 5/Sep/1972 - 15/Aug/2002 - 15 - 19 - - - 4 - emp4First - emp4Last - emp4Middle - 6/Sep/1973 - 15/Apr/2001 - 13 - - - 5 - emp5First - emp5Last - emp5Middle - 5/Jul/1962 - 15/Aug/1998 - 45000 - - - - 1 - Carrier1 - PPO - - - - 2 - Carrier2 - HMO - - - - 3 - Carrier2 - HMO - - - - 4 - Carrier2 - 99.999 - - - - 1 - orange - 2500000.99 - - - 2 - blue - 50000.00 - - - 3 - green - 2000.99 - - - diff --git a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/companyListWithoutJoin/companyListWithoutJoin.xml b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/companyListWithoutJoin/companyListWithoutJoin.xml deleted file mode 100644 index f7a4c9f1f..000000000 --- a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/companyListWithoutJoin/companyListWithoutJoin.xml +++ /dev/null @@ -1,154 +0,0 @@ - - - - - Company instances for CompletenessTest with Map without join table - - - - - - - - - - - 1 - Sun Microsystems, Inc. - 11/Apr/1952 - - - - - - - - - - 1 - Development - - - - - - - - - - - - 2 - Human Resources - - - - - - - - - - - 1 - emp1First - emp1Last - emp1Middle - 10/Jun/1970 - 1/Jan/1999 - 60000 - 40 - - - - - - - 2 - emp2First - emp2Last - emp2Middle - 22/Dec/1975 - 1/Jul/2003 - 47000 - 40 - - - - - - - - - - - - - - 3 - emp3First - emp3Last - emp3Middle - 5/Sep/1972 - 15/Aug/2002 - 67.00 - 19 - - - - - - - 4 - emp4First - emp4Last - emp4Middle - 6/Sep/1973 - 15/Apr/2001 - 37.00 - - - - - - - 5 - emp5First - emp5Last - emp5Middle - 5/Jul/1962 - 15/Aug/1998 - 73000 - - - - - - - - - - - - - - - diff --git a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/companyMapWithoutJoin/companyMapWithoutJoin.xml b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/companyMapWithoutJoin/companyMapWithoutJoin.xml deleted file mode 100644 index 2909f7f5e..000000000 --- a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/companyMapWithoutJoin/companyMapWithoutJoin.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - Company instances for CompletenessTest with Map without join table - - - - - - - - - - - 1 - Sun Microsystems, Inc. - 11/Apr/1952 - - - - - - - - - - 1 - Development - - - - - - - - - - - - - - - - - - 2 - Human Resources - - - - - - - - - - - - - - - 1 - emp1First - emp1Last - emp1Middle - 10/Jun/1970 - 1/Jan/1999 - role1 - 60000 - 40 - - - - - - - 2 - emp2First - emp2Last - emp2Middle - 22/Dec/1975 - 1/Jul/2003 - role2 - 47000 - 40 - - - - - - - - - - - - - - 3 - emp3First - emp3Last - emp3Middle - 5/Sep/1972 - 15/Aug/2002 - role3 - 67.00 - 19 - - - - - - - 4 - emp4First - emp4Last - emp4Middle - 6/Sep/1973 - 15/Apr/2001 - role4 - 37.00 - - - - - - - 5 - emp5First - emp5Last - emp5Middle - 5/Jul/1962 - 15/Aug/1998 - role5 - 73000 - - - - - - - - - - - - - - - diff --git a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/mylib/mylibForQueryTests.xml b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/mylib/mylibForQueryTests.xml deleted file mode 100644 index ee000b321..000000000 --- a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/mylib/mylibForQueryTests.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - 1 - 4 - 4 - 4 - 4 - 4.0 - 4.0 - 4.0 - 4.0 - - - - 2 - -4 - -4 - -4 - -4 - -4.0 - -4.0 - -4.0 - -4.0 - - - - 1 - 10 - 10 - - - - 2 - 20 - 20 - - - - 3 - O - O - Even - - diff --git a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/order/order.xml b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/order/order.xml deleted file mode 100644 index ab37946df..000000000 --- a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/order/order.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - Order instances for CompletenessTest of compound identity - - - - - - - - - - - 1 - 3 - - - - - - - - - - - - 1 - - - SunRay - 15 - - - - - - - 1 - - - Sun Ultra 40 - 3 - - - - -