Skip to content

Commit

Permalink
Merge branch 'main' into jackson_pool
Browse files Browse the repository at this point in the history
  • Loading branch information
mariofusco authored Sep 8, 2023
2 parents e203777 + bc9e7ef commit 7ec1f8c
Show file tree
Hide file tree
Showing 74 changed files with 1,903 additions and 784 deletions.
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ updates:
- dependency-name: io.smallrye.common:*
- dependency-name: io.smallrye.config:*
- dependency-name: io.smallrye.reactive:*
# Swagger-UI
- dependency-name: org.webjars:swagger-ui
# RX Java 2
- dependency-name: io.reactivex.rxjava2:rxjava
# Test dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/virtual-threads-tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"category": "Main",
"timeout": 50,
"test-modules": "grpc-virtual-threads, mailer-virtual-threads, redis-virtual-threads, rest-client-reactive-virtual-threads, resteasy-reactive-virtual-threads, vertx-event-bus-virtual-threads, scheduler-virtual-threads, quartz-virtual-threads",
"test-modules": "virtual-threads-disabled, grpc-virtual-threads, mailer-virtual-threads, redis-virtual-threads, rest-client-reactive-virtual-threads, resteasy-reactive-virtual-threads, vertx-event-bus-virtual-threads, scheduler-virtual-threads, quartz-virtual-threads",
"os-name": "ubuntu-latest"
},
{
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ci-actions-incremental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,9 @@ jobs:
steps:
- name: Gradle Enterprise environment
run: |
echo "GE_TAGS=jdk-${{matrix.java.name}}" >> "$GITHUB_ENV"
echo "GE_CUSTOM_VALUES=gh-job-name=Virtual Thread Support Tests Native - ${{matrix.category}}" >> "$GITHUB_ENV"
category=$(echo -n '${{matrix.category}}' | tr '[:upper:]' '[:lower:]' | tr -c '[:alnum:]-' '-' | sed -E 's/-+/-/g')
echo "GE_TAGS=virtual-thread-native-${category}" >> "$GITHUB_ENV"
echo "GE_CUSTOM_VALUES=gh-job-name=Native Tests - Virtual Thread - ${{matrix.category}}" >> "$GITHUB_ENV"
- uses: actions/checkout@v3
- name: Restore Maven Repository
uses: actions/cache/restore@v3
Expand Down Expand Up @@ -881,7 +882,8 @@ jobs:
steps:
- name: Gradle Enterprise environment
run: |
echo "GE_TAGS=jdk-${{matrix.java.name}}" >> "$GITHUB_ENV"
category=$(echo -n '${{matrix.category}}' | tr '[:upper:]' '[:lower:]' | tr -c '[:alnum:]-' '-' | sed -E 's/-+/-/g')
echo "GE_TAGS=native-${category}" >> "$GITHUB_ENV"
echo "GE_CUSTOM_VALUES=gh-job-name=Native Tests - ${{matrix.category}}" >> "$GITHUB_ENV"
- name: Support longpaths on Windows
if: "startsWith(matrix.os-name, 'windows')"
Expand Down
4 changes: 0 additions & 4 deletions .mvn/gradle-enterprise.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
<enabled>false</enabled>
</local>
<remote>
<server>
<url>https://ge.quarkus.io/cache/main/</url>
<allowUntrusted>false</allowUntrusted>
</server>
<enabled>true</enabled>
<storeEnabled>#{env['CI'] != null}</storeEnabled>
</remote>
Expand Down
1 change: 1 addition & 0 deletions ADOPTERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ If any organization would like get added or removed please make a pull request b
|GoWithFlow | https://quarkus.io/blog/gowithflow-chooses-quarkus-to-deliver-fast-to-production/ |
|Lufthansa Technik | https://quarkus.io/blog/aviatar-experiences-significant-savings/ |
|Logicdrop | https://quarkus.io/blog/logicdrop-customer-story/ |
|[Microcks](https://landscape.cncf.io/?selected=microcks) | https://itnext.io/mocking-and-contract-testing-in-your-inner-loop-with-microcks-part-3-quarkus-devservice-ftw-a14b807737be |
|Payair | https://quarkus.io/blog/why-did-payair-technologies-switch-to-quarkus/ |
|Sedona | https://quarkus.io/blog/sedona-rewrites-insurance-premium/ |
|Stargate | https://quarkus.io/blog/stargate-selects-quarkus-for-its-v2-implementation/ |
Expand Down
18 changes: 12 additions & 6 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@
<smallrye-config.version>3.3.4</smallrye-config.version>
<smallrye-health.version>4.0.4</smallrye-health.version>
<smallrye-metrics.version>4.0.0</smallrye-metrics.version>
<smallrye-open-api.version>3.5.1</smallrye-open-api.version>
<smallrye-open-api.version>3.5.2</smallrye-open-api.version>
<smallrye-graphql.version>2.4.0</smallrye-graphql.version>
<smallrye-opentracing.version>3.0.3</smallrye-opentracing.version>
<smallrye-fault-tolerance.version>6.2.6</smallrye-fault-tolerance.version>
<smallrye-jwt.version>4.3.0</smallrye-jwt.version>
<smallrye-context-propagation.version>2.1.0</smallrye-context-propagation.version>
<smallrye-reactive-streams-operators.version>1.0.13</smallrye-reactive-streams-operators.version>
<smallrye-reactive-types-converter.version>3.0.0</smallrye-reactive-types-converter.version>
<smallrye-mutiny-vertx-binding.version>3.5.0</smallrye-mutiny-vertx-binding.version>
<smallrye-mutiny-vertx-binding.version>3.6.0</smallrye-mutiny-vertx-binding.version>
<smallrye-reactive-messaging.version>4.9.0</smallrye-reactive-messaging.version>
<smallrye-stork.version>2.3.1</smallrye-stork.version>
<jakarta.activation.version>2.1.2</jakarta.activation.version>
Expand Down Expand Up @@ -91,7 +91,7 @@
<maven-toolchain.version>3.0-alpha-2</maven-toolchain.version>
<plexus-component-annotations.version>2.1.0</plexus-component-annotations.version>
<graal-sdk.version>23.0.1</graal-sdk.version>
<gizmo.version>1.6.1.Final</gizmo.version>
<gizmo.version>1.7.0</gizmo.version>
<jackson-bom.version>2.16.0-SNAPSHOT</jackson-bom.version>
<commons-logging-jboss-logging.version>1.0.0.Final</commons-logging-jboss-logging.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
Expand Down Expand Up @@ -146,7 +146,7 @@
<brotli4j.version>1.12.0</brotli4j.version>
<reactive-streams.version>1.0.4</reactive-streams.version>
<jboss-logging.version>3.5.3.Final</jboss-logging.version>
<mutiny.version>2.3.1</mutiny.version>
<mutiny.version>2.4.0</mutiny.version>
<kafka3.version>3.5.1</kafka3.version>
<lz4.version>1.8.0</lz4.version> <!-- dependency of the kafka-clients that could be overridden by other imported BOMs in the platform -->
<snappy.version>1.1.10.1</snappy.version>
Expand All @@ -168,7 +168,9 @@
<jboss-logmanager.version>3.0.2.Final</jboss-logmanager.version>
<flyway.version>9.21.2</flyway.version>
<yasson.version>3.0.3</yasson.version>
<liquibase.version>4.20.0</liquibase.version>
<!-- liquibase-mongodb is not released everytime with liquibase anymore, but the two versions need to be compatible -->
<liquibase.version>4.23.1</liquibase.version>
<liquibase-mongodb.version>4.23.0</liquibase-mongodb.version>
<snakeyaml.version>2.1</snakeyaml.version>
<osgi.version>6.0.0</osgi.version>
<mongo-client.version>4.10.2</mongo-client.version>
Expand Down Expand Up @@ -5893,6 +5895,10 @@
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- liquibase-core has a dependency on org.osgi:osgi.core -->
Expand All @@ -5904,7 +5910,7 @@
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-mongodb</artifactId>
<version>${liquibase.version}</version>
<version>${liquibase-mongodb.version}</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ public NativeImageInvokerInfo build() {
}
final String includeLocales = LocaleProcessor.nativeImageIncludeLocales(nativeConfig, localesBuildTimeConfig);
if (!includeLocales.isEmpty()) {
nativeImageArgs.add("-H:IncludeLocales=" + includeLocales);
addExperimentalVMOption(nativeImageArgs, "-H:IncludeLocales=" + includeLocales);
}

nativeImageArgs.add("-J-Dfile.encoding=" + nativeConfig.fileEncoding());
Expand Down Expand Up @@ -744,7 +744,7 @@ public NativeImageInvokerInfo build() {
* {@code handleAdditionalProperties(nativeImageArgs)} to ensure that devs and advanced users can
* override it by passing -Dquarkus.native.additional-build-args=-H:+ParseOnce
*/
nativeImageArgs.add("-H:-ParseOnce");
addExperimentalVMOption(nativeImageArgs, "-H:-ParseOnce");
}

if (nativeConfig.debug().enabled() && graalVMVersion.compareTo(GraalVM.Version.VERSION_23_0_0) >= 0) {
Expand All @@ -756,9 +756,9 @@ public NativeImageInvokerInfo build() {
*
* See https://github.com/quarkusio/quarkus/issues/30772 for more details.
*/
nativeImageArgs.add("-H:+TrackNodeSourcePosition");
addExperimentalVMOption(nativeImageArgs, "-H:+TrackNodeSourcePosition");
/* See https://github.com/Karm/mandrel-integration-tests/issues/154 for more details. */
nativeImageArgs.add("-H:+DebugCodeInfoUseSourceMappings");
addExperimentalVMOption(nativeImageArgs, "-H:+DebugCodeInfoUseSourceMappings");
}

/**
Expand All @@ -780,7 +780,7 @@ public NativeImageInvokerInfo build() {
nativeImageArgs.add("-J--add-opens=java.base/java.util=ALL-UNNAMED");

if (nativeConfig.enableReports()) {
nativeImageArgs.add("-H:PrintAnalysisCallTreeType=CSV");
addExperimentalVMOption(nativeImageArgs, "-H:PrintAnalysisCallTreeType=CSV");
}

// only available in GraalVM 22.3.0+.
Expand Down Expand Up @@ -829,7 +829,7 @@ public NativeImageInvokerInfo build() {
}
if (nativeConfig.debug().enabled()) {
nativeImageArgs.add("-g");
nativeImageArgs.add("-H:DebugInfoSourceSearchPath=" + APP_SOURCES);
addExperimentalVMOption(nativeImageArgs, "-H:DebugInfoSourceSearchPath=" + APP_SOURCES);
}
if (nativeConfig.debugBuildProcess()) {
String debugBuildProcessHost;
Expand Down Expand Up @@ -864,14 +864,14 @@ public NativeImageInvokerInfo build() {
nativeImageArgs.add("--enable-url-protocols=" + String.join(",", protocols));
}
if (!inlineBeforeAnalysis) {
nativeImageArgs.add("-H:-InlineBeforeAnalysis");
addExperimentalVMOption(nativeImageArgs, "-H:-InlineBeforeAnalysis");
}
if (!pie.isEmpty()) {
nativeImageArgs.add("-H:NativeLinkerOption=" + pie);
}

if (!nativeConfig.enableIsolates()) {
nativeImageArgs.add("-H:-SpawnIsolates");
addExperimentalVMOption(nativeImageArgs, "-H:-SpawnIsolates");
}
if (!nativeConfig.enableJni()) {
log.warn(
Expand All @@ -887,7 +887,7 @@ public NativeImageInvokerInfo build() {
+ " will be removed in a future Quarkus version.");
}
if (nativeConfig.enableVmInspection()) {
nativeImageArgs.add("-H:+AllowVMInspection");
addExperimentalVMOption(nativeImageArgs, "-H:+AllowVMInspection");
}

if (nativeConfig.monitoring().isPresent()) {
Expand All @@ -914,15 +914,16 @@ public NativeImageInvokerInfo build() {
}

if (nativeConfig.enableDashboardDump()) {
nativeImageArgs.add("-H:DashboardDump=" + outputTargetBuildItem.getBaseName() + "_dashboard.dump");
nativeImageArgs.add("-H:+DashboardAll");
addExperimentalVMOption(nativeImageArgs,
"-H:DashboardDump=" + outputTargetBuildItem.getBaseName() + "_dashboard.dump");
addExperimentalVMOption(nativeImageArgs, "-H:+DashboardAll");
}

if (nativeImageSecurityProviders != null && !nativeImageSecurityProviders.isEmpty()) {
String additionalSecurityProviders = nativeImageSecurityProviders.stream()
.map(p -> p.getSecurityProvider())
.collect(Collectors.joining(","));
nativeImageArgs.add("-H:AdditionalSecurityProviders=" + additionalSecurityProviders);
addExperimentalVMOption(nativeImageArgs, "-H:AdditionalSecurityProviders=" + additionalSecurityProviders);
}

if (jpmsExports != null) {
Expand Down Expand Up @@ -1004,7 +1005,7 @@ private void handleAdditionalProperties(List<String> command) {
+ CONTAINER_BUILD_VOLUME_PATH + "/" + MOVED_TRUST_STORE_NAME);
} catch (IOException e) {
throw new UncheckedIOException("Unable to copy trustStore file '" + configuredTrustStorePath
+ "' to volume root directory '" + outputDir.toAbsolutePath().toString() + "'", e);
+ "' to volume root directory '" + outputDir.toAbsolutePath() + "'", e);
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ public static class RotationConfig {
/**
* The file handler rotation file suffix.
* When used, the file will be rotated based on its suffix.
*
* <p>
* Example fileSuffix: .yyyy-MM-dd
* <p>
* Note: If the suffix ends with .zip or .gz, the rotation file will also be compressed.
*/
@ConfigItem
Optional<String> fileSuffix;
Expand Down
19 changes: 11 additions & 8 deletions docs/src/main/asciidoc/getting-started-testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,7 @@ import org.mockito.Mockito;
public class FooTest {
@RegisterExtension <1>
static final QuarkusComponentTestExtension extension = new QuarkusComponentTestExtension().configProperty("bar","true");
static final QuarkusComponentTestExtension extension = QuarkusComponentTestExtension.builder().configProperty("bar","true").build();
@Inject
Foo foo;
Expand All @@ -1621,9 +1621,10 @@ public class FooTest {
=== Lifecycle

So what exactly does the `QuarkusComponentTest` do?
It starts the CDI container and registers a dedicated xref:config-reference.adoc[configuration object] during the `before all` test phase.
The container is stopped and the config is released during the `after all` test phase.
The fields annotated with `@Inject` and `@InjectMock` are injected after a test instance is created and unset before a test instance is destroyed.
It starts the CDI container and registers a dedicated xref:config-reference.adoc[configuration object].
If the test instance lifecycle is `Lifecycle#PER_METHOD` (default) then the container is started during the `before each` test phase and stopped during the `after each` test phase.
However, if the test instance lifecycle is `Lifecycle#PER_CLASS` then the container is started during the `before all` test phase and stopped during the `after all` test phase.
The fields annotated with `@Inject` and `@InjectMock` are injected after a test instance is created.
Finally, the CDI request context is activated and terminated per each test method.

=== Auto Mocking Unsatisfied Dependencies
Expand All @@ -1637,13 +1638,15 @@ You can inject the mock in your test and leverage the Mockito API to configure t
=== Custom Mocks For Unsatisfied Dependencies

Sometimes you need the full control over the bean attributes and maybe even configure the default mock behavior.
You can use the mock configurator API via the `QuarkusComponentTestExtension#mock()` method.
You can use the mock configurator API via the `QuarkusComponentTestExtensionBuilder#mock()` method.

=== Configuration

A dedicated `SmallRyeConfig` is registered during the `before all` test phase.
Moreover, it's possible to set the configuration properties via the `QuarkusComponentTestExtension#configProperty(String, String)` method or the `@TestConfigProperty` annotation.
If you only need to use the default values for missing config properties, then the `QuarkusComponentTestExtension#useDefaultConfigProperties()` or `@QuarkusComponentTest#useDefaultConfigProperties()` might come in useful.
You can set the configuration properties for a test with the `@io.quarkus.test.component.TestConfigProperty` annotation or with the `QuarkusComponentTestExtensionBuilder#configProperty(String, String)` method.
If you only need to use the default values for missing config properties, then the `@QuarkusComponentTest#useDefaultConfigProperties()` or `QuarkusComponentTestExtensionBuilder#useDefaultConfigProperties()` might come in useful.

It is also possible to set configuration properties for a test method with the `@io.quarkus.test.component.TestConfigProperty` annotation.
However, if the test instance lifecycle is `Lifecycle#_PER_CLASS` this annotation can only be used on the test class and is ignored on test methods.

=== Mocking CDI Interceptors

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/logging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Quarkus supports the JBoss Logging API as well as multiple other logging APIs, s
You can use any of the <<logging-apis,following APIs>>:

* link:https://github.com/jboss-logging/jboss-logging[JBoss Logging]
* JDK `java.util.logging` (JUL)
* link:https://docs.oracle.com/en/java/javase/11/docs/api/java.logging/java/util/logging/package-summary.html[JDK `java.util.logging` (JUL)]
* link:https://www.slf4j.org/[SLF4J]
* link:https://commons.apache.org/proper/commons-logging/[Apache Commons Logging]
* link:https://logging.apache.org/log4j/2.x/[Apache Log4j 2]
Expand Down
Loading

0 comments on commit 7ec1f8c

Please sign in to comment.