generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revisit logging configuration fix #1162
- Loading branch information
Showing
14 changed files
with
877 additions
and
294 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
.../src/test/java/io/quarkiverse/cxf/deployment/logging/EnabledPrettyLoggingFeatureTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package io.quarkiverse.cxf.deployment.logging; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.io.IOException; | ||
import java.util.logging.LogRecord; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkiverse.cxf.annotation.CXFClient; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
/** | ||
* {@code LoggingFeature} set in {@code application.properties} and a named bean is produced via | ||
* {@link NamedLoggingFeatureProducer} | ||
*/ | ||
public class EnabledPrettyLoggingFeatureTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest TEST = new QuarkusUnitTest() | ||
.withApplicationRoot( | ||
root -> root.addClasses(HelloService.class, HelloServiceImpl.class)) | ||
.overrideConfigKey("quarkus.cxf.endpoint.\"/hello\".implementor", HelloServiceImpl.class.getName()) | ||
.overrideConfigKey("quarkus.cxf.endpoint.\"/hello\".logging.enabled", "true") | ||
.overrideConfigKey("quarkus.cxf.endpoint.\"/hello\".logging.pretty", "false") | ||
.overrideConfigKey("quarkus.cxf.client.hello.service-interface", HelloService.class.getName()) | ||
.overrideConfigKey("quarkus.cxf.client.hello.client-endpoint-url", "http://localhost:8081/services/hello") | ||
.overrideConfigKey("quarkus.cxf.client.hello.logging.enabled", "pretty") | ||
.setLogRecordPredicate(logRecord -> logRecord.getLoggerName().contains("org.apache.cxf.services.HelloService.RE")) // REQ_IN or RESP_OUT | ||
.assertLogRecords(records -> assertThat(records) | ||
.extracting(LogRecord::getMessage) | ||
.anyMatch(msg -> msg.contains( | ||
/* The service in message is not pretty */ | ||
"Payload: <soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><ns2:hello xmlns:ns2=\"http://deployment.logging.features.cxf.quarkiverse.io/\"><arg0>Dolly</arg0></ns2:hello></soap:Body></soap:Envelope>")) | ||
.anyMatch(msg -> msg.contains( | ||
/* The service out message is not pretty */ | ||
"Payload: <soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><ns2:helloResponse xmlns:ns2=\"http://deployment.logging.features.cxf.quarkiverse.io/\"><return>Hello Dolly!</return></ns2:helloResponse></soap:Body></soap:Envelope>")) | ||
.anyMatch(msg -> msg.contains( | ||
"Payload: <soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" | ||
+ " <soap:Body>\n" | ||
+ " <ns2:hello xmlns:ns2=\"http://deployment.logging.features.cxf.quarkiverse.io/\">\n" | ||
+ " <arg0>Dolly</arg0>\n" | ||
+ " </ns2:hello>\n" | ||
+ " </soap:Body>\n" | ||
+ "</soap:Envelope>")) | ||
.anyMatch(msg -> msg.contains( | ||
"Payload: <soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" | ||
+ " <soap:Body>\n" | ||
+ " <ns2:helloResponse xmlns:ns2=\"http://deployment.logging.features.cxf.quarkiverse.io/\">\n" | ||
+ " <return>Hello Dolly!</return>\n" | ||
+ " </ns2:helloResponse>\n" | ||
+ " </soap:Body>\n" | ||
+ "</soap:Envelope>")) | ||
.hasSize(4)); | ||
|
||
@CXFClient("hello") | ||
HelloService helloService; | ||
|
||
@Test | ||
void payloadPrettyLogged() throws IOException { | ||
|
||
helloService.hello("Dolly"); | ||
|
||
} | ||
|
||
} |
61 changes: 61 additions & 0 deletions
61
...est/java/io/quarkiverse/cxf/deployment/logging/GlobalClientsLoggingConfigurationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package io.quarkiverse.cxf.deployment.logging; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.io.IOException; | ||
import java.util.logging.LogRecord; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkiverse.cxf.annotation.CXFClient; | ||
import io.quarkiverse.cxf.test.QuarkusCxfClientTestUtil; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
/** | ||
* A global logging feature configured in {@code application.properties}. | ||
*/ | ||
public class GlobalClientsLoggingConfigurationTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest TEST = new QuarkusUnitTest() | ||
.withApplicationRoot( | ||
root -> root.addClasses(HelloService.class, HelloServiceImpl.class)) | ||
.overrideConfigKey("quarkus.cxf.logging.enabled-for", "clients") | ||
.overrideConfigKey("quarkus.cxf.logging.pretty", "true") | ||
.overrideConfigKey("quarkus.cxf.endpoint.\"/hello\".implementor", HelloServiceImpl.class.getName()) | ||
.overrideConfigKey("quarkus.cxf.client.hello.service-interface", HelloService.class.getName()) | ||
.overrideConfigKey("quarkus.cxf.client.hello.client-endpoint-url", "http://localhost:8081/services/hello") | ||
|
||
.setLogRecordPredicate(logRecord -> logRecord.getLoggerName().contains("org.apache.cxf.services.HelloService.RE")) // REQ_IN or RESP_OUT | ||
.assertLogRecords(records -> assertThat(records) | ||
.extracting(LogRecord::getMessage) | ||
.anyMatch(QuarkusCxfClientTestUtil.messageExists("REQ_OUT", | ||
"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" | ||
+ " <soap:Body>\n" | ||
+ " <ns2:hello xmlns:ns2=\"http://deployment.logging.features.cxf.quarkiverse.io/\">\n" | ||
+ " <arg0>Dolly</arg0>\n" | ||
+ " </ns2:hello>\n" | ||
+ " </soap:Body>\n" | ||
+ "</soap:Envelope>\n")) | ||
.anyMatch(QuarkusCxfClientTestUtil.messageExists("RESP_IN", | ||
"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" | ||
+ " <soap:Body>\n" | ||
+ " <ns2:helloResponse xmlns:ns2=\"http://deployment.logging.features.cxf.quarkiverse.io/\">\n" | ||
+ " <return>Hello Dolly!</return>\n" | ||
+ " </ns2:helloResponse>\n" | ||
+ " </soap:Body>\n" | ||
+ "</soap:Envelope>\n")) | ||
.hasSize(2)); | ||
|
||
@CXFClient("hello") | ||
HelloService helloService; | ||
|
||
@Test | ||
void payloadPrettyLogged() throws IOException { | ||
|
||
helloService.hello("Dolly"); | ||
|
||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
...t/src/test/java/io/quarkiverse/cxf/deployment/logging/GlobalLoggingConfigurationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
package io.quarkiverse.cxf.deployment.logging; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
Check the following chapters of xref:user-guide/index.adoc[User guide]: | ||
There are several chapters in the xref:user-guide/index.adoc[User guide] covering the usage of this extension: | ||
|
||
** xref:user-guide/first-soap-web-service.adoc[Your first SOAP Web service] | ||
** xref:user-guide/first-soap-client.adoc[Your first SOAP Client] | ||
** xref:user-guide/payload-logging.adoc[Payload logging] | ||
* xref:user-guide/first-soap-web-service.adoc[Your first SOAP Web service] | ||
* xref:user-guide/first-soap-client.adoc[Your first SOAP Client] | ||
* xref:user-guide/configuration.adoc[Configuration] | ||
* xref:user-guide/package-for-jvm-and-native.adoc[Package for JVM and native] | ||
* xref:user-guide/payload-logging.adoc[Logging] | ||
* xref:user-guide/ssl.adoc[SSL] | ||
* xref:user-guide/auth.adoc[Authentication and authorization] | ||
* xref:user-guide/advanced-soap-client-topics.adoc[Advanced SOAP client topics] | ||
* xref:user-guide/advanced-soap-server-topics.adoc[Advanced SOAP server topics] | ||
* xref:user-guide/generate-java-from-wsdl.adoc[Generate Java from WSDL] | ||
* xref:user-guide/generate-wsdl-from-java.adoc[Generate WSDL from Java] | ||
* xref:user-guide/contract-first-code-first.adoc[Contract first and code first] | ||
* xref:user-guide/cxf-interceptors-and-features.adoc[CXF Interceptors and Features] | ||
* xref:user-guide/jax-ws-handlers.adoc[JAX-WS Handlers] | ||
* xref:user-guide/jax-ws-providers.adoc[JAX-WS Providers] | ||
* xref:user-guide/supported-soap-binding.adoc[Supported SOAP Bindings] | ||
* xref:user-guide/examples.adoc[Examples] | ||
* xref:user-guide/common-problems-troubleshooting.adoc[Common problems and troubleshooting] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.