Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to MP6 and JEE10 #83

Merged
merged 4 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ jobs:
working-directory: finish
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 8
java-version: 11
- run: unset _JAVA_OPTIONS
- name: Run tests
run: ../scripts/testApp.sh
Expand Down
398 changes: 398 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021, 2022 IBM Corporation and others.
// Copyright (c) 2021, 2023 IBM Corporation and others.
// Licensed under Creative Commons Attribution-NoDerivatives
// 4.0 International (CC BY-ND 4.0)
// https://creativecommons.org/licenses/by-nd/4.0/
Expand Down Expand Up @@ -279,12 +279,12 @@ Dockerfiles have already been set up for you. Build your Docker images with the

[role='command']
----
docker build -t system:1.0-java8-SNAPSHOT --build-arg JAVA_VERSION=java8 system/.
docker build -t system:1.0-java11-SNAPSHOT --build-arg JAVA_VERSION=java11 system/.
docker build -t system:1.0-java17-SNAPSHOT --build-arg JAVA_VERSION=java17 system/.
docker build -t graphql:1.0-SNAPSHOT graphql/.
----

The `--build-arg` parameter is used to create two different `system` services. One uses Java 8, while the other uses Java 11. Run these Docker images using the provided `startContainers` script. The script creates a network for the services to communicate through. It creates two `system` services and a GraphQL service.
The `--build-arg` parameter is used to create two different `system` services. One uses Java 11, while the other uses Java 17. Run these Docker images using the provided `startContainers` script. The script creates a network for the services to communicate through. It creates two `system` services and a GraphQL service.

include::{common-includes}/os-tabs.adoc[]

Expand Down Expand Up @@ -334,13 +334,13 @@ endif::[]

Queries that are made through GraphiQL are the same as queries that are made through HTTP requests. You can also view the schema through GraphiQL by clicking the `Docs` button on the menu bar.

Run the following `query` operation in GraphiQL to get every system property from the container running on Java 8:
Run the following `query` operation in GraphiQL to get every system property from the container running on Java 11:

