Skip to content

Commit 77aae58

Browse files
authored
Merge pull request #268 from OpenLiberty/staging
Merge staging to prod - Version update mp5 (#264)
2 parents 656d05c + 68f34c0 commit 77aae58

17 files changed

Lines changed: 170 additions & 254 deletions

File tree

README.adoc

Lines changed: 44 additions & 135 deletions
Large diffs are not rendered by default.

finish/pom.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,39 +24,39 @@
2424
<dependency>
2525
<groupId>jakarta.platform</groupId>
2626
<artifactId>jakarta.jakartaee-api</artifactId>
27-
<version>8.0.0</version>
27+
<version>9.1.0</version>
2828
<scope>provided</scope>
2929
</dependency>
3030
<dependency>
3131
<groupId>org.eclipse.microprofile</groupId>
3232
<artifactId>microprofile</artifactId>
33-
<version>4.1</version>
33+
<version>5.0</version>
3434
<type>pom</type>
3535
<scope>provided</scope>
3636
</dependency>
3737
<!-- For tests -->
3838
<dependency>
3939
<groupId>org.junit.jupiter</groupId>
4040
<artifactId>junit-jupiter</artifactId>
41-
<version>5.8.1</version>
41+
<version>5.8.2</version>
4242
<scope>test</scope>
4343
</dependency>
4444
<dependency>
45-
<groupId>org.apache.cxf</groupId>
46-
<artifactId>cxf-rt-rs-client</artifactId>
47-
<version>3.4.5</version>
45+
<groupId>org.jboss.resteasy</groupId>
46+
<artifactId>resteasy-client</artifactId>
47+
<version>6.0.0.Final</version>
4848
<scope>test</scope>
4949
</dependency>
5050
<dependency>
51-
<groupId>org.apache.cxf</groupId>
52-
<artifactId>cxf-rt-rs-extension-providers</artifactId>
53-
<version>3.4.5</version>
51+
<groupId>org.jboss.resteasy</groupId>
52+
<artifactId>resteasy-json-binding-provider</artifactId>
53+
<version>6.0.0.Final</version>
5454
<scope>test</scope>
5555
</dependency>
5656
<dependency>
5757
<groupId>org.glassfish</groupId>
58-
<artifactId>javax.json</artifactId>
59-
<version>1.1.4</version>
58+
<artifactId>jakarta.json</artifactId>
59+
<version>2.0.1</version>
6060
<scope>test</scope>
6161
</dependency>
6262
</dependencies>

finish/src/main/java/io/openliberty/sample/system/SystemApplication.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// tag::copyright[]
22
/*******************************************************************************
3-
* Copyright (c) 2017 IBM Corporation and others.
3+
* Copyright (c) 2017, 2022 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v1.0
66
* which accompanies this distribution, and is available at
@@ -12,8 +12,8 @@
1212
// end::copyright[]
1313
package io.openliberty.sample.system;
1414

15-
import javax.ws.rs.ApplicationPath;
16-
import javax.ws.rs.core.Application;
15+
import jakarta.ws.rs.ApplicationPath;
16+
import jakarta.ws.rs.core.Application;
1717

1818
@ApplicationPath("/system")
1919
public class SystemApplication extends Application {

finish/src/main/java/io/openliberty/sample/system/SystemLivenessCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// end::copyright[]
1313
package io.openliberty.sample.system;
1414

15-
import javax.enterprise.context.ApplicationScoped;
15+
import jakarta.enterprise.context.ApplicationScoped;
1616

1717
import java.lang.management.MemoryMXBean;
1818
import java.lang.management.ManagementFactory;

finish/src/main/java/io/openliberty/sample/system/SystemReadinessCheck.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// tag::copyright[]
22
/*******************************************************************************
3-
* Copyright (c) 2018, 2021 IBM Corporation and others.
3+
* Copyright (c) 2018, 2022 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v1.0
66
* which accompanies this distribution, and is available at
@@ -12,10 +12,10 @@
1212
// end::copyright[]
1313
package io.openliberty.sample.system;
1414

15-
import javax.enterprise.context.ApplicationScoped;
15+
import jakarta.enterprise.context.ApplicationScoped;
1616

17-
import javax.inject.Inject;
18-
import javax.inject.Provider;
17+
import jakarta.inject.Inject;
18+
import jakarta.inject.Provider;
1919

2020
import org.eclipse.microprofile.config.inject.ConfigProperty;
2121
import org.eclipse.microprofile.health.Readiness;
Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// tag::copyright[]
22
/*******************************************************************************
3-
* Copyright (c) 2017, 2019 IBM Corporation and others.
3+
* Copyright (c) 2017, 2022 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v1.0
66
* which accompanies this distribution, and is available at
@@ -12,13 +12,13 @@
1212
// end::copyright[]
1313
package io.openliberty.sample.system;
1414

15-
import javax.ws.rs.core.Response;
15+
import jakarta.ws.rs.core.Response;
1616

17-
import javax.enterprise.context.RequestScoped;
18-
import javax.ws.rs.GET;
19-
import javax.ws.rs.Path;
20-
import javax.ws.rs.Produces;
21-
import javax.ws.rs.core.MediaType;
17+
import jakarta.enterprise.context.RequestScoped;
18+
import jakarta.ws.rs.GET;
19+
import jakarta.ws.rs.Path;
20+
import jakarta.ws.rs.Produces;
21+
import jakarta.ws.rs.core.MediaType;
2222

2323
import org.eclipse.microprofile.metrics.annotation.Counted;
2424
import org.eclipse.microprofile.metrics.annotation.Timed;
@@ -27,12 +27,14 @@
2727
@Path("/properties")
2828
public class SystemResource {
2929

30-
@GET
31-
@Produces(MediaType.APPLICATION_JSON)
32-
@Timed(name = "getPropertiesTime", description = "Time needed to get the JVM system properties")
33-
@Counted(absolute = true, description = "Number of times the JVM system properties are requested")
34-
public Response getProperties() {
35-
return Response.ok(System.getProperties()).build();
36-
}
30+
@GET
31+
@Produces(MediaType.APPLICATION_JSON)
32+
@Timed(name = "getPropertiesTime",
33+
description = "Time needed to get the JVM system properties")
34+
@Counted(absolute = true, description
35+
= "Number of times the JVM system properties are requested")
36+
public Response getProperties() {
37+
return Response.ok(System.getProperties()).build();
38+
}
3739

3840
}

finish/src/main/liberty/config/server.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<server description="Sample Liberty server">
22
<!-- tag::features[] -->
33
<featureManager>
4-
<feature>jaxrs-2.1</feature>
5-
<feature>jsonp-1.1</feature>
6-
<feature>cdi-2.0</feature>
7-
<feature>mpMetrics-3.0</feature>
4+
<feature>restfulWS-3.0</feature>
5+
<feature>jsonp-2.0</feature>
6+
<feature>jsonb-2.0</feature>
7+
<feature>cdi-3.0</feature>
8+
<feature>mpMetrics-4.0</feature>
89
<!-- tag::mpHealth[] -->
9-
<feature>mpHealth-3.1</feature>
10+
<feature>mpHealth-4.0</feature>
1011
<!-- end::mpHealth[] -->
11-
<feature>mpConfig-2.0</feature>
12+
<feature>mpConfig-3.0</feature>
1213
</featureManager>
1314
<!-- end::features[] -->
1415

finish/src/main/webapp/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
Copyright (c) 2016, 2021 IBM Corp.
2+
Copyright (c) 2016, 2022 IBM Corp.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -125,6 +125,6 @@ <h4>Set course for the Open Liberty guides!</h4>
125125
<a href="https://openliberty.io/">openliberty.io</a>
126126
</div>
127127
<p id="footerText">an IBM open source project</p>
128-
<p id="footerCopyright">&copy;Copyright IBM Corp. 2018, 2021</p>
128+
<p id="footerCopyright">&copy;Copyright IBM Corp. 2018, 2022</p>
129129
</footer>
130130
</html>

finish/src/test/java/it/io/openliberty/sample/HealthEndpointIT.java

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// tag::copyright[]
22
/*******************************************************************************
3-
* Copyright (c) 2018, 2019 IBM Corporation and others.
3+
* Copyright (c) 2018, 2022 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v1.0
66
* which accompanies this distribution, and is available at
@@ -14,40 +14,38 @@
1414

1515
import static org.junit.jupiter.api.Assertions.assertEquals;
1616

17-
import javax.json.JsonObject;
18-
import javax.ws.rs.client.Client;
19-
import javax.ws.rs.client.ClientBuilder;
20-
import javax.ws.rs.core.Response;
17+
import jakarta.json.JsonObject;
18+
import jakarta.ws.rs.client.Client;
19+
import jakarta.ws.rs.client.ClientBuilder;
20+
import jakarta.ws.rs.core.Response;
2121

22-
import org.apache.cxf.jaxrs.provider.jsrjsonp.JsrJsonpProvider;
2322
import org.junit.jupiter.api.AfterEach;
2423
import org.junit.jupiter.api.BeforeEach;
2524
import org.junit.jupiter.api.BeforeAll;
2625
import org.junit.jupiter.api.Test;
2726

2827
public class HealthEndpointIT {
29-
28+
3029
private static String baseUrl;
3130
private static final String HEALTH_ENDPOINT = "/health";
3231
private static final String LIVENESS_ENDPOINT = "/health/live";
3332
private static final String READINESS_ENDPOINT = "/health/ready";
34-
33+
3534
private Client client;
3635
private Response response;
37-
36+
3837
@BeforeAll
3938
public static void oneTimeSetup() {
4039
String port = System.getProperty("http.port");
4140
baseUrl = "http://localhost:" + port;
4241
}
43-
42+
4443
@BeforeEach
4544
public void setup() {
4645
response = null;
4746
client = ClientBuilder.newClient();
48-
client.register(JsrJsonpProvider.class);
4947
}
50-
48+
5149
@AfterEach
5250
public void teardown() {
5351
response.close();
@@ -59,47 +57,51 @@ public void testHealthEndpoint() {
5957
String healthURL = baseUrl + HEALTH_ENDPOINT;
6058
response = this.getResponse(baseUrl + HEALTH_ENDPOINT);
6159
this.assertResponse(healthURL, response);
62-
60+
6361
JsonObject healthJson = response.readEntity(JsonObject.class);
6462
String expectedOutcome = "UP";
6563
String actualOutcome = healthJson.getString("status");
6664
assertEquals(expectedOutcome, actualOutcome, "Application should be healthy");
67-
65+
6866
JsonObject healthCheck = healthJson.getJsonArray("checks").getJsonObject(0);
6967
String healthCheckName = healthCheck.getString("name");
7068
actualOutcome = healthCheck.getString("status");
71-
assertEquals(expectedOutcome, actualOutcome, healthCheckName + " wasn't healthy");
69+
assertEquals(expectedOutcome, actualOutcome,
70+
healthCheckName + " wasn't healthy");
7271

7372
healthCheck = healthJson.getJsonArray("checks").getJsonObject(1);
7473
healthCheckName = healthCheck.getString("name");
7574
actualOutcome = healthCheck.getString("status");
76-
assertEquals(expectedOutcome, actualOutcome, healthCheckName + " wasn't healthy");
75+
assertEquals(expectedOutcome, actualOutcome,
76+
healthCheckName + " wasn't healthy");
7777
}
7878

7979
@Test
8080
public void testLivenessEndpoint() {
8181
String livenessURL = baseUrl + LIVENESS_ENDPOINT;
8282
response = this.getResponse(baseUrl + LIVENESS_ENDPOINT);
8383
this.assertResponse(livenessURL, response);
84-
84+
8585
JsonObject healthJson = response.readEntity(JsonObject.class);
8686
String expectedOutcome = "UP";
8787
String actualOutcome = healthJson.getString("status");
88-
assertEquals(expectedOutcome, actualOutcome, "Applications liveness check passed");
88+
assertEquals(expectedOutcome, actualOutcome,
89+
"Applications liveness check passed");
8990
}
9091

9192
@Test
9293
public void testReadinessEndpoint() {
9394
String readinessURL = baseUrl + READINESS_ENDPOINT;
9495
response = this.getResponse(baseUrl + READINESS_ENDPOINT);
9596
this.assertResponse(readinessURL, response);
96-
97+
9798
JsonObject healthJson = response.readEntity(JsonObject.class);
9899
String expectedOutcome = "UP";
99100
String actualOutcome = healthJson.getString("status");
100-
assertEquals(expectedOutcome, actualOutcome, "Applications readiness check passed");
101+
assertEquals(expectedOutcome, actualOutcome,
102+
"Applications readiness check passed");
101103
}
102-
104+
103105
/**
104106
* <p>
105107
* Returns response information from the specified URL.

finish/src/test/java/it/io/openliberty/sample/PropertiesEndpointIT.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// tag::copyright[]
22
/*******************************************************************************
3-
* Copyright (c) 2018 IBM Corporation and others.
3+
* Copyright (c) 2018, 2022 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v1.0
66
* which accompanies this distribution, and is available at
@@ -14,13 +14,12 @@
1414

1515
import static org.junit.jupiter.api.Assertions.assertEquals;
1616

17-
import javax.json.JsonObject;
18-
import javax.ws.rs.client.Client;
19-
import javax.ws.rs.client.ClientBuilder;
20-
import javax.ws.rs.client.WebTarget;
21-
import javax.ws.rs.core.Response;
17+
import jakarta.json.JsonObject;
18+
import jakarta.ws.rs.client.Client;
19+
import jakarta.ws.rs.client.ClientBuilder;
20+
import jakarta.ws.rs.client.WebTarget;
21+
import jakarta.ws.rs.core.Response;
2222

23-
import org.apache.cxf.jaxrs.provider.jsrjsonp.JsrJsonpProvider;
2423
import org.junit.jupiter.api.Test;
2524

2625
public class PropertiesEndpointIT {
@@ -35,7 +34,6 @@ public void testGetProperties() {
3534

3635
// client setup
3736
Client client = ClientBuilder.newClient();
38-
client.register(JsrJsonpProvider.class);
3937

4038
// request
4139
WebTarget target = client.target(url + "/system/properties");
@@ -47,6 +45,7 @@ public void testGetProperties() {
4745
JsonObject obj = response.readEntity(JsonObject.class);
4846

4947
response.close();
48+
client.close();
5049
}
5150

5251
}

0 commit comments

Comments
 (0)