Skip to content

Commit

Permalink
Upgrade RESTEasy and Spring to 6 (#80)
Browse files Browse the repository at this point in the history
* upgrade RESTEasy and Spring

* adjust CI java to 17

* fix namespace + fix spring tests

* fix examples-jsapi

* resume jaxrs2-async-pubsub-example

* resume jaxb-json

* resume async-job-service

* resume and fix smime example, upgrade python code and add Pipenv file

* tracing-example

* fix wadl-example

* enable digital-signatures

* enable bootable jar

* hibernate 6 not supported by spring yet

* enable resteasy-wadl-wildfly

* enable tests in CI

* fix async bug in pubsub example
  • Loading branch information
liweinan authored Apr 2, 2022
1 parent f83528d commit 23083ac
Show file tree
Hide file tree
Showing 195 changed files with 1,492 additions and 1,442 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 17
- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn -B -fae install --file pom.xml
26 changes: 20 additions & 6 deletions async-job-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,28 @@ Async Job Service

This project is a simple example showing how to use the Asynchronous Job Service.

System Requirements:
--------------------
* Maven 2.0.9 or higher

Building the project:
------------------------
1. In root directoy

mvn clean install
2. Run the following command to run the test for demo:

```bash
$ mvn test
```

And you will see some output like following:

```bash
Running org.jboss.resteasy.examples.asyncjob.AsyncJobTest
jobUrl1: http://localhost:9095/asyncjobs/1648047408072--317359366
IN PUT!!!!
******* countdown complete ****
```

3. To start the demo service, run the following command:

```bash
$ mvn jetty:run
```

This will build a WAR and run it with embedded Jetty
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.jboss.resteasy.examples.asyncjob;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.PUT;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;

/**
* @author <a href="mailto:[email protected]">Bill Burke</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.jboss.resteasy.examples.asyncjob;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.ClientBuilder;
import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.HttpHeaders;
import jakarta.ws.rs.core.Response;

import org.junit.Assert;
import org.junit.Test;
Expand Down
8 changes: 5 additions & 3 deletions bootable-jar/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
RestEasy bootable jar example
=================
RESTEasy Bootable JAR Example
=============================

Example to demonstrate start products service with WildFly bootable jar

Build and run
Build And Run
=============

* To build: `mvn clean install`
* To run: `mvn wildfly-jar:run` or `java -jar target/products-runner-bootable.jar`
* Access the json product result with: `http://127.0.0.1:8080/products`
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package org.jboss.resteasy.bootablejar;
import javax.ws.rs.Path;
import javax.ws.rs.GET;
import javax.ws.rs.Produces;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Produces;

@Path("/products")
public class Jackson2Resource {
@GET
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.jboss.resteasy.bootablejar;

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;

@ApplicationPath("/")
public class ProductApplication extends Application {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.jboss.resteasy.bootablejar;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;
import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.ClientBuilder;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.Response;
import org.junit.Assert;
import org.junit.Test;

Expand Down
6 changes: 5 additions & 1 deletion digital-signatures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ One project uses DNS to obtain the public key to verify signatures, one doesn't.

System Requirements:
--------------------

* Maven 2.0.9 or higher

Building the project:
------------------------

1. In root directoy

mvn clean install
```bash
$ mvn clean install
```

This will build a WAR and run it with embedded Jetty
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import org.jboss.resteasy.annotations.security.doseta.Verify;
import org.jboss.resteasy.security.doseta.DKIMSignature;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.HeaderParam;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.Response;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
import org.junit.BeforeClass;
import org.junit.Test;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.ProcessingException;
import javax.ws.rs.Produces;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.ProcessingException;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.ClientBuilder;
import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.Response;
import java.security.KeyPair;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import org.jboss.resteasy.annotations.security.doseta.Verify;
import org.jboss.resteasy.security.doseta.DKIMSignature;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.HeaderParam;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;

/**
* @author <a href="mailto:[email protected]">Bill Burke</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
import org.junit.Test;
import se.unlogic.eagledns.EagleDNS;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;
import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.ClientBuilder;
import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.Response;
import java.security.KeyPair;

/**
Expand Down
7 changes: 6 additions & 1 deletion examples-jsapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@ Example of using RestEasy with JS-API:

System Requirements:
-------------------------
*
* Maven 2.0.9 or higher

Building the project:
-------------------------

```bash
mvn clean install
```

Running the project and manually testing it:
-------------------------

```bash
mvn jetty:run
```

Open a browser at the following URL:

http://127.0.0.1:8080/examples-jsapi/
> [http://127.0.0.1:8080](http://127.0.0.1:8080)

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.jboss.resteasy.examples;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;

@Path("orders")
public class Orders {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.jboss.resteasy.examples;

import javax.ws.rs.core.Application;
import jakarta.ws.rs.core.Application;
import java.util.HashSet;
import java.util.Set;

Expand Down
2 changes: 1 addition & 1 deletion examples-jsapi/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<display-name>Archetype Created Web Application</display-name>

<context-param>
<param-name>javax.ws.rs.core.Application</param-name>
<param-name>jakarta.ws.rs.core.Application</param-name>
<param-value>org.jboss.resteasy.examples.OrdersApplication</param-value>
</context-param>

Expand Down
2 changes: 1 addition & 1 deletion examples-jsapi/src/main/webapp/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<input type='button' onclick='callJsApi();' value='Get Orders'/>
</form>

<script src="/examples-jsapi/rest-js" type="text/javascript"></script>
<script src="/rest-js" type="text/javascript"></script>
<script type="text/javascript">
var global_order_id = 0;
function callJsApi() {
Expand Down
28 changes: 13 additions & 15 deletions jaxb-json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Jettison Example
Example of using RestEasy with:
- Using JSON with Resteasy
- The JAXB/JSON Provider
- Using javax.ws.rs.core.Application
- Using jakarta.ws.rs.core.Application
- Using the <context-param> resteasy.servlet.mapping.prefix
- Jetty (embedded)

Expand All @@ -14,30 +14,28 @@ System Requirements:
Building the project:
====================

```bash
mvn clean install
```

Running the project and manually testing it:
-------------------------

```bash
mvn jetty:run
```

Open a browser at the following URL:
The data is JAXB annotated classes marshalled to JSON. Use the following `curl` command to access the json data:

HTML form that pulls JSON from a JAX-RS service. The data is JAXB annotated classes marshalled to JSON
using the Jettison mapped format:
```bash
$ curl http://localhost:9095/resteasy/library/books/mapped
```

http://localhost:9095/mapped.html
The data is JAXB annotated classes marshalled to JSON using the Jettison Badger format:

HTML form that pulls JSON from a JAX-RS service. The data is JAXB annotated classes marshalled to JSON
using the Jettison Badger format:
```bash
$ curl http://localhost:9095/resteasy/library/books/badger
```

http://localhost:9095/badger.html

To view the Mapped JSON format:

http://localhost:9095/resteasy/library/books/mapped.html

To view the Badger JSON format:

http://localhost:9095/resteasy/library/books/badger.html

Loading

0 comments on commit 23083ac

Please sign in to comment.