forked from cloudevents/sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Integration test for Microprofile/Liberty for Jee9 package
Tidy-up pom files and filepaths Signed-off-by: alex-butcher <[email protected]>
- Loading branch information
Showing
19 changed files
with
405 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...a/com/github/hanleyt/JerseyExtension.java → ...a/com/github/hanleyt/JerseyExtension.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
164 changes: 164 additions & 0 deletions
164
http/restful-ws-jakarta-integration-tests/restful-ws-liberty/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
<?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"> | ||
<parent> | ||
<artifactId>cloudevents-http-restful-ws-jakarta-integration-tests</artifactId> | ||
<groupId>io.cloudevents</groupId> | ||
<version>2.4.0-SNAPSHOT</version> | ||
<relativePath>../</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>cloudevents-http-restful-ws-jakarta-integration-tests-microprofile</artifactId> | ||
<name>CloudEvents - JAX-RS Jakarta EE9+ Integration Tests - Microprofile and Liberty</name> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<!-- Liberty configuration --> | ||
<liberty.var.default.http.port>9080</liberty.var.default.http.port> | ||
<liberty.var.default.https.port>9443</liberty.var.default.https.port> | ||
<!-- arquillian configuration --> | ||
<arquillian.war.name>microprofile-test</arquillian.war.name> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jboss.arquillian</groupId> | ||
<artifactId>arquillian-bom</artifactId> | ||
<version>1.6.0.Final</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<!-- Provided dependencies --> | ||
<dependency> | ||
<groupId>jakarta.platform</groupId> | ||
<artifactId>jakarta.jakartaee-api</artifactId> | ||
<version>9.1.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.microprofile</groupId> | ||
<artifactId>microprofile</artifactId> | ||
<version>5.0</version> | ||
<type>pom</type> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.cloudevents</groupId> | ||
<artifactId>cloudevents-http-restful-ws-jakarta</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.cloudevents</groupId> | ||
<artifactId>cloudevents-core</artifactId> | ||
<classifier>tests</classifier> | ||
<type>test-jar</type> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.resteasy</groupId> | ||
<artifactId>resteasy-client</artifactId> | ||
<version>6.0.0.Final</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.resteasy</groupId> | ||
<artifactId>resteasy-json-binding-provider</artifactId> | ||
<version>6.0.0.Final</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.glassfish</groupId> | ||
<artifactId>jakarta.json</artifactId> | ||
<version>2.0.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<!-- For JDK 9 & above Support --> | ||
<dependency> | ||
<groupId>javax.xml.bind</groupId> | ||
<artifactId>jaxb-api</artifactId> | ||
<version>2.3.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.activation</groupId> | ||
<artifactId>activation</artifactId> | ||
<version>1.1.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.openliberty.arquillian</groupId> | ||
<artifactId>arquillian-liberty-managed-jakarta-junit</artifactId> | ||
<version>2.0.2</version> | ||
<type>pom</type> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.shrinkwrap</groupId> | ||
<artifactId>shrinkwrap-api</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<finalName>${project.artifactId}</finalName> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>3.3.2</version> | ||
<configuration> | ||
<packagingExcludes>pom.xml</packagingExcludes> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<version>2.22.2</version> | ||
<configuration> | ||
<systemPropertyVariables> | ||
<arquillian.war.name>${arquillian.war.name}.war</arquillian.war.name> | ||
</systemPropertyVariables> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>test</phase> | ||
<goals> | ||
<goal>integration-test</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>io.openliberty.tools</groupId> | ||
<artifactId>liberty-maven-plugin</artifactId> | ||
<version>3.5.1</version> | ||
<configuration> | ||
<arquillianProperties> | ||
<javaVmArguments> | ||
-Dsystem.context.root=/${arquillian.war.name} | ||
</javaVmArguments> | ||
</arquillianProperties> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>arquillian-configuration</id> | ||
<phase>generate-test-resources</phase> | ||
<goals> | ||
<goal>create</goal> | ||
<goal>install-feature</goal> | ||
<goal>configure-arquillian</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
9 changes: 9 additions & 0 deletions
9
...ration-tests/restful-ws-liberty/src/main/java/io/cloudevents/restful/mp/test/MpCEApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package io.cloudevents.restful.mp.test; | ||
|
||
import jakarta.ws.rs.ApplicationPath; | ||
import jakarta.ws.rs.core.Application; | ||
|
||
@ApplicationPath("/") | ||
public class MpCEApp extends Application { | ||
|
||
} |
60 changes: 60 additions & 0 deletions
60
...n-tests/restful-ws-liberty/src/main/java/io/cloudevents/restful/mp/test/TestResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package io.cloudevents.restful.mp.test; | ||
|
||
import io.cloudevents.CloudEvent; | ||
import io.cloudevents.core.mock.CSVFormat; | ||
import io.cloudevents.core.provider.EventFormatProvider; | ||
import io.cloudevents.core.test.Data; | ||
import io.cloudevents.http.restful.ws.StructuredEncoding; | ||
import jakarta.annotation.PostConstruct; | ||
import jakarta.enterprise.context.RequestScoped; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
@RequestScoped | ||
@Path("/") | ||
public class TestResource{ | ||
|
||
@PostConstruct | ||
void init() { | ||
EventFormatProvider.getInstance().registerFormat(CSVFormat.INSTANCE); | ||
} | ||
|
||
@GET | ||
@Path("getMinEvent") | ||
public CloudEvent getMinEvent() { | ||
return Data.V1_MIN; | ||
} | ||
|
||
@GET | ||
@Path("getStructuredEvent") | ||
@StructuredEncoding("application/cloudevents+csv") | ||
public CloudEvent getStructuredEvent() { | ||
return Data.V1_MIN; | ||
} | ||
|
||
@GET | ||
@Path("getEvent") | ||
public CloudEvent getEvent() { | ||
return Data.V1_WITH_JSON_DATA_WITH_EXT_STRING; | ||
} | ||
|
||
@POST | ||
@Path("postEventWithoutBody") | ||
public Response postEventWithoutBody(CloudEvent inputEvent) { | ||
if (inputEvent.equals(Data.V1_MIN)) { | ||
return Response.ok().build(); | ||
} | ||
return Response.serverError().build(); | ||
} | ||
|
||
@POST | ||
@Path("postEvent") | ||
public Response postEvent(CloudEvent inputEvent) { | ||
if (inputEvent.equals(Data.V1_WITH_JSON_DATA_WITH_EXT_STRING)) { | ||
return Response.ok().build(); | ||
} | ||
return Response.serverError().build(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...estful-ws-jakarta-integration-tests/restful-ws-liberty/src/main/liberty/config/server.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<server description="new server"> | ||
|
||
<featureManager> | ||
<feature>microProfile-5.0</feature> | ||
<!--Used solely for testing--> | ||
<feature>localConnector-1.0</feature> | ||
<feature>servlet-5.0</feature> | ||
</featureManager> | ||
|
||
<variable name="default.http.port" defaultValue="9080" /> | ||
<variable name="default.https.port" defaultValue="9443" /> | ||
|
||
<httpEndpoint id="defaultHttpEndpoint" httpPort="${default.http.port}" | ||
httpsPort="${default.https.port}" /> | ||
<webApplication location="${project.name}.war"> | ||
<classloader apiTypeVisibility="+third-party" /> | ||
</webApplication> | ||
</server> |
Oops, something went wrong.