Skip to content

Commit

Permalink
Add Jetty TCK module (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
radcortez authored Jan 27, 2023
1 parent 1b721ad commit 6031b80
Show file tree
Hide file tree
Showing 7 changed files with 248 additions and 4 deletions.
90 changes: 86 additions & 4 deletions bom/tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,23 @@
<name>SmallRye Testing: BOM TCK</name>

<properties>
<version.arquillian>1.6.0.Final</version.arquillian>
<!-- Arquillian -->
<version.arquillian>1.7.0.Alpha13</version.arquillian>
<version.arquillian.weld-embedded>2.1.0.Final</version.arquillian.weld-embedded>
<version.arquillian.wildfly>3.0.1.Final</version.arquillian.wildfly>
<version.arquillian.jetty>1.0.0.Final</version.arquillian.jetty>

<!-- Jetty -->
<version.jetty>9.4.49.v20220914</version.jetty>

<!-- MicroProfile -->
<version.jakarta.annotation>2.0.0</version.jakarta.annotation>
<version.jakarta.cdi>3.0.0</version.jakarta.cdi>
<version.jakarta.ws-rs>3.0.0</version.jakarta.ws-rs>
<version.jakarta.jsonp>2.0.0</version.jakarta.jsonp>
<version.jakarta.jsonb>2.0.0</version.jakarta.jsonb>
<version.weld>3.1.7.SP1</version.weld>
<version.resteasy>4.7.7.Final</version.resteasy>
</properties>

<dependencyManagement>
Expand All @@ -37,27 +51,95 @@
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- Arquillian JUnit 5 -->
<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-container</artifactId>
<version>${version.arquillian}</version>
</dependency>

<!-- Arquillian TestNG -->
<dependency>
<groupId>org.jboss.arquillian.testng</groupId>
<artifactId>arquillian-testng-container</artifactId>
<version>${version.arquillian}</version>
<scope>test</scope>
</dependency>

<!-- Arquillian with Weld -->
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-weld-embedded</artifactId>
<version>${version.arquillian.weld-embedded}</version>
<scope>test</scope>
</dependency>

<!-- Arquillian with Wildfly Managed -->
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>${version.arquillian.wildfly}</version>
<scope>test</scope>
</dependency>

<!-- Arquillian with Jetty -->
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-jetty-embedded-9</artifactId>
<version>${version.arquillian.jetty}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-bom</artifactId>
<version>${version.jetty}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- Jakarta Core Profile -->
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>${version.jakarta.annotation}</version>
</dependency>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>${version.jakarta.cdi}</version>
</dependency>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>${version.jakarta.ws-rs}</version>
</dependency>
<dependency>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
<version>${version.jakarta.jsonp}</version>
</dependency>
<dependency>
<groupId>jakarta.json.bind</groupId>
<artifactId>jakarta.json.bind-api</artifactId>
<version>${version.jakarta.jsonb}</version>
</dependency>
<!-- Weld -->
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet-core</artifactId>
<version>${version.weld}</version>
</dependency>
<!-- RESTEasy -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-bom</artifactId>
<version>${version.resteasy}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- Internal -->
<dependency>
<groupId>io.smallrye.testing</groupId>
<artifactId>smallrye-testing-tck-jetty</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<module>utilities</module>
<module>bom/test</module>
<module>bom/tck</module>
<module>tck/jetty</module>
</modules>

<dependencyManagement>
Expand Down
113 changes: 113 additions & 0 deletions tck/jetty/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.smallrye.testing</groupId>
<artifactId>smallrye-testing-parent</artifactId>
<version>1.1.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>smallrye-testing-tck-jetty</artifactId>
<name>SmallRye Testing: TCK Jetty</name>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.smallrye.testing</groupId>
<artifactId>smallrye-testing-bom-tck</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- Arquillian -->
<dependency>
<groupId>org.jboss.arquillian.core</groupId>
<artifactId>arquillian-core-spi</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-test-spi</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api-maven</artifactId>
</dependency>

<!-- Jetty -->
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-jetty-embedded-9</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-deploy</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-annotations</artifactId>
</dependency>

<!-- MicroProfile -->
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.json.bind</groupId>
<artifactId>jakarta.json.bind-api</artifactId>
</dependency>

<!-- Implementations -->
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet-core</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-servlet-initializer</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-cdi</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-json-binding-provider</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.smallrye.testing.tck;

import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
import org.jboss.arquillian.core.spi.LoadableExtension;

public class ArquillianExtension implements LoadableExtension {
@Override
public void register(ExtensionBuilder extensionBuilder) {
extensionBuilder.service(ApplicationArchiveProcessor.class, DeploymentProcessor.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package io.smallrye.testing.tck;

import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
import org.jboss.arquillian.test.spi.TestClass;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ArchivePaths;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;

public class DeploymentProcessor implements ApplicationArchiveProcessor {
@Override
public void process(Archive<?> archive, TestClass testClass) {
if (archive instanceof WebArchive) {
WebArchive war = (WebArchive) archive;
war.addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
war.addAsLibraries(
ShrinkWrap.create(JavaArchive.class, "resteasy-cdi.jar").addAsManifestResource("web-fragment.xml"));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.smallrye.testing.tck.ArquillianExtension
14 changes: 14 additions & 0 deletions tck/jetty/src/main/resources/web-fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-fragment xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd"
version="3.0">

<name>resteasy_cdi</name>
<context-param>
<param-name>resteasy.injector.factory</param-name>
<param-value>org.jboss.resteasy.cdi.CdiInjectorFactory</param-value>
</context-param>
</web-fragment>

0 comments on commit 6031b80

Please sign in to comment.