Skip to content

Commit

Permalink
Merge branch 'main' into issue1405
Browse files Browse the repository at this point in the history
  • Loading branch information
arjantijms committed Dec 4, 2024
2 parents 609e754 + d1f1bee commit 02219e8
Show file tree
Hide file tree
Showing 2,579 changed files with 76,035 additions and 151,275 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ jakartaeetck-bundles/
/tck-env.cfg
.DS_Store
wip-find.txt

core-profile-tck/examples/wf-core-tck-runner
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "core-profile-tck/examples/wf-core-tck-runner"]
path = core-profile-tck/examples/wf-core-tck-runner
url = https://github.com/wildfly/wildfly-tck-runners
2 changes: 1 addition & 1 deletion appclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>assembly</artifactId>
<artifactId>assembly-tck</artifactId>
</dependency>
<dependency>
<groupId>jakarta.ejb</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@
import java.util.logging.Logger;

/**
* A base class that uses the {@link Runtime#exec(String[], String[], File)} method to launch a Jakarta EE appclient.
* Vendors override this class to provide implementations of:
* {@link #getAppClientCommand()} - the command line expected to invoke your Application Client main
* {@link #getAppClientEnv()} - optional environment variables that should be provided when running the Application client
* {@link #getAppClientDir()} - optional directory from which the appclient process should run
* A class that uses the {@link Runtime#exec(String[], String[], File)} method to launch a Jakarta EE appclient.
* Vendors configure the appclient via the {@link AppClientProtocolConfiguration} class using the
* protocol element of the arquillian.xml file.
*/
public class AppClientCmd {
private static final Logger LOGGER = Logger.getLogger(AppClientCmd.class.getName());
Expand All @@ -47,6 +45,7 @@ public class AppClientCmd {
private String[] clientEnvp = null;
private File clientDir = null;
private String clientEarDir;
private String clientEarLibClasspath;
private CompletableFuture<Process> onExit;


Expand All @@ -59,6 +58,7 @@ public AppClientCmd(AppClientProtocolConfiguration config) {
clientEnvp = config.clientEnvAsArray();
clientDir = config.clientDirAsFile();
clientEarDir = config.getClientEarDir();
clientEarLibClasspath = config.clientEarLibClasspath();
}

public boolean waitForExit(long timeout, TimeUnit units) throws InterruptedException {
Expand Down Expand Up @@ -114,7 +114,6 @@ public void run(String vehicleArchiveName, String clientAppArchive, String... ad

ArrayList<String> cmdList = new ArrayList<String>();


// Need to replace any property refs on command line
File earDir = new File(clientEarDir);
if(earDir.isAbsolute()) {
Expand All @@ -135,21 +134,32 @@ public void run(String vehicleArchiveName, String clientAppArchive, String... ad
arg = arg.replaceAll("\\$\\{clientAppArchive}", clientAppArchive);
cmdLine[n] = arg;
}

if(arg.contains("${clientEarLibClasspath}")) {
arg = arg.replaceAll("\\$\\{clientEarLibClasspath}", clientEarLibClasspath);
cmdLine[n] = arg;
}
}
// Replace any ${clientEarLibClasspath} in the client ENV
for(int n = 0; n < clientEnvp.length; n++) {
String env = clientEnvp[n];
if(env.contains("${clientEarLibClasspath}")) {
String env2 = env.replaceAll("\\$\\{clientEarLibClasspath}", clientEarLibClasspath);
LOGGER.info("Replaced clientEarLibClasspath in "+env2);
clientEnvp[n] = env2;
}
}

// Split the command line into individual arguments based on spaces
for (int n = 0; n < cmdLine.length; n ++) {
String arg = cmdLine[n];
cmdList.addAll(Arrays.asList(cmdLine[n].split(" ")));
}

// Add any additional args
if (additionalArgs != null) {
String[] newCmdLine = new String[cmdLine.length + additionalArgs.length];
System.arraycopy(cmdLine, 0, newCmdLine, 0, cmdLine.length);
System.arraycopy(additionalArgs, 0, newCmdLine, cmdLine.length, additionalArgs.length);
cmdLine = newCmdLine;
cmdList.addAll(Arrays.asList(additionalArgs));

}

appClientProcess = Runtime.getRuntime().exec(cmdList.toArray(new String[0]), clientEnvp, clientDir);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tck.arquillian.protocol.appclient;

import org.jboss.arquillian.container.spi.client.deployment.Deployment;
import org.jboss.arquillian.container.test.spi.client.protocol.ProtocolConfiguration;
import tck.arquillian.protocol.common.ProtocolCommonConfig;

Expand Down Expand Up @@ -117,7 +118,12 @@ public String getClientCmdLineString() {
* the parsed command line array elements are trimmed of leading and trailing whitespace.
* The command line should be filtered against the ts.jte file if it contains any property references. In addition
* to ts.jte property references, the command line can contain ${clientEarDir} which will be replaced with the
* #clientEarDir value. Any ${vehicleArchiveName} ref will be replaced with the vehicleArchiveName passed to the
* #clientEarDir value. Any ${vehicleArchiveName} ref will be replaced with the vehicle archive name extracted by
* {@link tck.arquillian.protocol.common.TsTestPropsBuilder#vehicleArchiveName(Deployment)}.
* Any ${clientAppArchive} ref will be replaced with the clientAppArchive extracted by the
* {@link AppClientDeploymentPackager} processing of the target appclient ear.
* Any ${clientEarLibClasspath} ref will be replaced with the classpath of the client ear lib directory if
* {@link #unpackClientEar} is true and the clientEarDir/lib directory exists.
* @param clientCmdLineString
*/
public void setClientCmdLineString(String clientCmdLineString) {
Expand Down Expand Up @@ -146,6 +152,12 @@ public void setClientDir(String clientDir) {
public String getClientEarDir() {
return clientEarDir;
}
/**
* Set the directory to extract the final appclient ear test artifact. The default is "target/appclient".
* Any ${clientEarDir} ref in the {@link #clientCmdLineString} will be replaced with the clientEarDir
* value.
* @param clientEarDir
*/
public void setClientEarDir(String clientEarDir) {
this.clientEarDir = clientEarDir;
}
Expand Down Expand Up @@ -188,6 +200,26 @@ public File clientDirAsFile() {
return dir;
}

/**
* If #unpackClientEar is true, and clientEarDir/lib exists, then this method returns the contents
* of the clientEarDir/lib as a classpath string
* @return a classpath string for the client ear lib directory
*/
public String clientEarLibClasspath() {
StringBuilder cp = new StringBuilder();
File libDir = new File(clientEarDir, "lib");
if (unpackClientEar && libDir.exists()) {
File[] jars = libDir.listFiles();
for (File jar : jars) {
if (!cp.isEmpty()) {
cp.append(File.pathSeparator);
}
cp.append(jar.getAbsolutePath());
}
}
return cp.toString();
}

/**
* Parse the clientCmdLineString into an array of strings using the cmdLineArgSeparator. This calls String#split on the
* clientCmdLineString and then trims each element of the resulting array.
Expand Down
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 Expand Up @@ -102,7 +104,7 @@ public class TsTestPropsBuilder {

/**
* Get the deployment vehicle archive name from the deployment archive. This needs to be a vehicle deployment
* for the result to be value.
* for the result to be valid.
* @param deployment - current test deployment
* @return base vehicle archive name
*/
Expand Down
86 changes: 71 additions & 15 deletions assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,31 @@
<version>11.0.0-SNAPSHOT</version>
</parent>

<artifactId>assembly</artifactId>
<artifactId>assembly-tck</artifactId>
<packaging>jar</packaging>

<name>ASSEMBLY</name>
<name>assembly-tck</name>
<description>ASSEMBLY</description>

<properties>
<arquillian.junit>1.9.1.Final</arquillian.junit>
<jakarta.platform.version>11.0.0-M2</jakarta.platform.version>
<junit.jupiter.version>5.10.2</junit.jupiter.version>
<version.jakarta.tck.arquillian>${project.version}</version.jakarta.tck.arquillian>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.jupiter.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
Expand All @@ -49,21 +68,57 @@
<groupId>jakarta.mail</groupId>
<artifactId>jakarta.mail-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.jupiter.version}</version>
</dependency>
<dependency>
<groupId>jakarta.tck.arquillian</groupId>
<artifactId>arquillian-protocol-appclient</artifactId>
<version>${version.jakarta.tck.arquillian}</version>
</dependency>
<dependency>
<groupId>jakarta.tck.arquillian</groupId>
<artifactId>arquillian-protocol-common</artifactId>
<version>${version.jakarta.tck.arquillian}</version>
</dependency>
<dependency>
<groupId>jakarta.tck.arquillian</groupId>
<artifactId>arquillian-protocol-javatest</artifactId>
<version>${version.jakarta.tck.arquillian}</version>
</dependency>
<dependency>
<groupId>jakarta.tck.arquillian</groupId>
<artifactId>arquillian-protocol-lib</artifactId>
<version>${version.jakarta.tck.arquillian}</version>
</dependency>
<dependency>
<groupId>jakarta.tck.arquillian</groupId>
<artifactId>tck-porting-lib</artifactId>
<version>${version.jakarta.tck.arquillian}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-core</artifactId>
<version>${arquillian.junit}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-container</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-core</artifactId>
</dependency>
</dependencies>

<build>
<!-- Include the container descriptors in the output artifact -->
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/test.jsp</include>
</includes>
<excludes>
<exclude>**/build.xml</exclude>
</excludes>
</resource>
</resources>
<plugins>
<!-- do not publish this artifact to Maven repositories -->
<plugin>
Expand All @@ -74,4 +129,5 @@
</plugin>
</plugins>
</build>

</project>
Loading

0 comments on commit 02219e8

Please sign in to comment.