Skip to content

Commit

Permalink
Checkpoint the jpa tests for bug report
Browse files Browse the repository at this point in the history
Signed-off-by: Scott M Stark <[email protected]>
  • Loading branch information
starksm64 committed Dec 10, 2024
1 parent f47b617 commit 4c27b3f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 46 deletions.
3 changes: 2 additions & 1 deletion glassfish-runner/persistence-platform-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@
</goals>
<configuration>
<includes>
<include>ee/jakarta/tck/persistence/**/*Test.java</include>

<include>ee/jakarta/tck/persistence/core/types/generator/Client1PmservletTest.java</include>
</includes>
<!-- Select the @Tag("tck-javatest") tests -->
<groups>tck-javatest</groups>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ public void setup(String[] args, Properties p) throws Exception {
if (JAKARTA_EE.equalsIgnoreCase(mode)) {
logTrace(MODE_PROP + " is set to " + mode
+ ", so tests are running in JakartaEE environment.");
// Propagate all properties to the system properties
for (String name : p.stringPropertyNames()) {
System.setProperty(name, p.getProperty(name));
}
} else if (STANDALONE_MODE.equalsIgnoreCase(mode)) {
logTrace(MODE_PROP + " is set to " + mode
+ ", so tests are running in J2SE environment standalone mode."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package ee.jakarta.tck.persistence.core.types.generator;

import ee.jakarta.tck.persistence.core.types.generator.Client1;
import java.net.URL;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.OperateOnDeployment;
import org.jboss.arquillian.container.test.api.OverProtocol;
import org.jboss.arquillian.container.test.api.TargetsContainer;
import org.jboss.arquillian.junit5.ArquillianExtension;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.exporter.ZipExporter;
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
Expand Down Expand Up @@ -90,28 +86,12 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
if(warResURL != null) {
jpa_core_types_generator_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_types_generator_pmservlet_vehicle_web.addAsWebInfResource(warResURL, "sun-web.xml");
}

// Any libraries added to the war

// Web content
warResURL = Client1.class.getResource("/com/sun/ts/tests/jpa/core/types/generator/jpa_core_types_generator.jar");
if(warResURL != null) {
jpa_core_types_generator_pmservlet_vehicle_web.addAsWebResource(warResURL, "/WEB-INF/lib/jpa_core_types_generator.jar");
}
warResURL = Client1.class.getResource("/com/sun/ts/tests/common/vehicle/pmservlet/pmservlet_vehicle_web.xml");
if(warResURL != null) {
jpa_core_types_generator_pmservlet_vehicle_web.addAsWebResource(warResURL, "/WEB-INF/pmservlet_vehicle_web.xml");
}

// Call the archive processor
archiveProcessor.processWebArchive(jpa_core_types_generator_pmservlet_vehicle_web, Client1.class, warResURL);


// Par
// the jar with the correct archive name
JavaArchive jpa_core_types_generator = ShrinkWrap.create(JavaArchive.class, "jpa_core_types_generator.jar");
Expand All @@ -123,29 +103,11 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
ee.jakarta.tck.persistence.core.types.generator.DataTypes4.class
);
// The persistence.xml descriptor
URL parURL = Client1.class.getResource("persistence.xml");
URL parURL = Client1.class.getResource("/ee/jakarta/tck/persistence/common/template/persistence.xml");
if(parURL != null) {
jpa_core_types_generator.addAsManifestResource(parURL, "persistence.xml");
}
// Add the Persistence mapping-file
URL mappingURL = Client1.class.getResource("myMappingFile.xml");
if(mappingURL != null) {
jpa_core_types_generator.addAsResource(mappingURL, "myMappingFile.xml");
}
mappingURL = Client1.class.getResource("myMappingFile1.xml");
if(mappingURL != null) {
jpa_core_types_generator.addAsResource(mappingURL, "myMappingFile1.xml");
}
mappingURL = Client1.class.getResource("myMappingFile2.xml");
if(mappingURL != null) {
jpa_core_types_generator.addAsResource(mappingURL, "myMappingFile2.xml");
}
// Call the archive processor
archiveProcessor.processParArchive(jpa_core_types_generator, Client1.class, parURL);
parURL = Client1.class.getResource("orm.xml");
if(parURL != null) {
jpa_core_types_generator.addAsManifestResource(parURL, "orm.xml");
}


// Ear
EnterpriseArchive jpa_core_types_generator_vehicles_ear = ShrinkWrap.create(EnterpriseArchive.class, "jpa_core_types_generator_vehicles.ear");
Expand All @@ -161,11 +123,6 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test

// The application.xml descriptor
URL earResURL = null;
// The sun-application.xml descriptor
earResURL = Client1.class.getResource("/.ear.sun-application.xml");
if(earResURL != null) {
jpa_core_types_generator_vehicles_ear.addAsManifestResource(earResURL, "sun-application.xml");
}
// Call the archive processor
archiveProcessor.processEarArchive(jpa_core_types_generator_vehicles_ear, Client1.class, earResURL);
return jpa_core_types_generator_vehicles_ear;
Expand Down

0 comments on commit 4c27b3f

Please sign in to comment.