Skip to content

Commit

Permalink
Migrate from javax to jakarta
Browse files Browse the repository at this point in the history
  • Loading branch information
Martina Linartová committed Jul 19, 2023
1 parent 52ef9a4 commit ed1610b
Show file tree
Hide file tree
Showing 19 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion ACKNOWLEDGEMENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Acknowledgements
## MicroProfile Starter
Test applications ```app-full-microprofile``` and ```app-jax-rs-minimal``` are modified versions of code
Test applications ```app-full-microprofile``` and ```app-jakarta-rest-minimal``` are modified versions of code
originally generated by [https://start.microprofile.io/](https://start.microprofile.io/).
Some utility methods were adopted from [https://github.com/eclipse/microprofile-starter/](https://github.com/eclipse/microprofile-starter/)
and modified to suit the limited purpose of this TS. The adopted work was authored
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ e.g. on Windows:
λ type testsuite\target\archived-logs\io.quarkus.ts.startstop.StartStopTest\measurements.csv
App,Mode,buildTimeMs,timeToFirstOKRequestMs,startedInMs,stoppedInMs,RSSKb,FDs
FULL_MICROPROFILE,JVM,9391,2162,1480,54,3820,78
JAX_RS_MINIMAL,JVM,6594,1645,949,34,3824,78
JAKARTA_REST_MINIMAL,JVM,6594,1645,949,34,3824,78
```

and on Linux:
Expand All @@ -80,8 +80,8 @@ $ cat ./testsuite/target/archived-logs/io.quarkus.ts.startstop.StartStopTest/mea
App,Mode,buildTimeMs,timeToFirstOKRequestMs,startedInMs,stoppedInMs,RSSKb,FDs
FULL_MICROPROFILE,JVM,9117,1439,1160,18,179932,307
FULL_MICROPROFILE,NATIVE,142680,22,17,1,51592,129
JAX_RS_MINIMAL,JVM,5934,1020,745,22,141996,162
JAX_RS_MINIMAL,NATIVE,93943,10,7,3,29768,74
JAKARTA_REST_MINIMAL,JVM,5934,1020,745,22,141996,162
JAKARTA_REST_MINIMAL,NATIVE,93943,10,7,3,29768,74
```

## ArtifactGeneratorTest
Expand Down Expand Up @@ -174,12 +174,12 @@ Both build logs and runtime logs are checked for error messages. Expected error
To examine logs yourself see ```./testsuite/target/archived-logs/``` , e.g.

```
./testsuite/target/archived-logs/io.quarkus.ts.startstop.StartStopTest/jaxRsMinimalNative/native-build.log
./testsuite/target/archived-logs/io.quarkus.ts.startstop.StartStopTest/jaxRsMinimalNative/native-run.log
./testsuite/target/archived-logs/io.quarkus.ts.startstop.StartStopTest/jakartaRESTMinimalNative/native-build.log
./testsuite/target/archived-logs/io.quarkus.ts.startstop.StartStopTest/jakartaRESTMinimalNative/native-run.log
./testsuite/target/archived-logs/io.quarkus.ts.startstop.StartStopTest/fullMicroProfileJVM/jvm-run.log
./testsuite/target/archived-logs/io.quarkus.ts.startstop.StartStopTest/fullMicroProfileJVM/jvm-build.log
./testsuite/target/archived-logs/io.quarkus.ts.startstop.StartStopTest/jaxRsMinimalJVM/jvm-run.log
./testsuite/target/archived-logs/io.quarkus.ts.startstop.StartStopTest/jaxRsMinimalJVM/jvm-build.log
./testsuite/target/archived-logs/io.quarkus.ts.startstop.StartStopTest/jakartaRESTMinimalJVM/jvm-run.log
./testsuite/target/archived-logs/io.quarkus.ts.startstop.StartStopTest/jakartaRESTMinimalJVM/jvm-build.log
./testsuite/target/archived-logs/io.quarkus.ts.startstop.StartStopTest/fullMicroProfileNative/native-build.log
./testsuite/target/archived-logs/io.quarkus.ts.startstop.StartStopTest/fullMicroProfileNative/native-run.log
```
Expand All @@ -190,13 +190,13 @@ The test suite records Maven commands it used, the directories where those comma
a neat markdown file for each test run. e.g.

```
# io.quarkus.ts.startstop.StartStopTest, jaxRsMinimalJVM
/home/karm/workspaceRH/quarkus-startstop/app-jax-rs-minimal
# io.quarkus.ts.startstop.StartStopTest, jakartaRESTMinimalJVM
/home/karm/workspaceRH/quarkus-startstop/app-jakarta-rest-minimal
mvn clean compile quarkus:build -Dquarkus.package.output-name=quarkus -Dmaven.repo.local=/home/karm/QUARKUS/quarkus-1.3.2.CR1/maven-repository
---
/home/karm/workspaceRH/quarkus-startstop/app-jax-rs-minimal
/home/karm/workspaceRH/quarkus-startstop/app-jakarta-rest-minimal
java -jar target/quarkus-runner.jar
Expand All @@ -205,7 +205,7 @@ Measurements:
|App|Mode|buildTimeMs|timeToFirstOKRequestMs|startedInMs|stoppedInMs|RSSKb|FDs|
| --- | --- | --- | --- | --- | --- | --- | --- |
|JAX_RS_MINIMAL|JVM|4787|906|643|18|140504|162|
|JAKARTA_REST_MINIMAL|JVM|4787|906|643|18|140504|162|
```

Expand All @@ -219,7 +219,7 @@ Subsequent test suite executions without ```mvn clean``` keep appending to this

## Thresholds

The test suite works with ```threshold.properties``` for each test app. E.g. ```app-jax-rs-minimal/threshold.properties```:
The test suite works with ```threshold.properties``` for each test app. E.g. ```app-jakarta-rest-minimal/threshold.properties```:

```
linux.jvm.time.to.first.ok.request.threshold.ms=1500
Expand All @@ -234,7 +234,7 @@ The measured values are simply compared to be less or equal to the set threshold
by using env variables or system properties (in this order). All letter are capitalized and dot is replaced with underscore, e.g.

```
APP_JAX_RS_MINIMAL_LINUX_JVM_TIME_TO_FIRST_OK_REQUEST_THRESHOLD_MS=500 mvn clean verify -Ptestsuite
APP_JAKARTA_REST_MINIMAL_LINUX_JVM_TIME_TO_FIRST_OK_REQUEST_THRESHOLD_MS=500 mvn clean verify -Ptestsuite
```

Results in:
Expand All @@ -243,7 +243,7 @@ Results in:
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] StartStopTest.jaxRsMinimalJVM:137->testRuntime:121 Application JAX_RS_MINIMAL
[ERROR] StartStopTest.jakartaRESTMinimalJVM:137->testRuntime:121 Application JAKARTA_REST_MINIMAL
in JVM mode took 957 ms to get the first OK request, which is over 500 ms threshold.
==> expected: <true> but was: <false>
[INFO]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<h2>Hello from a full MicroProfile suite</h2>

<a href="data/hello" target="_blank" >Hello JAX-RS endpoint</a> <br/>
<a href="data/hello" target="_blank" >Hello Jakarta REST endpoint</a> <br/>

<h3>Config</h3>
<a href="data/config/injected" target="_blank" >Injected config values</a> <br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<version>1.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>app-jax-rs-minimal</artifactId>
<artifactId>app-jakarta-rest-minimal</artifactId>
<dependencyManagement>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello from a simple Jakarta REST app.</title>
</head>
<body>
<h2>Simple Jakarta REST</h2>
<a href="data/hello" target="_blank" >Hello Jakarta REST endpoint</a> <br/>
</body>
</html>
File renamed without changes.

This file was deleted.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
</properties>
<modules>
<module>testsuite</module>
<module>app-jax-rs-minimal</module>
<module>app-jakarta-rest-minimal</module>
<module>app-full-microprofile</module>
</modules>
</profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
@EnabledOnOs({OS.LINUX}) // debug details are available only on Linux
public class NativeDebugTest {

private final Apps app = Apps.JAX_RS_MINIMAL;
private final Apps app = Apps.JAKARTA_REST_MINIMAL;
private final MvnCmds mvnCmds = MvnCmds.NATIVE;

private static final Logger LOGGER = Logger.getLogger(StartStopTest.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,18 @@ public void runQuarkusMavenPluginGoal(TestInfo testInfo, Apps app, String goalNa

@Test
public void helpTarget(TestInfo testInfo) throws IOException, InterruptedException {
runQuarkusMavenPluginGoal(testInfo, Apps.JAX_RS_MINIMAL, "help", "quarkus:info", "quarkus:update");
runQuarkusMavenPluginGoal(testInfo, Apps.JAKARTA_REST_MINIMAL, "help", "quarkus:info", "quarkus:update");
}

@Test
public void infoTarget(TestInfo testInfo) throws IOException, InterruptedException {
runQuarkusMavenPluginGoal(testInfo, Apps.JAX_RS_MINIMAL, "info", "io.quarkus:quarkus-resteasy");
runQuarkusMavenPluginGoal(testInfo, Apps.JAKARTA_REST_MINIMAL, "info", "io.quarkus:quarkus-resteasy");
}

@Test
@DisabledOnOs({OS.WINDOWS}) // https://github.com/quarkusio/quarkus/issues/33403
public void updateTarget(TestInfo testInfo) throws IOException, InterruptedException {
runQuarkusMavenPluginGoal(testInfo, Apps.JAX_RS_MINIMAL, "update", "quarkus:update goal is experimental");
runQuarkusMavenPluginGoal(testInfo, Apps.JAKARTA_REST_MINIMAL, "update", "quarkus:update goal is experimental");
}

}
30 changes: 15 additions & 15 deletions testsuite/src/it/java/io/quarkus/ts/startstop/SpecialCharsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,90 +159,90 @@ public void testRuntime(TestInfo testInfo, Apps app, MvnCmds mvnCmds, String sub

@Test
public void spacesJVM(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.JVM, "s p a c e s j v m");
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.JVM, "s p a c e s j v m");
}

@Test
public void spacesDEV(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.DEV, "s p a c e s d e v");
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.DEV, "s p a c e s d e v");
}

@Test
@Tag("native")
public void spacesNative(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.NATIVE, "s p a c e s n a t i v e");
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.NATIVE, "s p a c e s n a t i v e");
}

@Test
public void specialJVM(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.JVM, ",;~!@#$%^&()");
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.JVM, ",;~!@#$%^&()");
}

@Test
@DisabledOnOs({OS.WINDOWS}) // https://github.com/quarkusio/quarkus/issues/9707
public void specialDEV(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.DEV, ",;~!@#$%^&()");
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.DEV, ",;~!@#$%^&()");
}

@Test
@Tag("native")
@DisabledOnOs({OS.WINDOWS}) // https://github.com/quarkusio/quarkus/issues/9707
public void specialNative(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.NATIVE, ",;~!@#$%^&()");
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.NATIVE, ",;~!@#$%^&()");
}

@Test
public void diacriticsJVM(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.JVM, "ěščřžýáíéůú");
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.JVM, "ěščřžýáíéůú");
}

@Test
@DisabledOnOs({OS.WINDOWS}) // https://github.com/quarkusio/quarkus/issues/9707
public void diacriticsDEV(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.DEV, "ěščřžýáíéůú");
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.DEV, "ěščřžýáíéůú");
}

@Test
@Tag("native")
@DisabledOnOs({OS.WINDOWS}) // https://github.com/quarkusio/quarkus/issues/9707
public void diacriticsNative(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.NATIVE, "ěščřžýáíéůú");
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.NATIVE, "ěščřžýáíéůú");
}

@Test
public void japaneseJVM(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.JVM, "元気かい");
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.JVM, "元気かい");
}

@Test
@DisabledOnOs({OS.WINDOWS}) // https://github.com/quarkusio/quarkus/issues/9707
public void japaneseDEV(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.DEV, "元気かい");
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.DEV, "元気かい");
}

@Test
@Tag("native")
@DisabledOnOs({OS.WINDOWS}) // https://github.com/quarkusio/quarkus/issues/9707
public void japaneseNative(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.NATIVE, "元気かい");
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.NATIVE, "元気かい");
}

@Test
public void otherJVM(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.JVM, "Îñţérñåţîöñåļîžåţîờñ");
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.JVM, "Îñţérñåţîöñåļîžåţîờñ");
}

@Test
@DisabledOnOs({OS.WINDOWS}) // https://github.com/quarkusio/quarkus/issues/9707
public void otherDEV(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.DEV, "Îñţérñåţîöñåļîžåţîờñ");
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.DEV, "Îñţérñåţîöñåļîžåţîờñ");
}

@Test
@Tag("native")
@DisabledOnOs({OS.WINDOWS}) // https://github.com/quarkusio/quarkus/issues/9707
public void otherNative(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.NATIVE, "Îñţérñåţîöñåļîžåţîờñ");
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.NATIVE, "Îñţérñåţîöñåļîžåţîờñ");
}

private void removeDirWithSpecialCharacters(File appDestDir) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@ private long getAvgWithoutMinMax(List<Long> listOfValues) {
}

@Test
public void jaxRsMinimalJVM(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.JVM);
public void jakartaRESTMinimalJVM(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.JVM);
}

@Test
@Tag("native")
public void jaxRsMinimalNative(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAX_RS_MINIMAL, MvnCmds.NATIVE);
public void jakartaRESTMinimalNative(TestInfo testInfo) throws IOException, InterruptedException {
testRuntime(testInfo, Apps.JAKARTA_REST_MINIMAL, MvnCmds.NATIVE);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import static org.junit.jupiter.api.Assertions.fail;

public enum Apps {
JAX_RS_MINIMAL("app-jax-rs-minimal", URLContent.JAX_RS_MINIMAL, WhitelistLogLines.JAX_RS_MINIMAL),
JAKARTA_REST_MINIMAL("app-jakarta-rest-minimal", URLContent.JAKARTA_REST_MINIMAL, WhitelistLogLines.JAKARTA_REST_MINIMAL),
FULL_MICROPROFILE("app-full-microprofile", URLContent.FULL_MICROPROFILE, WhitelistLogLines.FULL_MICROPROFILE),
GENERATED_SKELETON("app-generated-skeleton", URLContent.GENERATED_SKELETON, WhitelistLogLines.GENERATED_SKELETON);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public enum CodeQuarkusExtensions {
QUARKUS_OIDC_CLIENT_REACTIVE_FILTER("quarkus-oidc-client-reactive-filter", "OpenID Connect Client Filter Reactive", "YqA", true),
QUARKUS_OIDC_TOKEN_PROPAGATION_REACTIVE("quarkus-oidc-token-propagation-reactive", "OpenID Connect Token Propagation Reactive", "ignored", false),

// TODO Introduce buckets with non reactive jax-rs extensions
// TODO Introduce buckets with non reactive jakarta-rest extensions
// To avoid java.lang.IllegalStateException: The 'quarkus-resteasy-reactive' and 'quarkus-resteasy' extensions cannot be used at the same time.
// QUARKUS_RESTEASY("quarkus-resteasy", "RESTEasy JAX-RS", "98e", true),
// QUARKUS_RESTEASY("quarkus-resteasy", "RESTEasy Jakarta REST", "98e", true),
// QUARKUS_RESTEASY_JACKSON("quarkus-resteasy-jackson", "RESTEasy Jackson", "pV1", true),
// QUARKUS_RESTEASY_JSONB("quarkus-resteasy-jsonb", "RESTEasy JSON-B", "49J", true),
// QUARKUS_RESTEASY_JAXB("quarkus-resteasy-jaxb", "RESTEasy JAXB", "d7W", true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Available endpoitns and expected content.
*/
public enum URLContent {
JAX_RS_MINIMAL(new String[][]{
new String[]{"http://localhost:8080", "Hello from a simple JAX-RS app."},
JAKARTA_REST_MINIMAL(new String[][]{
new String[]{"http://localhost:8080", "Hello from a simple Jakarta REST app."},
new String[]{"http://localhost:8080/data/hello", "Hello World"}
}),
FULL_MICROPROFILE(new String[][]{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Whitelists errors in log files.
*/
public enum WhitelistLogLines {
JAX_RS_MINIMAL(new Pattern[]{
JAKARTA_REST_MINIMAL(new Pattern[]{
// Some artifacts names...
Pattern.compile(".*maven-error-diagnostics.*"),
Pattern.compile(".*errorprone.*"),
Expand All @@ -18,11 +18,11 @@ public enum WhitelistLogLines {
Pattern.compile(".*maven-error-diagnostics.*"),
Pattern.compile(".*errorprone.*"),
// Well, the RestClient demo probably should do some cleanup before shutdown...?
Pattern.compile(".*Closing a class org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient.*"),
Pattern.compile(".*Closing a class org.jboss.resteasy.client.jakarta-rest.engines.ApacheHttpClient.*"),
// https://github.com/quarkusio/quarkus/pull/28810
Pattern.compile(".*Stream is closed, ignoring and trying to continue.*"),
// GH Action runners are slow, graceful shutdown is not guaranteed on Quarkus
// RESTEASY004687: Closing a class org.jboss.resteasy.client.jaxrs.engines.ManualClosingApacheHttpClient43Engine$CleanupAction instance for you.
// RESTEASY004687: Closing a class org.jboss.resteasy.client.jakarta-rest.engines.ManualClosingApacheHttpClient43Engine$CleanupAction instance for you.
Pattern.compile(".*RESTEASY004687: Closing a class.*CleanupAction.*"),
}),
GENERATED_SKELETON(new Pattern[]{
Expand Down Expand Up @@ -54,8 +54,8 @@ public enum WhitelistLogLines {
// We have disabled the Quarkus Registry Client (-DquarkusRegistryClient=false)
Pattern.compile(".*The extension catalog will be narrowed to.*"),
// comes with https://github.com/quarkusio/quarkus/pull/20182
Pattern.compile(".*Hibernate ORM is disabled because no JPA entities were found.*"),
Pattern.compile(".*Hibernate Reactive is disabled because no JPA entities were found.*"),
Pattern.compile(".*Hibernate ORM is disabled because no Jakarta Persistence entities were found.*"),
Pattern.compile(".*Hibernate Reactive is disabled because no Jakarta Persistence entities were found.*"),
// comes with https://github.com/quarkusio/quarkus/pull/19969 https://github.com/quarkusio/quarkus/pull/26868 https://github.com/quarkusio/quarkus/pull/27811
Pattern.compile(".*OIDC Server is not available.*"),
Pattern.compile(".*localhost:6661.*"),
Expand Down

0 comments on commit ed1610b

Please sign in to comment.