Skip to content

Commit

Permalink
Merge pull request #1560 from alwin-joseph/jta_ee_appclient
Browse files Browse the repository at this point in the history
Jakarta Transcations TCK : Refactor appclient tests
  • Loading branch information
scottmarlow authored Oct 4, 2024
2 parents ddf58ec + 73ddfad commit 63faf2f
Show file tree
Hide file tree
Showing 22 changed files with 472 additions and 428 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
125 changes: 122 additions & 3 deletions glassfish-runner/jta-platform-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<!-- Use JDK17 to run with GF 8.0.0-JDK17-M5 -->
<glassfish.container.version>8.0.0-JDK17-M7</glassfish.container.version>
<glassfish.home>${project.build.directory}/${glassfish.toplevel.dir}</glassfish.home>
<glassfish.lib.dir>${glassfish.home}/glassfish/lib</glassfish.lib.dir>
<!-- Use JDK21 to run with GF 8.0.0-M5 -->
<!-- <glassfish.container.version>8.0.0-M5</glassfish.container.version> -->
<glassfish.toplevel.dir>glassfish8</glassfish.toplevel.dir>
Expand Down Expand Up @@ -136,6 +137,21 @@
<artifactId>arquillian-container-test-spi</artifactId>
<version>${arquillian.junit}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-spi</artifactId>
<version>${arquillian.junit}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.core</groupId>
<artifactId>arquillian-core-spi</artifactId>
<version>${arquillian.junit}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.test</groupId>
<artifactId>arquillian-test-impl-base</artifactId>
<version>${arquillian.junit}</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.common</groupId>
<artifactId>simple-glassfish-api</artifactId>
Expand All @@ -159,7 +175,7 @@
<dependency>
<groupId>org.omnifaces.arquillian</groupId>
<artifactId>arquillian-glassfish-server-managed</artifactId>
<version>1.4</version>
<version>1.6</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -231,6 +247,43 @@
<artifactId>tck-porting-lib</artifactId>
<version>${version.jakarta.tck.arquillian}</version>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>libutil</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>runtime</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>dbprocedures</artifactId>
<version>3.2.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.15.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
<version>10.15.2.0</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -304,6 +357,73 @@
</artifactItems>
</configuration>
</execution>
<execution>
<id>004-copy-lib</id>
<goals>
<goal>copy</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<artifactItems>
<artifactItem>
<groupId>jakarta.tck</groupId>
<artifactId>libutil</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>libutil.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>jakarta.tck</groupId>
<artifactId>common</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>common.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>jakarta.tck.arquillian</groupId>
<artifactId>tck-porting-lib</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>tck-porting-lib.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>jakarta.tck</groupId>
<artifactId>runtime</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>runtime.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>jakarta.tck</groupId>
<artifactId>${tck.artifactId}</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>jta-tck.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${glassfish.lib.dir}</outputDirectory>
<destFileName>derbyclient.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${glassfish.lib.dir}</outputDirectory>
<destFileName>derbytools.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>jakarta.tck.arquillian</groupId>
<artifactId>arquillian-protocol-lib</artifactId>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>arquillian-protocol-lib.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down Expand Up @@ -338,7 +458,6 @@
</arguments>
</configuration>
</execution>

</executions>
</plugin>
<plugin>
Expand Down Expand Up @@ -384,7 +503,6 @@
<!-- Select the @Tag("tck-appclient") tests -->
<groups>tck-appclient</groups>
<includes>
<include>com/sun/ts/tests/jta/ee/transactional/*Ejb*.java</include>
<include>com/sun/ts/tests/jta/ee/txpropagationtest/*Ejb*.java</include>
<include>com/sun/ts/tests/jta/ee/usertransaction/**/*EjbTest*.java</include>
</includes>
Expand All @@ -404,6 +522,7 @@
<harness.log.traceflag>true</harness.log.traceflag>
<cts.harness.debug>true</cts.harness.debug>
<java.io.tmpdir>/tmp</java.io.tmpdir>
<project.basedir>${project.basedir}</project.basedir>
<arquillian.xml>appclient-arquillian.xml</arquillian.xml>
</systemPropertyVariables>
<environmentVariables>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/

package org.glassfish.transactions.core.tck;
package org.glassfish.transactions.tck;

import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/

package org.glassfish.transactions.core.tck;
package org.glassfish.transactions.tck;

