Skip to content

Commit

Permalink
Some fixes for #1699
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 11, 2024
1 parent 4c27b3f commit d93f123
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
import jakarta.persistence.PersistenceUnit;
import jakarta.transaction.UserTransaction;

import java.io.PrintWriter;
import java.io.StringWriter;

@PersistenceContexts({
@PersistenceContext(name = "persistence/CTS-EM", unitName = "CTS-EM"),
@PersistenceContext(name = "persistence/CTS-EM2", unitName = "CTS-EM2") })
Expand Down Expand Up @@ -114,9 +117,13 @@ protected RemoteStatus runTest() {
System.out.println("Test running in pmservlet vehicle failed");
}
} catch (Throwable e) {
sTestStatus = new RemoteStatus(
Status.failed("Test running in pmservlet vehicle failed"));
e.printStackTrace();
StringBuilder sb = new StringBuilder();
sb.append("Test running in pmservlet vehicle failed: ");
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
sb.append(sw.toString());
sTestStatus = new RemoteStatus(Status.failed(sb.toString()));
TestUtil.logErr("Test running in pmservlet vehicle failed", e);
}

return sTestStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2097,7 +2097,7 @@ ts.standard.deployment.server.classpath=${ant.jars}:${pathsep}${ts.run.classpath

harness.deployment.server.port=2002

java.naming.factory.initial=foo
java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory
org.omg.CORBA.ORBClass=foo
undeploy_redeploy_apps=${UNDEPLOY_REDEPLOY_FLAG}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,9 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
if(warResURL != null) {
jpa_core_query_flushmode_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_flushmode_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/flushmode/jpa_core_query_flushmode.jar");
if(warResURL != null) {
jpa_core_query_flushmode_pmservlet_vehicle_web.addAsWebResource(warResURL, "/WEB-INF/lib/jpa_core_query_flushmode.jar");
}
warResURL = Client2.class.getResource("/com/sun/ts/tests/common/vehicle/pmservlet/pmservlet_vehicle_web.xml");
if(warResURL != null) {
jpa_core_query_flushmode_pmservlet_vehicle_web.addAsWebResource(warResURL, "/WEB-INF/pmservlet_vehicle_web.xml");
}

// Call the archive processor
archiveProcessor.processWebArchive(jpa_core_query_flushmode_pmservlet_vehicle_web, Client2.class, warResURL);
Expand Down Expand Up @@ -137,25 +123,10 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
if(parURL != null) {
jpa_core_query_flushmode.addAsManifestResource(parURL, "persistence.xml");
}
// Add the Persistence mapping-file
URL mappingURL = Client2.class.getResource("myMappingFile.xml");
if(mappingURL != null) {
jpa_core_query_flushmode.addAsResource(mappingURL, "myMappingFile.xml");
}
mappingURL = Client2.class.getResource("myMappingFile1.xml");
if(mappingURL != null) {
jpa_core_query_flushmode.addAsResource(mappingURL, "myMappingFile1.xml");
}
mappingURL = Client2.class.getResource("myMappingFile2.xml");
if(mappingURL != null) {
jpa_core_query_flushmode.addAsResource(mappingURL, "myMappingFile2.xml");
}
// Call the archive processor
archiveProcessor.processParArchive(jpa_core_query_flushmode, Client2.class, parURL);
parURL = Client2.class.getResource("orm.xml");
if(parURL != null) {
jpa_core_query_flushmode.addAsManifestResource(parURL, "orm.xml");
}

jpa_core_query_flushmode_pmservlet_vehicle_web.addAsLibrary(jpa_core_query_flushmode);

// Ear
EnterpriseArchive jpa_core_query_flushmode_vehicles_ear = ShrinkWrap.create(EnterpriseArchive.class, "jpa_core_query_flushmode_vehicles.ear");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import java.util.List;

import com.sun.ts.lib.harness.SetupMethod;
import com.sun.ts.lib.harness.Status;
import ee.jakarta.tck.persistence.common.schema30.Util;

Expand Down Expand Up @@ -60,7 +61,8 @@ public static void main(String[] args) {
* updated name.*
*
*/
public void flushModeTest1() throws Exception {
@SetupMethod(name = "setupCustomerData")
public void flushModeTest1() throws Exception {
boolean pass1 = false;
boolean pass2 = false;
boolean pass3 = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.List;
import java.util.Vector;

import com.sun.ts.lib.harness.SetupMethod;
import com.sun.ts.lib.harness.Status;
import ee.jakarta.tck.persistence.common.schema30.Util;

Expand Down Expand Up @@ -56,6 +57,7 @@ public static void main(String[] args) {
* customer used in the setCustomer call.
*
*/
@SetupMethod(name = "setupOrderData")
public void flushModeTest2() throws Exception {
boolean pass = false;
String expectedPKs[];
Expand Down Expand Up @@ -99,7 +101,8 @@ public void flushModeTest2() throws Exception {
* updates the name of a customer. It then executes an EJBQL query selecting
* orders where the related customer has the updated name.
*/
public void flushModeTest3() throws Exception {
@SetupMethod(name = "setupOrderData")
public void flushModeTest3() throws Exception {
boolean pass = false;
String expectedPKs[];
List o;
Expand Down Expand Up @@ -143,7 +146,8 @@ public void flushModeTest3() throws Exception {
* name of the new spouse.
*
*/
public void flushModeTest4() throws Exception {
@SetupMethod(name = "setupOrderData")
public void flushModeTest4() throws Exception {
boolean pass = false;
String expectedPKs[];

Expand Down Expand Up @@ -190,7 +194,8 @@ public void flushModeTest4() throws Exception {
* selecting orders where the related spouse of the related customer has the
* updated name.
*/
public void flushModeTest5() throws Exception {
@SetupMethod(name = "setupOrderData")
public void flushModeTest5() throws Exception {
boolean pass = false;
String expectedPKs[];

Expand Down Expand Up @@ -232,7 +237,8 @@ public void flushModeTest5() throws Exception {
* executes an EJBQL query selecting customers having an order with the removed
* number.
*/
public void flushModeTest6() throws Exception {
@SetupMethod(name = "setupOrderData")
public void flushModeTest6() throws Exception {
boolean pass = false;
String expectedPKs[];

Expand Down Expand Up @@ -282,7 +288,8 @@ public void flushModeTest6() throws Exception {
* executes an EJBQL query selecting a spouse whose customer has an order with
* an credit card having the new number.
*/
public void flushModeTest7() throws Exception {
@SetupMethod(name = "setupOrderData")
public void flushModeTest7() throws Exception {
boolean pass = false;
String[] expected = new String[1];
expected[0] = "2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import java.util.List;

import com.sun.ts.lib.harness.SetupMethod;
import com.sun.ts.lib.harness.Status;
import ee.jakarta.tck.persistence.common.schema30.Util;

Expand All @@ -47,6 +48,7 @@ public static void main(String[] args) {
*
* @test_Strategy:
*/
@SetupMethod(name = "setupProductData")
public void secondaryTablesValueTest() throws Exception {
boolean pass = false;

Expand Down

0 comments on commit d93f123

Please sign in to comment.