From 94a984d48b1ca1e9d51c317acd2d117be491cd81 Mon Sep 17 00:00:00 2001 From: Scott M Stark Date: Thu, 12 Dec 2024 23:37:04 -0600 Subject: [PATCH] Fix jpa tests that were missing client setup calls Signed-off-by: Scott M Stark --- .../implementation/PersistenceProvider.java | 2 +- .../annotations/version/Client1PmservletTest.java | 9 --------- .../contracts/jta/ClientPmservletTest.java | 11 +++++++---- .../persistence/core/annotations/basic/Client2.java | 2 +- .../persistence/core/annotations/version/Client2.java | 2 +- .../persistence/core/annotations/version/Client3.java | 2 +- .../persistence/core/annotations/version/Client4.java | 3 +-- 7 files changed, 12 insertions(+), 19 deletions(-) diff --git a/jpa/common/src/main/java/ee/jakarta/tck/persistence/common/pluggability/altprovider/implementation/PersistenceProvider.java b/jpa/common/src/main/java/ee/jakarta/tck/persistence/common/pluggability/altprovider/implementation/PersistenceProvider.java index 22290d719b..f58b2c3d27 100755 --- a/jpa/common/src/main/java/ee/jakarta/tck/persistence/common/pluggability/altprovider/implementation/PersistenceProvider.java +++ b/jpa/common/src/main/java/ee/jakarta/tck/persistence/common/pluggability/altprovider/implementation/PersistenceProvider.java @@ -44,7 +44,7 @@ public class PersistenceProvider protected TSLogger logger; public PersistenceProvider() { - // logger = TSLogger.getInstance(); + callLogger("PersistenceProvider.ctor"); } private void callLogger(String s) { diff --git a/jpa/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client1PmservletTest.java b/jpa/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client1PmservletTest.java index e1553c9330..f31426cc6a 100644 --- a/jpa/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client1PmservletTest.java +++ b/jpa/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client1PmservletTest.java @@ -90,11 +90,6 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test if(warResURL != null) { jpa_core_annotations_version_pmservlet_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); } - // The sun-web.xml descriptor - warResURL = Client1.class.getResource("//com/sun/ts/tests/common/vehicle/pmservlet/pmservlet_vehicle_web.war.sun-web.xml"); - if(warResURL != null) { - jpa_core_annotations_version_pmservlet_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); - } // Any libraries added to the war @@ -103,10 +98,6 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test if(warResURL != null) { jpa_core_annotations_version_pmservlet_vehicle_web.addAsWebResource(warResURL, "/WEB-INF/lib/jpa_core_annotations_version.jar"); } - warResURL = Client1.class.getResource("/com/sun/ts/tests/common/vehicle/pmservlet/pmservlet_vehicle_web.xml"); - if(warResURL != null) { - jpa_core_annotations_version_pmservlet_vehicle_web.addAsWebResource(warResURL, "/WEB-INF/pmservlet_vehicle_web.xml"); - } // Call the archive processor archiveProcessor.processWebArchive(jpa_core_annotations_version_pmservlet_vehicle_web, Client1.class, warResURL); diff --git a/jpa/platform-tests/src/main/java/ee/jakarta/tck/persistence/ee/pluggability/contracts/jta/ClientPmservletTest.java b/jpa/platform-tests/src/main/java/ee/jakarta/tck/persistence/ee/pluggability/contracts/jta/ClientPmservletTest.java index 16859b9418..98535d9290 100644 --- a/jpa/platform-tests/src/main/java/ee/jakarta/tck/persistence/ee/pluggability/contracts/jta/ClientPmservletTest.java +++ b/jpa/platform-tests/src/main/java/ee/jakarta/tck/persistence/ee/pluggability/contracts/jta/ClientPmservletTest.java @@ -96,11 +96,14 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test } // Call the archive processor archiveProcessor.processParArchive(jpa_ee_pluggability_contracts_jta, Client.class, parURL); - // The orm.xml file + // The orm.xml and mapping files parURL = Client.class.getResource("orm.xml"); - if(parURL != null) { - jpa_ee_pluggability_contracts_jta.addAsManifestResource(parURL, "orm.xml"); - } + jpa_ee_pluggability_contracts_jta.addAsManifestResource(parURL, "orm.xml"); + parURL = Client.class.getResource("myMappingFile1.xml"); + jpa_ee_pluggability_contracts_jta.addAsManifestResource(parURL, "myMappingFile1.xml"); + parURL = Client.class.getResource("myMappingFile2.xml"); + jpa_ee_pluggability_contracts_jta.addAsManifestResource(parURL, "myMappingFile2.xml"); + JavaArchive jpa_alternate_provider = ShrinkWrap.create(JavaArchive.class,"jpa_alternate_provider.jar"); jpa_alternate_provider.addClasses( ee.jakarta.tck.persistence.common.pluggability.altprovider.implementation.CacheImpl.class, diff --git a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/basic/Client2.java b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/basic/Client2.java index 0f4786aeee..782f77046c 100644 --- a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/basic/Client2.java +++ b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/basic/Client2.java @@ -36,7 +36,7 @@ public Client2() { } - public void setupData(String[] args, Properties p) throws Exception { + public void setup(String[] args, Properties p) throws Exception { logTrace( "setupData"); try { super.setup(args,p); diff --git a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client2.java b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client2.java index 58e1085b66..4d991c7b75 100644 --- a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client2.java +++ b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client2.java @@ -33,7 +33,7 @@ public static void main(String[] args) { s.exit(); } - public void setupShortData(String[] args, Properties p) throws Exception { + public void setup(String[] args, Properties p) throws Exception { logTrace( "setupShortData"); try { super.setup(args,p); diff --git a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client3.java b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client3.java index fa411d2a89..a9128bb635 100644 --- a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client3.java +++ b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client3.java @@ -33,7 +33,7 @@ public static void main(String[] args) { s.exit(); } - public void setupLongData(String[] args, Properties p) throws Exception { + public void setup(String[] args, Properties p) throws Exception { logTrace( "setupLongData"); try { super.setup(args,p); diff --git a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client4.java b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client4.java index 4115599967..0715c17899 100644 --- a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client4.java +++ b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/annotations/version/Client4.java @@ -35,8 +35,7 @@ public static void main(String[] args) { s.exit(); } - - public void setupTimestampData(String[] args, Properties p) throws Exception { + public void setup(String[] args, Properties p) throws Exception { logTrace( "setupTimestampData"); try { super.setup(args,p);