Skip to content

Commit

Permalink
Fixes #3945 - Update Core Profile TCK runner to use the correct HTTP …
Browse files Browse the repository at this point in the history
…client libraries (#3946)
  • Loading branch information
mnriem authored Sep 10, 2024
1 parent 85ab476 commit 8374b56
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -322,14 +321,21 @@ private String determineVersionToUse() {
*/
private void startPiranha(File runtimeDirectory, File warFile) throws IOException, DeploymentException {
List<String> commands = new ArrayList<>();
StringBuilder classpath = new StringBuilder();
commands.add("java");
List<String> jvmARgs = Arrays.asList(configuration.getJvmArguments().split("\\s+"));
if (!jvmARgs.isEmpty()) {
jvmARgs.forEach(s -> {
if (s != null && !s.trim().equals("")) {
commands.add(s);
String[] jvmArgs = configuration.getJvmArguments().split("\\s+");
if (jvmArgs.length > 0) {
for(int i=0; i<jvmArgs.length; i++) {
if (jvmArgs[i] != null && !jvmArgs[i].trim().equals("")) {
commands.add(jvmArgs[i]);
}
});
if (jvmArgs[i] != null && jvmArgs[i].trim().equals("-cp")) {
// ignore this one.
}
if (i > 0 && jvmArgs[i] != null && jvmArgs[i-1].trim().equals("-cp")) {
classpath.append(jvmArgs[i].trim()).append(File.pathSeparatorChar);
}
}
}

if (configuration.isDebug()) {
Expand All @@ -340,8 +346,14 @@ private void startPiranha(File runtimeDirectory, File warFile) throws IOExceptio
commands.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:9009");
}

commands.add("-jar");
commands.add("piranha-dist-coreprofile.jar");
if (classpath.isEmpty()) {
commands.add("-jar");
commands.add("piranha-dist-coreprofile.jar");
} else {
commands.add("-cp");
commands.add(classpath.toString() + "piranha-dist-coreprofile.jar");
commands.add("cloud.piranha.dist.coreprofile.CoreProfilePiranhaMain");
}
commands.add("--http-port");
commands.add(Integer.toString(configuration.getHttpPort()));
commands.add("--war-file");
Expand Down
35 changes: 9 additions & 26 deletions external/tck/coreprofile/coreprofile/runner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>core-runner</artifactId>
<version>1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Piranha Core Profile - Jakarta CDI TCK - Runner</name>
<name>Piranha Core Profile - Jakarta Core Profile TCK - Runner</name>
<properties>
<piranha.version>24.9.0-SNAPSHOT</piranha.version>
</properties>
Expand Down Expand Up @@ -72,29 +72,16 @@
<version>5.11.0</version>
<scope>test</scope>
</dependency>
<!-- RESTEasy required dependencies -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-core</artifactId>
<version>6.2.10.Final</version>
<groupId>org.omnifaces.arquillian</groupId>
<artifactId>glassfish-client-ee10</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>6.2.10.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-json-binding-provider</artifactId>
<version>6.2.10.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
<version>6.2.10.Final</version>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -113,18 +100,14 @@
</goals>
</execution>
</executions>
<configuration>
<configuration>
<dependenciesToScan>
<dependency>jakarta.ee.tck.coreprofile:core-profile-tck-impl</dependency>
</dependenciesToScan>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<systemPropertyVariables>
<arquillian.launch>piranha</arquillian.launch>
</systemPropertyVariables>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugin>
</plugins>
</build>
</profile>
Expand Down

0 comments on commit 8374b56

Please sign in to comment.