Skip to content

Commit

Permalink
None of these changes help GlassFish to run the appclient tests
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Marlow <smarlow@redhat.com>
  • Loading branch information
scottmarlow committed Nov 5, 2024
1 parent bb82cf8 commit b00b843
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class TsTestPropsBuilder {
// Property names passed from the ts.jte file to the tstest.jte file
// Parsed from the test @class.setup_props: values + additional seen to be used by harness
static String[] tsJtePropNames = {
"s1as",
"s1as.modules",
"Driver",
"authpassword",
"authuser",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@

import java.util.Properties;

import javax.naming.InitialContext;
import javax.naming.NameClassPair;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;

import com.sun.ts.lib.harness.Status;
import com.sun.ts.lib.util.TSNamingContext;
import com.sun.ts.lib.util.TestUtil;
Expand All @@ -33,9 +38,15 @@ public class AppManagedVehicleRunner implements VehicleRunnable {
public Status run(String[] args, Properties props) {
Status sTestStatus = null;
try {
TSNamingContext jc = new TSNamingContext();
AppManagedVehicleIF bean = (AppManagedVehicleIF) jc
.lookup(APPMANAGED_REF_NAME);
AppManagedVehicleIF bean=null;
TSNamingContext jc = new TSNamingContext(props);
try {
bean = (AppManagedVehicleIF) jc
.lookup(APPMANAGED_REF_NAME);
} catch (Exception e) {
e.printStackTrace();
dumpJndi("", new InitialContext());
}
TestUtil.logTrace(
"application-managed JTA runner looked up vehicle: " + bean);
sTestStatus = (bean.runTest(args, props)).toStatus();
Expand All @@ -46,4 +57,24 @@ public Status run(String[] args, Properties props) {
}
return sTestStatus;
}

private void dumpJndi(String s,InitialContext jc ) {
try {
dumpTreeEntry(jc, jc.list(s), s);
} catch (Exception ignore) {
}
}
private void dumpTreeEntry(InitialContext jc, NamingEnumeration<NameClassPair> list, String s) throws NamingException {
System.out.println("\n1. AppManagedVehicleRunner jndi dump walking down tree branch name = " + s);
while (list.hasMore()) {
NameClassPair ncp = list.next();
System.out.println("2. AppManagedVehicleRunner jndi dump (show name + classname pair): " + ncp.toString());
if (s.length() == 0) {
dumpJndi(ncp.getName(), jc);
} else {
dumpJndi(s + "/" + ncp.getName(), jc);
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public class AppManagedNoTxVehicleRunner implements VehicleRunnable {
public Status run(String[] args, Properties props) {
Status sTestStatus = null;
try {
TSNamingContext jc = new TSNamingContext();
AppManagedNoTxVehicleIF bean = (AppManagedNoTxVehicleIF) jc
.lookup(APPMANAGEDNOTX_REF_NAME);
TestUtil.logTrace(
"application-managed resource-local runner looked up vehicle: "
+ bean);
TSNamingContext jc = new TSNamingContext();
AppManagedNoTxVehicleIF bean = (AppManagedNoTxVehicleIF) jc
.lookup(APPMANAGEDNOTX_REF_NAME);
TestUtil.logTrace(
"application-managed resource-local runner looked up vehicle: "
+ bean);
sTestStatus = (bean.runTest(args, props)).toStatus();
} catch (Exception e) {
TestUtil.logErr("Test failed.", e);
Expand Down
4 changes: 2 additions & 2 deletions glassfish-runner/jpa-platform-tck/jakartaeetck/bin/ts.jte
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ javaee.level=full
# @orb.port The port number the vendor implementation is listening
# to for service requests.
########################################################################
javaee.home=/Users/alwjosep/Documents/jakartaee-tck/glassfish-runner/jpa-platform-tck/target/glassfish8
javaee.home=/home/smarlow/tck/platformtck/glassfish-runner/jpa-platform-tck/target/glassfish8
orb.host=localhost
orb.port=4848

Expand Down Expand Up @@ -1429,7 +1429,7 @@ optional.tech.packages.to.ignore=jakarta.xml.bind
########################################################################
harness.temp.directory=${ts.home}/tmp
harness.log.port=2000
harness.log.traceflag=false
harness.log.traceflag=true
harness.executeMode=0
harness.socket.retry.count=10
harness.log.delayseconds=1
Expand Down
2 changes: 1 addition & 1 deletion glassfish-runner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<module>jsonb-tck</module>
<module>jsonp-tck</module>
<module>pages-tck</module>
<module>persistence-tck</module>
<module>jpa-platform-tck</module>
<module>servlet-tck</module>
</modules>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
// The application-client.xml descriptor
URL resURL = Client.class.getResource("/com/sun/ts/tests/common/vehicle/appmanagedNoTx/appmanagedNoTx_vehicle_client.xml");
if(resURL != null) {
System.out.println("xxx adding ./jpa/spec-tests/src/main/resources/com/sun/ts/tests/common/vehicle/appmanagedNoTx/appmanagedNoTx_vehicle_client.xml client container xml");
jpa_core_EntityGraph_appmanagedNoTx_vehicle_client.addAsManifestResource(resURL, "application-client.xml");
}
// 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");
resURL = Client.class.getResource("/com/sun/ts/tests/common/sunxml/sun-application-client.xml");
if(resURL != null) {
System.out.println("xxx /com/sun/ts/tests/common/sunxml/sun-application-client.xml added as sun-application-client.xml" );
jpa_core_EntityGraph_appmanagedNoTx_vehicle_client.addAsManifestResource(resURL, "sun-application-client.xml");
}
jpa_core_EntityGraph_appmanagedNoTx_vehicle_client.addAsManifestResource(new StringAsset("Main-Class: " + Client.class.getName() + "\n"), "MANIFEST.MF");
Expand Down Expand Up @@ -142,12 +144,13 @@ public static EnterpriseArchive createDeploymentVehicle(@ArquillianResource Test
com.sun.ts.tests.common.vehicle.appmanagedNoTx.AppManagedNoTxVehicleBean.class
);
// The ejb-jar.xml descriptor
URL ejbResURL1 = Client.class.getResource("/com/sun/ts/tests/common/vehicle/appmanagedNoTx/appmanagedNoTx_vehicle_client.xml");
if(ejbResURL1 != null) {
// URL ejbResURL1 = Client.class.getResource("/com/sun/ts/tests/common/vehicle/appmanagedNoTx/appmanagedNoTx_vehicle_client.xml");
// ^ is a application-client_10.xsd
// if(ejbResURL1 != null) {
// jpa_core_EntityGraph_appmanagedNoTx_vehicle_ejb.addAsManifestResource(ejbResURL1, "ejb-jar.xml");
}
// The sun-ejb-jar.xml file
ejbResURL1 = Client.class.getResource("/com/sun/ts/tests/common/vehicle/appmanagedNoTx/appmanagedNoTx_vehicle_ejb.jar.sun-ejb-jar.xml");
//}
// The sun-ejb-jar.xml file http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_0-0.dtd
URL ejbResURL1 = Client.class.getResource("/com/sun/ts/tests/common/vehicle/appmanagedNoTx/appmanagedNoTx_vehicle_ejb.jar.sun-ejb-jar.xml");
if(ejbResURL1 != null) {
jpa_core_EntityGraph_appmanagedNoTx_vehicle_ejb.addAsManifestResource(ejbResURL1, "sun-ejb-jar.xml");
}
Expand Down
6 changes: 6 additions & 0 deletions jpa/spec-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
<artifactId>persistence-platform-tck-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>common</artifactId>
<version>${project.version}</version>
</dependency>

</dependencies>
<build>
<resources>
Expand Down

0 comments on commit b00b843

Please sign in to comment.