Skip to content

Commit

Permalink
More jpa appclient fixes (#1578)
Browse files Browse the repository at this point in the history
* Add setup method to com.sun.ts.tests.jpa.common.schema30.Util for appclient tests

* add more trace output for vehicle determination to understand what needs to change for appclient vehicle

* rename sun-application-client.xml back to sun-application-client.xml
  • Loading branch information
scottmarlow authored Oct 11, 2024
1 parent faa13b3 commit 4476976
Show file tree
Hide file tree
Showing 51 changed files with 86 additions and 50 deletions.
13 changes: 12 additions & 1 deletion common/src/main/java/com/sun/ts/lib/harness/ServiceEETest.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public Properties getVehicleSpecificClientProps(Properties p) {
public Status run(String[] argv, Properties p) {
Status status = null;
boolean inTestHarness = TestUtil.iWhereAreWe == TestUtil.VM_HARNESS;
TestUtil.logTrace("Check if called from within test process, inTestHarness= " + inTestHarness);
boolean isVehicleClient = false;
URL thisURL = getClass().getProtectionDomain().getCodeSource().getLocation();
TestUtil.logTrace("in ServiceEETest.run(), this URL is: " + thisURL);
Expand All @@ -95,7 +96,17 @@ public Status run(String[] argv, Properties p) {
URL vcClassURL = vcClass.getProtectionDomain().getCodeSource().getLocation();
TestUtil.logTrace("VehicleClient URL is: " + vcClassURL);
isVehicleClient = vcClass.isAssignableFrom(getClass());
TestUtil.logTrace("VehicleClient URL is: " + vcClassURL);
TestUtil.logTrace("VehicleClient class check if is vehicle class = " +
(isVehicleClient? "yes, is a com.sun.ts.tests.common.vehicle.VehicleClient"
: "no, is not com.sun.ts.tests.common.vehicle.VehicleClient class"));
if (inTestHarness && !isVehicleClient) {
String sVehicle = TestUtil.getProperty(p, "vehicle");
if("stateless3".equals(sVehicle) || "stateful3".equals(sVehicle)
|| "appmanaged".equals(sVehicle) || "appmanagedNoTx".equals(sVehicle)) {
isVehicleClient = true;
TestUtil.logTrace("Using appclient vehicle so set is vehicle client to true");
}
}
} catch (ClassNotFoundException e) {
TestUtil.logTrace("VehicleClient class not found, so not a vehicle client.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ abstract public class PMClientBase extends ServiceEETest implements UseEntityMan
/**
* Persistence unit name.
*/
private String persistenceUnitName;
protected String persistenceUnitName;

protected String secondPersistenceUnitName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1857,6 +1857,31 @@ public void removeTestData() {
}
}

public void setup(String[] args, Properties p) throws Exception {
logTrace("PMClientBase.setup");
myProps = p;

persistenceUnitName = p.getProperty(PERSISTENCE_UNIT_NAME_PROP);
logTrace("Persistence Unit Name =" + persistenceUnitName);
secondPersistenceUnitName = p
.getProperty(SECOND_PERSISTENCE_UNIT_NAME_PROP);
logTrace("Second Persistence Unit Name =" + secondPersistenceUnitName);
if (JAKARTA_EE.equalsIgnoreCase(p.getProperty(MODE_PROP))) {
logTrace(MODE_PROP + " is set to " + p.getProperty(MODE_PROP)
+ ", so tests are running in JakartaEE environment.");
} else if (STANDALONE_MODE.equalsIgnoreCase(p.getProperty(MODE_PROP))) {
logTrace(MODE_PROP + " is set to " + p.getProperty(MODE_PROP)
+ ", so tests are running in J2SE environment standalone mode."
+ PERSISTENCE_UNIT_NAME_PROP + " is set to " + persistenceUnitName);
} else {
logMsg("WARNING: " + MODE_PROP + " is set to " + p.getProperty(MODE_PROP)
+ ", an invalid value.");
}

cachingSupported = Boolean.parseBoolean(
p.getProperty(PERSISTENCE_SECOND_LEVEL_CACHING_SUPPORTED, "true"));
displayProperties(p);
}

public void setupProductData(String[] args, Properties p) throws Exception {
logTrace("setupProductData");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client1.class.getResource("//com/sun/ts/tests/common/vehicle/appmanaged/appmanaged_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_appmanaged_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_appmanaged_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_appmanaged_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client1.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client1.class.getResource("//com/sun/ts/tests/common/vehicle/appmanagedNoTx/appmanagedNoTx_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_appmanagedNoTx_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_appmanagedNoTx_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_appmanagedNoTx_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client1.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client1.class.getResource("//com/sun/ts/tests/common/vehicle/stateful3/stateful3_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_stateful3_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_stateful3_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_stateful3_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client1.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client1.class.getResource("//com/sun/ts/tests/common/vehicle/stateless3/stateless3_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_stateless3_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_stateless3_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_stateless3_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client1.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client2.class.getResource("//com/sun/ts/tests/common/vehicle/appmanaged/appmanaged_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_appmanaged_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_appmanaged_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_appmanaged_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client2.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client2.class.getResource("//com/sun/ts/tests/common/vehicle/appmanagedNoTx/appmanagedNoTx_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_appmanagedNoTx_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_appmanagedNoTx_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_appmanagedNoTx_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client2.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client2.class.getResource("//com/sun/ts/tests/common/vehicle/stateful3/stateful3_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_stateful3_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_stateful3_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_stateful3_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client2.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client2.class.getResource("//com/sun/ts/tests/common/vehicle/stateless3/stateless3_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_stateless3_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_stateless3_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_stateless3_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client2.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client3.class.getResource("//com/sun/ts/tests/common/vehicle/appmanaged/appmanaged_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_appmanaged_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_appmanaged_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_appmanaged_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client3.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client3.class.getResource("//com/sun/ts/tests/common/vehicle/appmanagedNoTx/appmanagedNoTx_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_appmanagedNoTx_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_appmanagedNoTx_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_appmanagedNoTx_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client3.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client3.class.getResource("//com/sun/ts/tests/common/vehicle/stateful3/stateful3_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_stateful3_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_stateful3_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_stateful3_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client3.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client3.class.getResource("//com/sun/ts/tests/common/vehicle/stateless3/stateless3_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_stateless3_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_stateless3_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_stateless3_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client3.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client4.class.getResource("//com/sun/ts/tests/common/vehicle/appmanaged/appmanaged_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_appmanaged_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_appmanaged_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_appmanaged_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client4.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client4.class.getResource("//com/sun/ts/tests/common/vehicle/appmanagedNoTx/appmanagedNoTx_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_appmanagedNoTx_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_appmanagedNoTx_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_appmanagedNoTx_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client4.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client4.class.getResource("//com/sun/ts/tests/common/vehicle/stateful3/stateful3_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_stateful3_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_stateful3_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_stateful3_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client4.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client4.class.getResource("//com/sun/ts/tests/common/vehicle/stateless3/stateless3_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_annotations_access_field_stateless3_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_annotations_access_field_stateless3_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_annotations_access_field_stateless3_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client4.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client.class.getResource("/com/sun/ts/tests/common/vehicle/appmanaged/appmanaged_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_anno_access_mappedsc_appmanaged_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_anno_access_mappedsc_appmanaged_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_anno_access_mappedsc_appmanaged_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The sun-application-client.xml file need to be added or should this be in in the vendor Arquillian extension?
resURL = Client.class.getResource("/com/sun/ts/tests/common/vehicle/appmanagedNoTx/appmanagedNoTx_vehicle_client.jar.sun-application-client.xml");
if(resURL != null) {
jpa_core_anno_access_mappedsc_appmanagedNoTx_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
jpa_core_anno_access_mappedsc_appmanagedNoTx_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_anno_access_mappedsc_appmanagedNoTx_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client.class.getName() + "\n"), "MANIFEST.MF");
// Call the archive processor
Expand Down
Loading

0 comments on commit 4476976

Please sign in to comment.