diff --git a/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/criteriaapi/CriteriaDelete/ClientPmservletTest.java b/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/criteriaapi/CriteriaDelete/ClientPmservletTest.java index 492920edbe..02a1267b51 100644 --- a/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/criteriaapi/CriteriaDelete/ClientPmservletTest.java +++ b/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/criteriaapi/CriteriaDelete/ClientPmservletTest.java @@ -59,7 +59,7 @@ public class ClientPmservletTest extends ee.jakarta.tck.persistence.core.criteri @TargetsContainer("tck-javatest") @OverProtocol("javatest") @Deployment(name = VEHICLE_ARCHIVE, order = 2) - public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + public static WebArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { // War // the war with the correct archive name WebArchive jpa_core_criteriapia_CriteriaDelete_pmservlet_vehicle_web = ShrinkWrap.create(WebArchive.class, "jpa_core_criteriapia_CriteriaDelete_pmservlet_vehicle_web.war"); @@ -155,51 +155,16 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test ); // The persistence.xml descriptor URL parURL = Client.class.getResource("persistence.xml"); - if(parURL != null) { - jpa_core_criteriapia_CriteriaDelete.addAsManifestResource(parURL, "persistence.xml"); - } - // Add the Persistence mapping-file - URL mappingURL = Client.class.getResource("myMappingFile.xml"); - if(mappingURL != null) { - jpa_core_criteriapia_CriteriaDelete.addAsResource(mappingURL, "myMappingFile.xml"); - } - mappingURL = Client.class.getResource("myMappingFile1.xml"); - if(mappingURL != null) { - jpa_core_criteriapia_CriteriaDelete.addAsResource(mappingURL, "myMappingFile1.xml"); - } - mappingURL = Client.class.getResource("myMappingFile2.xml"); - if(mappingURL != null) { - jpa_core_criteriapia_CriteriaDelete.addAsResource(mappingURL, "myMappingFile2.xml"); - } + jpa_core_criteriapia_CriteriaDelete.addAsManifestResource(parURL, "persistence.xml"); + // Call the archive processor archiveProcessor.processParArchive(jpa_core_criteriapia_CriteriaDelete, Client.class, parURL); parURL = Client.class.getResource("orm.xml"); if(parURL != null) { jpa_core_criteriapia_CriteriaDelete.addAsManifestResource(parURL, "orm.xml"); } - - // Ear - EnterpriseArchive jpa_core_criteriapia_CriteriaDelete_vehicles_ear = ShrinkWrap.create(EnterpriseArchive.class, "jpa_core_criteriapia_CriteriaDelete_vehicles.ear"); - - // Any libraries added to the ear - - // The component jars built by the package target - jpa_core_criteriapia_CriteriaDelete_vehicles_ear.addAsModule(jpa_core_criteriapia_CriteriaDelete_pmservlet_vehicle_web); - - jpa_core_criteriapia_CriteriaDelete_vehicles_ear.addAsLibrary(jpa_core_criteriapia_CriteriaDelete); - - - - // The application.xml descriptor - URL earResURL = null; - // The sun-application.xml descriptor - earResURL = Client.class.getResource("/.ear.sun-application.xml"); - if(earResURL != null) { - jpa_core_criteriapia_CriteriaDelete_vehicles_ear.addAsManifestResource(earResURL, "sun-application.xml"); - } - // Call the archive processor - archiveProcessor.processEarArchive(jpa_core_criteriapia_CriteriaDelete_vehicles_ear, Client.class, earResURL); - return jpa_core_criteriapia_CriteriaDelete_vehicles_ear; + jpa_core_criteriapia_CriteriaDelete_pmservlet_vehicle_web.addAsLibrary(jpa_core_criteriapia_CriteriaDelete); + return jpa_core_criteriapia_CriteriaDelete_pmservlet_vehicle_web; } @Test diff --git a/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/criteriaapi/CriteriaDelete/ClientPuservletTest.java b/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/criteriaapi/CriteriaDelete/ClientPuservletTest.java index acd64b5c4e..3e49981b92 100644 --- a/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/criteriaapi/CriteriaDelete/ClientPuservletTest.java +++ b/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/criteriaapi/CriteriaDelete/ClientPuservletTest.java @@ -59,7 +59,7 @@ public class ClientPuservletTest extends ee.jakarta.tck.persistence.core.criteri @TargetsContainer("tck-javatest") @OverProtocol("javatest") @Deployment(name = VEHICLE_ARCHIVE, order = 2) - public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + public static WebArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { // War // the war with the correct archive name WebArchive jpa_core_criteriapia_CriteriaDelete_puservlet_vehicle_web = ShrinkWrap.create(WebArchive.class, "jpa_core_criteriapia_CriteriaDelete_puservlet_vehicle_web.war"); @@ -96,18 +96,6 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test jpa_core_criteriapia_CriteriaDelete_puservlet_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); } - // Any libraries added to the war - - // Web content - warResURL = Client.class.getResource("/com/sun/ts/tests/jpa/core/criteriaapi/CriteriaDelete/jpa_core_criteriapia_CriteriaDelete.jar"); - if(warResURL != null) { - jpa_core_criteriapia_CriteriaDelete_puservlet_vehicle_web.addAsWebResource(warResURL, "/WEB-INF/lib/jpa_core_criteriapia_CriteriaDelete.jar"); - } - warResURL = Client.class.getResource("/com/sun/ts/tests/common/vehicle/puservlet/puservlet_vehicle_web.xml"); - if(warResURL != null) { - jpa_core_criteriapia_CriteriaDelete_puservlet_vehicle_web.addAsWebResource(warResURL, "/WEB-INF/puservlet_vehicle_web.xml"); - } - // Call the archive processor archiveProcessor.processWebArchive(jpa_core_criteriapia_CriteriaDelete_puservlet_vehicle_web, Client.class, warResURL); @@ -155,51 +143,13 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test ); // The persistence.xml descriptor URL parURL = Client.class.getResource("persistence.xml"); - if(parURL != null) { - jpa_core_criteriapia_CriteriaDelete.addAsManifestResource(parURL, "persistence.xml"); - } - // Add the Persistence mapping-file - URL mappingURL = Client.class.getResource("myMappingFile.xml"); - if(mappingURL != null) { - jpa_core_criteriapia_CriteriaDelete.addAsResource(mappingURL, "myMappingFile.xml"); - } - mappingURL = Client.class.getResource("myMappingFile1.xml"); - if(mappingURL != null) { - jpa_core_criteriapia_CriteriaDelete.addAsResource(mappingURL, "myMappingFile1.xml"); - } - mappingURL = Client.class.getResource("myMappingFile2.xml"); - if(mappingURL != null) { - jpa_core_criteriapia_CriteriaDelete.addAsResource(mappingURL, "myMappingFile2.xml"); - } + jpa_core_criteriapia_CriteriaDelete.addAsManifestResource(parURL, "persistence.xml"); + // Call the archive processor archiveProcessor.processParArchive(jpa_core_criteriapia_CriteriaDelete, Client.class, parURL); - parURL = Client.class.getResource("orm.xml"); - if(parURL != null) { - jpa_core_criteriapia_CriteriaDelete.addAsManifestResource(parURL, "orm.xml"); - } - - // Ear - EnterpriseArchive jpa_core_criteriapia_CriteriaDelete_vehicles_ear = ShrinkWrap.create(EnterpriseArchive.class, "jpa_core_criteriapia_CriteriaDelete_vehicles.ear"); - - // Any libraries added to the ear - - // The component jars built by the package target - jpa_core_criteriapia_CriteriaDelete_vehicles_ear.addAsModule(jpa_core_criteriapia_CriteriaDelete_puservlet_vehicle_web); + jpa_core_criteriapia_CriteriaDelete_puservlet_vehicle_web.addAsLibrary(jpa_core_criteriapia_CriteriaDelete); - jpa_core_criteriapia_CriteriaDelete_vehicles_ear.addAsLibrary(jpa_core_criteriapia_CriteriaDelete); - - - - // The application.xml descriptor - URL earResURL = null; - // The sun-application.xml descriptor - earResURL = Client.class.getResource("/.ear.sun-application.xml"); - if(earResURL != null) { - jpa_core_criteriapia_CriteriaDelete_vehicles_ear.addAsManifestResource(earResURL, "sun-application.xml"); - } - // Call the archive processor - archiveProcessor.processEarArchive(jpa_core_criteriapia_CriteriaDelete_vehicles_ear, Client.class, earResURL); - return jpa_core_criteriapia_CriteriaDelete_vehicles_ear; + return jpa_core_criteriapia_CriteriaDelete_puservlet_vehicle_web; } @Test diff --git a/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/query/parameter/Client2PmservletTest.java b/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/query/parameter/Client2PmservletTest.java index 35bda18478..0136df3fb2 100644 --- a/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/query/parameter/Client2PmservletTest.java +++ b/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/query/parameter/Client2PmservletTest.java @@ -59,7 +59,7 @@ public class Client2PmservletTest extends ee.jakarta.tck.persistence.core.query. @TargetsContainer("tck-javatest") @OverProtocol("javatest") @Deployment(name = VEHICLE_ARCHIVE, order = 2) - public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + public static WebArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { // War // the war with the correct archive name WebArchive jpa_core_query_parameter_pmservlet_vehicle_web = ShrinkWrap.create(WebArchive.class, "jpa_core_query_parameter_pmservlet_vehicle_web.war"); @@ -86,31 +86,11 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test ); // The web.xml descriptor URL warResURL = Client2.class.getResource("/com/sun/ts/tests/common/vehicle/pmservlet/pmservlet_vehicle_web.xml"); - if(warResURL != null) { - jpa_core_query_parameter_pmservlet_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); - } - // The sun-web.xml descriptor - warResURL = Client2.class.getResource("//com/sun/ts/tests/common/vehicle/pmservlet/pmservlet_vehicle_web.war.sun-web.xml"); - if(warResURL != null) { - jpa_core_query_parameter_pmservlet_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); - } - - // Any libraries added to the war - - // Web content - warResURL = Client2.class.getResource("/com/sun/ts/tests/jpa/core/query/parameter/jpa_core_query_parameter.jar"); - if(warResURL != null) { - jpa_core_query_parameter_pmservlet_vehicle_web.addAsWebResource(warResURL, "/WEB-INF/lib/jpa_core_query_parameter.jar"); - } - warResURL = Client2.class.getResource("/com/sun/ts/tests/common/vehicle/pmservlet/pmservlet_vehicle_web.xml"); - if(warResURL != null) { - jpa_core_query_parameter_pmservlet_vehicle_web.addAsWebResource(warResURL, "/WEB-INF/pmservlet_vehicle_web.xml"); - } + jpa_core_query_parameter_pmservlet_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); // Call the archive processor archiveProcessor.processWebArchive(jpa_core_query_parameter_pmservlet_vehicle_web, Client2.class, warResURL); - // Par // the jar with the correct archive name JavaArchive jpa_core_query_parameter = ShrinkWrap.create(JavaArchive.class, "jpa_core_query_parameter.jar"); @@ -120,51 +100,12 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test ); // The persistence.xml descriptor URL parURL = Client2.class.getResource("persistence.xml"); - if(parURL != null) { - jpa_core_query_parameter.addAsManifestResource(parURL, "persistence.xml"); - } - // Add the Persistence mapping-file - URL mappingURL = Client2.class.getResource("myMappingFile.xml"); - if(mappingURL != null) { - jpa_core_query_parameter.addAsResource(mappingURL, "myMappingFile.xml"); - } - mappingURL = Client2.class.getResource("myMappingFile1.xml"); - if(mappingURL != null) { - jpa_core_query_parameter.addAsResource(mappingURL, "myMappingFile1.xml"); - } - mappingURL = Client2.class.getResource("myMappingFile2.xml"); - if(mappingURL != null) { - jpa_core_query_parameter.addAsResource(mappingURL, "myMappingFile2.xml"); - } + jpa_core_query_parameter.addAsManifestResource(parURL, "persistence.xml"); // Call the archive processor archiveProcessor.processParArchive(jpa_core_query_parameter, Client2.class, parURL); - parURL = Client2.class.getResource("orm.xml"); - if(parURL != null) { - jpa_core_query_parameter.addAsManifestResource(parURL, "orm.xml"); - } - - // Ear - EnterpriseArchive jpa_core_query_parameter_vehicles_ear = ShrinkWrap.create(EnterpriseArchive.class, "jpa_core_query_parameter_vehicles.ear"); - - // Any libraries added to the ear - - // The component jars built by the package target - jpa_core_query_parameter_vehicles_ear.addAsModule(jpa_core_query_parameter_pmservlet_vehicle_web); + jpa_core_query_parameter_pmservlet_vehicle_web.addAsLibrary(jpa_core_query_parameter); - jpa_core_query_parameter_vehicles_ear.addAsLibrary(jpa_core_query_parameter); - - - - // The application.xml descriptor - URL earResURL = null; - // The sun-application.xml descriptor - earResURL = Client2.class.getResource("/.ear.sun-application.xml"); - if(earResURL != null) { - jpa_core_query_parameter_vehicles_ear.addAsManifestResource(earResURL, "sun-application.xml"); - } - // Call the archive processor - archiveProcessor.processEarArchive(jpa_core_query_parameter_vehicles_ear, Client2.class, earResURL); - return jpa_core_query_parameter_vehicles_ear; + return jpa_core_query_parameter_pmservlet_vehicle_web; } @Test diff --git a/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/query/parameter/Client2PuservletTest.java b/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/query/parameter/Client2PuservletTest.java index e03bedae84..aca5e027be 100644 --- a/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/query/parameter/Client2PuservletTest.java +++ b/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/core/query/parameter/Client2PuservletTest.java @@ -59,7 +59,7 @@ public class Client2PuservletTest extends ee.jakarta.tck.persistence.core.query. @TargetsContainer("tck-javatest") @OverProtocol("javatest") @Deployment(name = VEHICLE_ARCHIVE, order = 2) - public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + public static WebArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { // War // the war with the correct archive name WebArchive jpa_core_query_parameter_puservlet_vehicle_web = ShrinkWrap.create(WebArchive.class, "jpa_core_query_parameter_puservlet_vehicle_web.war"); @@ -86,31 +86,11 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test ); // The web.xml descriptor URL warResURL = Client2.class.getResource("/com/sun/ts/tests/common/vehicle/puservlet/puservlet_vehicle_web.xml"); - if(warResURL != null) { - jpa_core_query_parameter_puservlet_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); - } - // The sun-web.xml descriptor - warResURL = Client2.class.getResource("//com/sun/ts/tests/common/vehicle/puservlet/puservlet_vehicle_web.war.sun-web.xml"); - if(warResURL != null) { - jpa_core_query_parameter_puservlet_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); - } - - // Any libraries added to the war - - // Web content - warResURL = Client2.class.getResource("/com/sun/ts/tests/jpa/core/query/parameter/jpa_core_query_parameter.jar"); - if(warResURL != null) { - jpa_core_query_parameter_puservlet_vehicle_web.addAsWebResource(warResURL, "/WEB-INF/lib/jpa_core_query_parameter.jar"); - } - warResURL = Client2.class.getResource("/com/sun/ts/tests/common/vehicle/puservlet/puservlet_vehicle_web.xml"); - if(warResURL != null) { - jpa_core_query_parameter_puservlet_vehicle_web.addAsWebResource(warResURL, "/WEB-INF/puservlet_vehicle_web.xml"); - } + jpa_core_query_parameter_puservlet_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); // Call the archive processor archiveProcessor.processWebArchive(jpa_core_query_parameter_puservlet_vehicle_web, Client2.class, warResURL); - // Par // the jar with the correct archive name JavaArchive jpa_core_query_parameter = ShrinkWrap.create(JavaArchive.class, "jpa_core_query_parameter.jar"); @@ -120,51 +100,12 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test ); // The persistence.xml descriptor URL parURL = Client2.class.getResource("persistence.xml"); - if(parURL != null) { - jpa_core_query_parameter.addAsManifestResource(parURL, "persistence.xml"); - } - // Add the Persistence mapping-file - URL mappingURL = Client2.class.getResource("myMappingFile.xml"); - if(mappingURL != null) { - jpa_core_query_parameter.addAsResource(mappingURL, "myMappingFile.xml"); - } - mappingURL = Client2.class.getResource("myMappingFile1.xml"); - if(mappingURL != null) { - jpa_core_query_parameter.addAsResource(mappingURL, "myMappingFile1.xml"); - } - mappingURL = Client2.class.getResource("myMappingFile2.xml"); - if(mappingURL != null) { - jpa_core_query_parameter.addAsResource(mappingURL, "myMappingFile2.xml"); - } + jpa_core_query_parameter.addAsManifestResource(parURL, "persistence.xml"); // Call the archive processor archiveProcessor.processParArchive(jpa_core_query_parameter, Client2.class, parURL); - parURL = Client2.class.getResource("orm.xml"); - if(parURL != null) { - jpa_core_query_parameter.addAsManifestResource(parURL, "orm.xml"); - } - - // Ear - EnterpriseArchive jpa_core_query_parameter_vehicles_ear = ShrinkWrap.create(EnterpriseArchive.class, "jpa_core_query_parameter_vehicles.ear"); - - // Any libraries added to the ear - - // The component jars built by the package target - jpa_core_query_parameter_vehicles_ear.addAsModule(jpa_core_query_parameter_puservlet_vehicle_web); + jpa_core_query_parameter_puservlet_vehicle_web.addAsLibrary(jpa_core_query_parameter); - jpa_core_query_parameter_vehicles_ear.addAsLibrary(jpa_core_query_parameter); - - - - // The application.xml descriptor - URL earResURL = null; - // The sun-application.xml descriptor - earResURL = Client2.class.getResource("/.ear.sun-application.xml"); - if(earResURL != null) { - jpa_core_query_parameter_vehicles_ear.addAsManifestResource(earResURL, "sun-application.xml"); - } - // Call the archive processor - archiveProcessor.processEarArchive(jpa_core_query_parameter_vehicles_ear, Client2.class, earResURL); - return jpa_core_query_parameter_vehicles_ear; + return jpa_core_query_parameter_puservlet_vehicle_web; } @Test diff --git a/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/ee/pluggability/contracts/resource_local/ClientPuservletTest.java b/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/ee/pluggability/contracts/resource_local/ClientPuservletTest.java index dcf9d93c5f..829f6997ff 100644 --- a/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/ee/pluggability/contracts/resource_local/ClientPuservletTest.java +++ b/tcks/apis/persistence/persistence-inside-container/platform-tests/src/main/java/ee/jakarta/tck/persistence/ee/pluggability/contracts/resource_local/ClientPuservletTest.java @@ -2,6 +2,8 @@ import ee.jakarta.tck.persistence.ee.pluggability.contracts.resource_local.Client; import java.net.URL; + +import ee.jakarta.tck.persistence.jpa.ee.packaging.jar.C; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.container.test.api.OverProtocol; @@ -48,7 +50,7 @@ public class ClientPuservletTest extends ee.jakarta.tck.persistence.ee.pluggabil @TargetsContainer("tck-javatest") @OverProtocol("javatest") @Deployment(name = VEHICLE_ARCHIVE, order = 2) - public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { + public static WebArchive createDeploymentVehicle(@ArquillianResource TestArchiveProcessor archiveProcessor) { // War // the war with the correct archive name WebArchive pluggability_contracts_resource_local_puservlet_vehicle_web = ShrinkWrap.create(WebArchive.class, "pluggability_contracts_resource_local_puservlet_vehicle_web.war"); @@ -75,77 +77,48 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test ); // The web.xml descriptor URL warResURL = Client.class.getResource("/com/sun/ts/tests/common/vehicle/puservlet/puservlet_vehicle_web.xml"); - if(warResURL != null) { - pluggability_contracts_resource_local_puservlet_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); - } + pluggability_contracts_resource_local_puservlet_vehicle_web.addAsWebInfResource(warResURL, "web.xml"); // The sun-web.xml descriptor - warResURL = Client.class.getResource("/com/sun/ts/tests/common/vehicle/puservlet/puservlet_vehicle_web.war.sun-web.xml"); - if(warResURL != null) { - pluggability_contracts_resource_local_puservlet_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml"); - } - // Web content - warResURL = Client.class.getResource("/com/sun/ts/tests/jpa/ee/pluggability/contracts/resource_local/pluggability_contracts_resource_local.jar"); - if(warResURL != null) { - pluggability_contracts_resource_local_puservlet_vehicle_web.addAsWebResource(warResURL, "/WEB-INF/lib/pluggability_contracts_resource_local.jar"); - } - warResURL = Client.class.getResource("/com/sun/ts/tests/common/vehicle/puservlet/puservlet_vehicle_web.xml"); - if(warResURL != null) { - pluggability_contracts_resource_local_puservlet_vehicle_web.addAsWebResource(warResURL, "/WEB-INF/puservlet_vehicle_web.xml"); - } - + warResURL = null; // Call the archive processor archiveProcessor.processWebArchive(pluggability_contracts_resource_local_puservlet_vehicle_web, Client.class, warResURL); // Par - // the jar with the correct archive name - JavaArchive pluggability_contracts_resource_local = ShrinkWrap.create(JavaArchive.class, "pluggability_contracts_resource_local.jar"); - // The class files - pluggability_contracts_resource_local.addClasses( - ee.jakarta.tck.persistence.ee.pluggability.contracts.resource_local.Order4.class, - ee.jakarta.tck.persistence.ee.pluggability.contracts.resource_local.Order.class, - ee.jakarta.tck.persistence.common.pluggability.util.LogRecordEntry.class, - ee.jakarta.tck.persistence.ee.pluggability.contracts.resource_local.Order3.class, - ee.jakarta.tck.persistence.ee.pluggability.contracts.resource_local.Order2.class, - ee.jakarta.tck.persistence.common.pluggability.util.LogFileProcessor.class - ); - // The persistence.xml descriptor - URL parURL = Client.class.getResource("persistence.xml"); - if(parURL != null) { - pluggability_contracts_resource_local.addAsManifestResource(parURL, "persistence.xml"); - } - // Call the archive processor - archiveProcessor.processParArchive(pluggability_contracts_resource_local, Client.class, parURL); - // The orm.xml file - parURL = Client.class.getResource("orm.xml"); - if(parURL != null) { - pluggability_contracts_resource_local.addAsManifestResource(parURL, "orm.xml"); - } - - // Ear - EnterpriseArchive pluggability_contracts_resource_local_vehicles_ear = ShrinkWrap.create(EnterpriseArchive.class, "pluggability_contracts_resource_local_vehicles.ear"); - - // Any libraries added to the ear - - // The component jars built by the package target - pluggability_contracts_resource_local_vehicles_ear.addAsModule(pluggability_contracts_resource_local_puservlet_vehicle_web); - - pluggability_contracts_resource_local_vehicles_ear.addAsLibrary(pluggability_contracts_resource_local); - - - - // The application.xml descriptor - URL earResURL = Client.class.getResource("/com/sun/ts/tests/jpa/ee/pluggability/contracts/resource_local/"); - if(earResURL != null) { - pluggability_contracts_resource_local_vehicles_ear.addAsManifestResource(earResURL, "application.xml"); - } - // The sun-application.xml descriptor - earResURL = Client.class.getResource("/com/sun/ts/tests/jpa/ee/pluggability/contracts/resource_local/.ear.sun-application.xml"); - if(earResURL != null) { - pluggability_contracts_resource_local_vehicles_ear.addAsManifestResource(earResURL, "sun-application.xml"); - } - // Call the archive processor - archiveProcessor.processEarArchive(pluggability_contracts_resource_local_vehicles_ear, Client.class, earResURL); - return pluggability_contracts_resource_local_vehicles_ear; + JavaArchive pluggability_contracts_resource_local = ShrinkWrap.create(JavaArchive.class, "pluggability_contracts_resource_local.jar"); + // The class files + pluggability_contracts_resource_local.addClasses( + ee.jakarta.tck.persistence.ee.pluggability.contracts.resource_local.Order4.class, + ee.jakarta.tck.persistence.ee.pluggability.contracts.resource_local.Order.class, + ee.jakarta.tck.persistence.common.pluggability.util.LogRecordEntry.class, + ee.jakarta.tck.persistence.ee.pluggability.contracts.resource_local.Order3.class, + ee.jakarta.tck.persistence.ee.pluggability.contracts.resource_local.Order2.class, + ee.jakarta.tck.persistence.common.pluggability.util.LogFileProcessor.class + ); + // The persistence.xml descriptor + URL parURL = Client.class.getResource("persistence.xml"); + if(parURL != null) { + pluggability_contracts_resource_local.addAsManifestResource(parURL, "persistence.xml"); + } + // Call the archive processor + archiveProcessor.processParArchive(pluggability_contracts_resource_local, Client.class, parURL); + // The orm.xml file + parURL = Client.class.getResource("orm.xml"); + pluggability_contracts_resource_local.addAsManifestResource(parURL, "orm.xml"); + // Mapping files + parURL = Client.class.getResource("myMappingFile1.xml"); + pluggability_contracts_resource_local.addAsManifestResource(parURL, "myMappingFile1.xml"); + parURL = Client.class.getResource("myMappingFile2.xml"); + pluggability_contracts_resource_local.addAsManifestResource(parURL, "myMappingFile2.xml"); + pluggability_contracts_resource_local_puservlet_vehicle_web.addAsLibrary(pluggability_contracts_resource_local); + + // jpa_alternate_provider.jar + JavaArchive jpa_alternate_provider = ShrinkWrap.create(JavaArchive.class, "jpa_alternate_provider.jar"); + jpa_alternate_provider.addPackage("ee.jakarta.tck.persistence.common.pluggability.altprovider.implementation"); + parURL = Client.class.getResource("/ee/jakarta/tck/persistence/common/pluggability/altprovider/METAINF/services/jakarta.persistence.spi.PersistenceProvider"); + jpa_alternate_provider.addAsServiceProvider(jakarta.persistence.spi.PersistenceProvider.class, ee.jakarta.tck.persistence.common.pluggability.altprovider.implementation.PersistenceProvider.class); + pluggability_contracts_resource_local_puservlet_vehicle_web.addAsLibrary(jpa_alternate_provider); + + return pluggability_contracts_resource_local_puservlet_vehicle_web; } @Test diff --git a/tcks/apis/persistence/persistence-inside-container/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/criteriaapi/CriteriaDelete/Client.java b/tcks/apis/persistence/persistence-inside-container/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/criteriaapi/CriteriaDelete/Client.java index 785850af83..2674c30581 100644 --- a/tcks/apis/persistence/persistence-inside-container/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/criteriaapi/CriteriaDelete/Client.java +++ b/tcks/apis/persistence/persistence-inside-container/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/criteriaapi/CriteriaDelete/Client.java @@ -20,8 +20,10 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.Properties; import com.sun.ts.lib.harness.Status; +import com.sun.ts.lib.util.TestUtil; import ee.jakarta.tck.persistence.common.schema30.Util; @@ -45,7 +47,17 @@ public static void main(String[] args) { Status s = theTests.run(args, System.out, System.err); s.exit(); } - + public void setup(String[] args, Properties p) throws Fault { + TestUtil.logTrace("setup"); + try { + super.setup(args, p); + removeTestData(); + createProductData(); + } catch (Exception e) { + TestUtil.logErr("Exception: ", e); + throw new Fault("setup failed:", e); + } + } /* * @testName: fromClassTest * diff --git a/tcks/apis/persistence/persistence-inside-container/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/query/parameter/Client2.java b/tcks/apis/persistence/persistence-inside-container/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/query/parameter/Client2.java index 406a82a845..71e9db0902 100644 --- a/tcks/apis/persistence/persistence-inside-container/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/query/parameter/Client2.java +++ b/tcks/apis/persistence/persistence-inside-container/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/query/parameter/Client2.java @@ -20,7 +20,10 @@ import java.util.List; import java.util.Properties; +import com.sun.ts.lib.harness.CleanupMethod; +import com.sun.ts.lib.harness.SetupMethod; import com.sun.ts.lib.harness.Status; +import com.sun.ts.lib.util.TestUtil; import ee.jakarta.tck.persistence.common.PMClientBase; import jakarta.persistence.Query; @@ -43,12 +46,26 @@ public void setup(String[] args, Properties p) throws Exception { logTrace( "setupEmployee"); try { super.setup(args,p); - createEmployeeData(); + getEntityManager(); } catch (Exception e) { logErr( "Exception: ", e); throw new Exception("Setup failed:", e); } } + public void setupEmployee(String[] args, Properties p) throws Fault { + TestUtil.logTrace("setupEmployee"); + try { + super.setup(args, p); + createEmployeeData(); + } catch (Exception e) { + TestUtil.logErr("Exception: ", e); + throw new Fault("Setup failed:", e); + } + } + public void cleanup() throws Exception { + TestUtil.logTrace("calling super.cleanup"); + super.cleanup(); + } /* * @testName: parameterPositionalTest @@ -59,7 +76,8 @@ public void setup(String[] args, Properties p) throws Exception { * @test_Strategy: Create a query with a having clause with a positional * parameter and retrieve information about the parameter. */ - + @SetupMethod(name = "setupEmployee") + @CleanupMethod(name = "cleanupEmployee") public void parameterPositionalTest() throws Exception { boolean pass = false; List result; @@ -98,7 +116,8 @@ public void parameterPositionalTest() throws Exception { * @test_Strategy: Create an update query with a positional parameter and * retrieve information about the parameter. */ - + @SetupMethod(name = "setupEmployee") + @CleanupMethod(name = "cleanupEmployee") public void parameterUpdateTest() throws Exception { boolean pass = false; String expectedPKs[]; @@ -141,7 +160,8 @@ public void parameterUpdateTest() throws Exception { * @test_Strategy: Create a query with a name parameter using different cases * and retrieve information about the parameter. */ - + @SetupMethod(name = "setupEmployee") + @CleanupMethod(name = "cleanupEmployee") public void parameterCaseTest() throws Exception { boolean pass = false; List result; @@ -179,7 +199,8 @@ public void parameterCaseTest() throws Exception { * @test_Strategy: Create a query using a name parameter twice and retrieve * information about the parameter. */ - + @SetupMethod(name = "setupEmployee") + @CleanupMethod(name = "cleanupEmployee") public void parameterNamedParameterTwiceTest() throws Exception { boolean pass = false; List result;