Skip to content

Commit

Permalink
[RESTEASY-2544] pom updates to arquillian-util and integration-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rsearls authored and asoldano committed Apr 27, 2020
1 parent b9fa110 commit 2c98484
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 6 deletions.
30 changes: 26 additions & 4 deletions testsuite/arquillian-utils/pom.xml
Expand Up @@ -4,15 +4,25 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<!-- Can't use <parent> element in pom because it causes plexus
dependency recursion. Defining <dependencyManagement>
resolves this.
-->
<parent>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-testsuite</artifactId>
<version>4.6.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
<groupId>org.jboss</groupId>
<artifactId>jboss-parent</artifactId>
<version>35</version>
<relativePath/>
</parent>

<groupId>org.jboss.resteasy</groupId>
<artifactId>arquillian-utils</artifactId>
<version>4.6.0-SNAPSHOT</version>
<name>RESTEasy Main testsuite: Arquillian utils</name>
<packaging>jar</packaging>
<properties>
<version.resteasy.testsuite>${project.version}</version.resteasy.testsuite>
</properties>

<profiles>
<profile>
Expand All @@ -32,6 +42,18 @@
</profile>
</profiles>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-dependencies</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- arquillian general -->
<dependency>
Expand Down
Expand Up @@ -28,6 +28,8 @@ public class PortProviderUtil {

private static boolean ipv6 = Boolean.parseBoolean(System.getProperty("ipv6"));

private static final String QUARKUS_PROPERTY_FLAG = "quarkus.tester";
private static boolean isQuarkus = false;
/**
* Initialize port.
*/
Expand Down Expand Up @@ -55,6 +57,8 @@ public class PortProviderUtil {
}
}
}

isQuarkus = Boolean.parseBoolean(System.getProperty(QUARKUS_PROPERTY_FLAG));
}

// /**
Expand Down Expand Up @@ -139,12 +143,22 @@ public static String generateURL(String path, String testName) {
* @return a full URL
*/
public static String generateURL(String path, String testName, String hostName, int port) {
// quarkus does not generate URLs with contextRoot (i.e. archive name)
String localTestName = (isQuarkus) ? "": testName;

String localPath = path;
if (isQuarkus) {
if(path.startsWith("/")) {
localPath = path.substring(1);
}
}

// ipv4
if (!ipv6) {
return String.format("http://%s:%d/%s%s", hostName, port, testName, path);
return String.format("http://%s:%d/%s%s", hostName, port, localTestName, localPath);
}
// ipv6
return String.format("http://[%s]:%d/%s%s", hostName, port, testName, path);
return String.format("http://[%s]:%d/%s%s", hostName, port, localTestName, localPath);
}

/**
Expand Down
19 changes: 19 additions & 0 deletions testsuite/integration-tests/assembly/assembly.xml
@@ -0,0 +1,19 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">

<id>myAssembly</id>
<formats>
<format>zip</format>
</formats>
<baseDirectory>src</baseDirectory>
<fileSets>
<fileSet>
<directory>${basedir}/src</directory>
<outputDirectory/>
<excludes>
<exclude>test/resources/arquillian.xml</exclude>
<exclude>test/java/org/jboss/resteasy/test/UndertowTestRunner.java</exclude>
</excludes>
</fileSet>
</fileSets>
</assembly>
43 changes: 43 additions & 0 deletions testsuite/integration-tests/pom.xml
Expand Up @@ -623,6 +623,49 @@

</executions>
</plugin>

<!-- generate archive needed by project resteasy-quarkus-testsuite -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>assembly/assembly.xml</descriptor>
</descriptors>
<finalName>resteasy-integration-tests-${project.version}-sources</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>trigger-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<configuration>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-integration-tests</artifactId>
<version>${project.version}</version>
<packaging>zip</packaging>
<classifier>sources</classifier>
<file>${project.build.directory}/resteasy-integration-tests-${project.version}-sources.zip</file>
</configuration>
<executions>
<execution>
<id>install-assembly-zip</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>install</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 2c98484

Please sign in to comment.