ifndef::cloud-hosted[]
[role='command']
```
query {
system(hostname: "system-java8") {
system(hostname: "system-java11") {
hostname
username
osArch
Expand All @@ -363,7 +363,7 @@ endif::[]
ifdef::cloud-hosted[]
```
query {
system(hostname: "system-java8") {
system(hostname: "system-java11") {
hostname
username
osArch
Expand Down Expand Up @@ -392,7 +392,7 @@ The output is similar to the following example:
{
"data": {
"system": {
"hostname": "system-java8",
"hostname": "system-java11",
"username": "default",
"osArch": "amd64",
"osName": "Linux",
Expand All @@ -404,21 +404,21 @@ The output is similar to the following example:
},
"java": {
"vendorName": "AdoptOpenJDK",
"version": "1.8.0_292"
"version": "11.0.18"
}
}
}
}
----

Run the following `mutation` operation to add a note to the `system` service running on Java 8:
Run the following `mutation` operation to add a note to the `system` service running on Java 11:

ifndef::cloud-hosted[]
[role='command']
```
mutation {
editNote(
hostname: "system-java8"
hostname: "system-java11"
note: "I'm trying out GraphQL on Open Liberty!"
)
}
Expand All @@ -429,7 +429,7 @@ ifdef::cloud-hosted[]
```
mutation {
editNote(
hostname: "system-java8"
hostname: "system-java11"
note: "I'm trying out GraphQL on Open Liberty!"
)
}
Expand All @@ -442,7 +442,7 @@ ifndef::cloud-hosted[]
[role='command']
```
query {
system(hostname: "system-java8") {
system(hostname: "system-java11") {
note
}
}
Expand All @@ -452,7 +452,7 @@ endif::[]
ifdef::cloud-hosted[]
```bash
query {
system(hostname: "system-java8") {
system(hostname: "system-java11") {
note
}
}
Expand All @@ -472,13 +472,13 @@ The response is similar to the following example:
}
----

GraphQL returns only the `note` property, as it was the only property in the request. You can try out the operations using the hostname `system-java11` as well. To see an example of using an array as an input for an operation, try the following operation to get system loads:
GraphQL returns only the `note` property, as it was the only property in the request. You can try out the operations using the hostname `system-java17` as well. To see an example of using an array as an input for an operation, try the following operation to get system loads:

ifndef::cloud-hosted[]
[role='command']
```
query {
systemLoad(hostnames: ["system-java8", "system-java11"]) {
systemLoad(hostnames: ["system-java11", "system-java17"]) {
hostname
loadData {
heapUsed
Expand All @@ -493,7 +493,7 @@ endif::[]
ifdef::cloud-hosted[]
```
query {
systemLoad(hostnames: ["system-java8", "system-java11"]) {
systemLoad(hostnames: ["system-java11", "system-java17"]) {
hostname
loadData {
heapUsed
Expand All @@ -513,15 +513,15 @@ The response is similar to the following example:
"data": {
"systemLoad": [
{
"hostname": "system-java8",
"hostname": "system-java11",
"loadData": {
"heapUsed": 32432048,
"nonHeapUsed": 85147084,
"loadAverage": 0.36
}
},
{
"hostname": "system-java11",
"hostname": "system-java17",
"loadData": {
"heapUsed": 39373688,
"nonHeapUsed": 90736300,
Expand Down
18 changes: 9 additions & 9 deletions finish/graphql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<packaging>war</packaging>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Liberty configuration -->
Expand All @@ -24,13 +24,13 @@
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>9.1.0</version>
<version>10.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>5.0</version>
<version>6.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand All @@ -57,19 +57,19 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.1</version>
<version>5.9.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>6.0.0.Final</version>
<version>6.2.3.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-json-binding-provider</artifactId>
<version>6.0.0.Final</version>
<version>6.2.3.Final</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -100,13 +100,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>3.0.0</version>
</plugin>
<!-- Plugin to run functional tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
<version>3.0.0</version>
<configuration>
<systemPropertyVariables>
<http.port>${liberty.var.default.http.port}</http.port>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
/*******************************************************************************
* Copyright (c) 2021, 2022 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* http://www.eclipse.org/legal/epl-2.0/
*
* Contributors:
* IBM Corporation - Initial implementation
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
// end::copyright[]
package io.openliberty.guides.graphql;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
/*******************************************************************************
* Copyright (c) 2021, 2022 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* http://www.eclipse.org/legal/epl-2.0/
*
* Contributors:
* IBM Corporation - Initial implementation
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
// end::copyright[]
package io.openliberty.guides.graphql.client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
/*******************************************************************************
* Copyright (c) 2021 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* http://www.eclipse.org/legal/epl-2.0/
*
* Contributors:
* IBM Corporation - Initial implementation
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
// end::copyright[]
package io.openliberty.guides.graphql.client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
/*******************************************************************************
* Copyright (c) 2021, 2022 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* http://www.eclipse.org/legal/epl-2.0/
*
* Contributors:
* IBM Corporation - Initial implementation
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
// end::copyright[]
package io.openliberty.guides.graphql.client;
Expand Down
8 changes: 4 additions & 4 deletions finish/graphql/src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<server description="GraphQL service">
<featureManager>
<feature>restfulWS-3.0</feature>
<feature>jsonb-2.0</feature>
<feature>jsonp-2.0</feature>
<feature>cdi-3.0</feature>
<feature>restfulWS-3.1</feature>
<feature>jsonb-3.0</feature>
<feature>jsonp-2.1</feature>
<feature>cdi-4.0</feature>
<feature>mpConfig-3.0</feature>
<feature>mpRestClient-3.0</feature>
<!-- tag::graphql[] -->
Expand Down
10 changes: 5 additions & 5 deletions finish/graphql/src/main/webapp/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2021, 2022 IBM Corp.
Copyright (c) 2021, 2023 IBM Corp.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,13 +41,13 @@ <h2>Eclipse MicroProfile</h2>
<p>
For more information about the features used in this application, see the Open Liberty documentation:
<ul>
<li><a href="https://openliberty.io/docs/ref/feature/#microProfile-5.0.html" target="_blank" rel="noopener noreferrer">MicroProfile 5.0</a></li>
<li><a href="https://openliberty.io/docs/ref/feature/#microProfile-6.0.html" target="_blank" rel="noopener noreferrer">MicroProfile 6.0</a></li>
<li><a href="https://openliberty.io/docs/ref/feature/mpGraphQL-1.0.html" target="_blank" rel="noopener noreferrer">MicroProfile GraphQL 1.0</a></li>
<li><a href="https://openliberty.io/docs/ref/feature/#mpConfig-3.0.html" target="_blank" rel="noopener noreferrer">MicroProfile Config 3.0</a></li>
<li><a href="https://openliberty.io/docs/ref/feature/#mpRestClient-3.0.html" target="_blank" rel="noopener noreferrer">MicroProfile Rest Client 3.0</a></li>
<li><a href="https://openliberty.io/docs/ref/feature/#cdi-4.0.html" target="_blank" rel="noopener noreferrer">Contexts and Dependency Injection 4.0</a></li>
<li><a href="https://openliberty.io/docs/ref/feature/#restfulWS-3.0.html" target="_blank" rel="noopener noreferrer">Java RESTful Services 3.0</a></li>
<li><a href="https://openliberty.io/docs/ref/feature/#jsonb-3.0.html" target="_blank" rel="noopener noreferrer">JavaScript Object Notation Binding 3.0</a></li>
<li><a href="https://openliberty.io/docs/ref/feature/#cdi-4.0.html" target="_blank" rel="noopener noreferrer">Jakarta Contexts and Dependency Injection 4.0</a></li>
<li><a href="https://openliberty.io/docs/ref/feature/#restfulWS-3.1.html" target="_blank" rel="noopener noreferrer">Jakarta RESTful Web Services 3.1</a></li>
<li><a href="https://openliberty.io/docs/ref/feature/#jsonb-3.0.html" target="_blank" rel="noopener noreferrer">Jakarta JSON Binding 3.0</a></li>
</ul>
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
/*******************************************************************************
* Copyright (c) 2021, 2022 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* http://www.eclipse.org/legal/epl-2.0/
*
* Contributors:
* IBM Corporation - Initial implementation
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
// end::copyright[]
package it.io.openliberty.guides.graphql;
Expand Down
8 changes: 4 additions & 4 deletions finish/models/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>9.1.0</version>
<version>10.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -23,7 +23,7 @@
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>5.0</version>
<version>6.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand All @@ -36,8 +36,8 @@
</dependencies>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
/*******************************************************************************
* Copyright (c) 2021 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* http://www.eclipse.org/legal/epl-2.0/
*
* Contributors:
* IBM Corporation - Initial implementation
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
// end::copyright[]
package io.openliberty.guides.graphql.models;
Expand Down
Loading