Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c3dd532
OrderTest w/o XML
tzaeschke Feb 27, 2025
f2db583
MyLibTest w/o XML - WIP
tzaeschke Feb 27, 2025
917210e
Fixed concurrency issue when running ResultClassRequirementsMap query…
tzaeschke Mar 2, 2025
0e5af20
Fix query.conf failure
tzaeschke Mar 2, 2025
07bce2d
Fixed concurrency issue when running query.Variable test
tzaeschke Mar 2, 2025
dfb7b55
QUeryTest with new factory
tzaeschke Mar 2, 2025
b434ad8
Fix for result.Variable see JDO-851
tzaeschke Mar 2, 2025
0b66774
Remove XML
tzaeschke Mar 2, 2025
aff9816
Remove XML
tzaeschke Mar 9, 2025
fc4b899
Remove XML
tzaeschke Mar 10, 2025
a093a96
Clean up
tzaeschke Apr 6, 2025
704a191
Remove XML
tzaeschke May 29, 2025
46466e0
Remove XML
tzaeschke May 29, 2025
673b134
Remove XML
tzaeschke May 29, 2025
4050570
Remove XML
tzaeschke May 29, 2025
36cb7e8
QUERY_TEST
tzaeschke Jun 1, 2025
95333f4
Tests pass except concurrent tests
tzaeschke Sep 22, 2025
9ee1c02
Tests pass except concurrent tests
tzaeschke Sep 23, 2025
b5a8205
SampleQuery works!
tzaeschke Oct 12, 2025
76a4195
NavigationTest works
tzaeschke Oct 12, 2025
b3602fa
SubqueryTest works
tzaeschke Oct 12, 2025
5687c1e
EmbeddedTest works
tzaeschke Oct 12, 2025
22b31c1
Update EmbeddedTestData.java
tzaeschke Oct 18, 2025
1dbbee7
AllRelationshipsTest
tzaeschke Oct 19, 2025
7889a2b
All tests migrated
tzaeschke Oct 23, 2025
ff850fc
Structure cleanup
tzaeschke Oct 23, 2025
2c40e37
Test class in conf files
tzaeschke Oct 26, 2025
d03a488
Use jdo.tck.testdata
tzaeschke Oct 26, 2025
ed6e2a1
Prepare removal of XML files
tzaeschke Oct 26, 2025
84b6030
Prepare removal of XML files
tzaeschke Oct 26, 2025
52d39bd
Prepare removal of XML files
tzaeschke Oct 26, 2025
3dd8a9c
Prepare removal of XML files
tzaeschke Oct 26, 2025
de07a96
Prepare removal of XML files
tzaeschke Oct 26, 2025
93ff384
Prepare removal of XML files
tzaeschke Oct 26, 2025
8bfe82e
Prepare removal of XML files
tzaeschke Oct 26, 2025
1cc4389
Prepare removal of XML files
tzaeschke Oct 26, 2025
529c3ae
Remove XML files
tzaeschke Oct 26, 2025
c24a2ed
Update Variable.java
tzaeschke Oct 26, 2025
bdb8b7d
Remove XML files
tzaeschke Oct 26, 2025
7e28e9c
Fixed wildcard imports
tzaeschke Nov 15, 2025
67f67ed
Fix README.md and field name in AbstractReaderTest.java
tzaeschke Nov 17, 2025
2b9cd6c
Field name doc in AbstractReaderTest.java
tzaeschke Nov 17, 2025
0bebe17
Fix formatting
tzaeschke Nov 17, 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions exectck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,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
2 changes: 1 addition & 1 deletion exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
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.20.0</version.commons-io>
<version.spring-beans>5.3.39</version.spring-beans>
<version.commons-logging>1.3.5</version.commons-logging>
<version.glassfish-corba-omgapi>5.0.0</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
12 changes: 6 additions & 6 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 @@ -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<String, Object> oidMap = new HashMap<>();
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 @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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<Object> rootList = getRootList(reader);

getPM();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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<Object> rootList = getRootList(reader);

getPM();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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<Object> rootList = getRootList(reader);

getPM();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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<Object> rootList = getRootList(reader);

getPM();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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<Object> rootList = getRootList(reader);

getPM();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,77 +18,29 @@
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.
*
* @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> {}
Loading