import org.jboss.arquillian.config.descriptor.api.ArquillianDescriptor;
import org.jboss.arquillian.config.descriptor.api.ExtensionDef;
Expand Down Expand Up @@ -78,7 +78,7 @@ public void initalize(@Observes ArquillianDescriptor descriptor) {
@Override
public void processClientArchive(JavaArchive clientArchive, Class<?> testClass, URL sunXmlURL) {
String name = clientArchive.getName();
addDescriptors(name, clientArchive, testClass);
// addDescriptors(name, clientArchive, testClass);
}

@Override
Expand All @@ -100,13 +100,13 @@ public void processParArchive(JavaArchive javaArchive, Class<?> aClass, URL url)
@Override
public void processEarArchive(EnterpriseArchive earArchive, Class<?> testClass, URL sunXmlURL) {
String name = earArchive.getName();
addDescriptors(name, earArchive, testClass);
// addDescriptors(name, earArchive, testClass);
}

@Override
public void processEjbArchive(JavaArchive ejbArchive, Class<?> testClass, URL sunXmlURL) {
String name = ejbArchive.getName();
addDescriptors(name, ejbArchive, testClass);
// addDescriptors(name, ejbArchive, testClass);
}

protected void addDescriptors(String archiveName, ManifestContainer<?> archive, Class<?> testClass) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
org.glassfish.transactions.core.tck.GlassfishLoadableExtension
org.glassfish.transactions.tck.GlassfishLoadableExtension
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,57 @@
</engine>

<extension qualifier="glassfish-descriptors">
<property name="descriptorDir">${ts.home}/dist/</property>
<property name="descriptorDir">target/</property>
</extension>

<group qualifier="glassfish-servers" default="true">
<container qualifier="tck-appclient" default="true">
<configuration>
<property name="glassFishHome">target/glassfish8</property>
</configuration>
<protocol type="appclient">
<protocol type="appclient" default="true">
<property name="runClient">true</property>
<property name="runAsVehicle">true</property>
<property name="clientEarDir">target/appclient</property>
<property name="unpackClientEar">true</property>
<!-- Need to populate from ts.jte command.testExecuteAppClient setting for glassfish -->
<!-- <property name="clientCmdLineString">${javaee.home}/bin/appclient.sh;-y;target/test-classes/appclient.yml;-y;target/test-classes/derby.yml;${clientEarDir}/${vehicleArchiveName}.ear#${vehicleArchiveName}_client.jar</property> -->
<property name="clientCmdLineString">${glassfish.home}/glassfish/bin/appclient \
-Djdk.tls.client.enableSessionTicketExtension=false \
-Djdk.tls.server.enableSessionTicketExtension=false \
-Djava.security.policy=${glassfish.home}/glassfish/lib/appclient/client.policy \
-Dcts.tmp=${ts.home}/tmp \
-Djava.security.auth.login.config=${glassfish.home}/glassfish/lib/appclient/appclientlogin.conf \
-Djava.protocol.handler.pkgs=javax.net.ssl \
-Djavax.net.ssl.keyStore=${ts.home}/bin/certificates/clientcert.jks \
-Djavax.net.ssl.keyStorePassword=changeit \
-Djavax.net.ssl.trustStore=${glassfish.home}/glassfish/domains/domain1/config/cacerts.jks \
-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl \
-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl \
-Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl \
-Dorg.xml.sax.driver=com.sun.org.apache.xerces.internal.parsers.SAXParser \
-Dorg.xml.sax.parser=org.xml.sax.helpers.XMLReaderAdapter \
-Doracle.jdbc.J2EE13Compliant=true \
-Doracle.jdbc.mapDateToTimestamp \
-Dstartup.login=false \
-Dauth.gui=false \
-Dlog.file.location=${glassfish.home}/glassfish/domains/domain1/logs \
-Dri.log.file.location=${glassfish.home}/glassfish/domains/domain1/logs \
-DwebServerHost.2=localhost \
-DwebServerPort.2=8080 \
-Ddeliverable.class=com.sun.ts.lib.deliverable.cts.CTSDeliverable \
-jar \
${clientEarDir}/${clientAppArchive}
</property>
<property name="cmdLineArgSeparator">\\</property>
<!-- Pass ENV vars here -->
<property name="clientEnvString">CLASSPATH=${project.build.directory}/appclient/javatest.jar:${project.build.directory}/appclient/libutil.jar:${project.build.directory}/appclient/libcommon.jar</property>
<!-- <property name="clientEnvString">PATH=${env.PATH};LD_LIBRARY_PATH=${glassfish.home}/lib;AS_DEBUG=true;
APPCPATH=${glassfish.home}/glassfish/lib/arquillian-protocol-lib.jar:${glassfish.home}/glassfish/lib/tck-porting-lib.jar:target/appclient/lib/arquillian-core.jar:target/appclient/lib/arquillian-junit5.jar:${glassfish.home}/glassfish/modules/security.jar</property> -->
<property name="clientEnvString">PATH=${env.PATH};LD_LIBRARY_PATH=${glassfish.home}/lib;AS_DEBUG=true;
APPCPATH=target/lib/arquillian-protocol-lib.jar:target/lib/tck-porting-lib.jar:target/appclient/lib/arquillian-core.jar:target/appclient/lib/arquillian-junit5.jar:${glassfish.home}/glassfish/modules/security.jar:${glassfish.home}/glassfish/lib/gf-client.jar</property>
<property name="clientDir">${project.basedir}</property>
<property name="workDir">${ts.home}/tmp</property>
<property name="tsJteFile">${ts.home}/bin/ts.jte</property>
<property name="workDir">/tmp</property>
<property name="tsJteFile">jakartaeetck/bin/ts.jte</property>
<property name="tsSqlStmtFile">sql/derby/derby.dml.sql</property>
<property name="trace">true</property>
<property name="clientTimeout">20000</property>
</protocol>
Expand Down
Loading

0 comments on commit 63faf2f

Please sign in to comment.