Skip to content

Commit

Permalink
Fixes for failing tests in ee.jakarta.tck.persistence.ee.pluggability…
Browse files Browse the repository at this point in the history
….contracts.resource_local, ee.jakarta.tck.persistence.core.query.parameter, and ee.jakarta.tck.persistence.core.criteriaapi.CriteriaDelete packages. (#1739)

Start returning WARs as test archive
Related to #1738

Signed-off-by: Scott M Stark <[email protected]>
  • Loading branch information
starksm64 authored Jan 9, 2025
1 parent c23d96a commit 4437c03
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 296 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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
Expand Down
Loading

0 comments on commit 4437c03

Please sign in to comment.