Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
03aa658
OrderTest w/o XML
tzaeschke Feb 27, 2025
e5fb41f
MyLibTest w/o XML - WIP
tzaeschke Feb 27, 2025
3e6b7d6
Fixed concurrency issue when running ResultClassRequirementsMap query…
tzaeschke Mar 2, 2025
75d4561
Fix query.conf failure
tzaeschke Mar 2, 2025
eb2e1ae
Fixed concurrency issue when running query.Variable test
tzaeschke Mar 2, 2025
3442b5b
QUeryTest with new factory
tzaeschke Mar 2, 2025
3d55f5c
Fix for result.Variable see JDO-851
tzaeschke Mar 2, 2025
5b6f8ac
Remove XML
tzaeschke Mar 2, 2025
bdfdb41
Remove XML
tzaeschke Mar 9, 2025
ffff786
Remove XML
tzaeschke Mar 10, 2025
f7530a3
Clean up
tzaeschke Apr 6, 2025
eca9295
Remove XML
tzaeschke May 29, 2025
296674b
Remove XML
tzaeschke May 29, 2025
fef00a0
Remove XML
tzaeschke May 29, 2025
35c07cd
Remove XML
tzaeschke May 29, 2025
ec74b30
QUERY_TEST
tzaeschke Jun 1, 2025
956a763
Tests pass except concurrent tests
tzaeschke Sep 22, 2025
d860450
Tests pass except concurrent tests
tzaeschke Sep 23, 2025
2844c89
SampleQuery works!
tzaeschke Oct 12, 2025
4a21242
NavigationTest works
tzaeschke Oct 12, 2025
9ec33ae
SubqueryTest works
tzaeschke Oct 12, 2025
6c9d3d6
EmbeddedTest works
tzaeschke Oct 12, 2025
12a0811
Update EmbeddedTestData.java
tzaeschke Oct 18, 2025
d2a8bdc
AllRelationshipsTest
tzaeschke Oct 19, 2025
461c82e
All tests migrated
tzaeschke Oct 23, 2025
0a135cf
Structure cleanup
tzaeschke Oct 23, 2025
f46c13e
Test class in conf files
tzaeschke Oct 26, 2025
35de9e2
Use jdo.tck.testdata
tzaeschke Oct 26, 2025
1d529e4
Prepare removal of XML files
tzaeschke Oct 26, 2025
d8e9d27
Prepare removal of XML files
tzaeschke Oct 26, 2025
81c1215
Prepare removal of XML files
tzaeschke Oct 26, 2025
33877ee
Prepare removal of XML files
tzaeschke Oct 26, 2025
a678427
Prepare removal of XML files
tzaeschke Oct 26, 2025
4114ad6
Prepare removal of XML files
tzaeschke Oct 26, 2025
1166fed
Prepare removal of XML files
tzaeschke Oct 26, 2025
67b2925
Prepare removal of XML files
tzaeschke Oct 26, 2025
f2aa6f2
Remove XML files
tzaeschke Oct 26, 2025
54c9406
Update Variable.java
tzaeschke Oct 26, 2025
19d6c66
Remove XML files
tzaeschke Oct 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ 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.standarddata : The fully qualified file name of the xml test data file(optional)
* jdo.tck.testdata : The fully qualified file name of the class that creates test data(optional)
* jdo.tck.standarddata : The fully qualified file 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

Expand Down
4 changes: 0 additions & 4 deletions exectck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@
<groupId>javax.jdo</groupId>
<artifactId>jdo-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
Expand Down
9 changes: 1 addition & 8 deletions exectck/src/main/java/org/apache/jdo/exectck/Enhance.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
6 changes: 0 additions & 6 deletions parent-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@
<version.javax.persistence>2.2.1</version.javax.persistence>
<version.derby>10.14.2.0</version.derby>
<version.commons-io>2.17.0</version.commons-io>
<version.spring-beans>5.3.39</version.spring-beans>
<version.commons-logging>1.2</version.commons-logging>
<version.glassfish-corba-omgapi>4.2.5</version.glassfish-corba-omgapi>
<version.maven-changes-plugin>2.12.1</version.maven-changes-plugin>
Expand Down Expand Up @@ -258,11 +257,6 @@
<artifactId>commons-io</artifactId>
<version>${version.commons-io}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${version.spring-beans}</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
Expand Down
4 changes: 0 additions & 4 deletions tck/RunRules.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@
<groupId>javax.transaction</groupId>
<artifactId>javax.transaction-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
Expand All @@ -92,9 +88,6 @@
<resource>
<directory>${basedir}/src/main/resources/sql</directory>
</resource>
<resource>
<directory>${basedir}/src/main/resources/testdata</directory>
</resource>
<resource>
<directory>${basedir}/src/main/resources/meta</directory>
</resource>
Expand Down
8 changes: 4 additions & 4 deletions tck/src/main/java/org/apache/jdo/tck/AbstractReaderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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> T getBean(
final DefaultListableBeanFactory factory, Class<T> clazz, final String name) {
final DefaultListableInstanceFactory factory, Class<T> clazz, final String name) {
return doPrivileged(() -> factory.getBean(name, clazz));
}

Expand All @@ -78,7 +78,7 @@ private static <T> T doPrivileged(PrivilegedAction<T> privilegedAction) {
* @return the List of objects
*/
@SuppressWarnings("unchecked")
protected List<Object> getRootList(DefaultListableBeanFactory factory) {
protected List<Object> getRootList(DefaultListableInstanceFactory factory) {
return (List<Object>) getBean(factory, ROOT_NAME);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,78 +17,29 @@

package org.apache.jdo.tck.pc.company;

import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.*;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best practice is to avoid import ...* because it makes it difficult to track dependencies.

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.
*
* @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<Object> getRootList() {
return (List<Object>) 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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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<CompanyFactory> {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/*
* 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.*;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use specific classes to import.


import java.math.BigDecimal;
import org.apache.jdo.tck.pc.company.*;
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);
}
}
Loading
Loading