From 7eba134142d78ded3e8524cdbc121e514ec1c0d4 Mon Sep 17 00:00:00 2001 From: "Nuno M. Santos" Date: Mon, 14 Mar 2022 03:29:18 +0000 Subject: [PATCH 1/3] Modify existing test to show parameterization of logging delimiter not working as expected Relates to issue #4734 and pull request #4745 --- .../jersey/tests/e2e/common/LoggingFeatureTest.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/LoggingFeatureTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/LoggingFeatureTest.java index b85b8dfbd1..4eefcb5c73 100644 --- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/LoggingFeatureTest.java +++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/LoggingFeatureTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -266,14 +266,12 @@ public void testLoggingFeatureBuilderSeparator() { } - @Test + @Test(expected = AssertionError.class) public void testLoggingFeatureBuilderProperty() { final Response response = target("/text") - .register(LoggingFeature - .builder() - .withLogger(Logger.getLogger(LOGGER_NAME)) - .build() - ).property(LoggingFeature.LOGGING_FEATURE_SEPARATOR, SEPARATOR) + .register(LoggingFeature.class) + .property(LoggingFeature.LOGGING_FEATURE_LOGGER_NAME, LOGGER_NAME) + .property(LoggingFeature.LOGGING_FEATURE_SEPARATOR, SEPARATOR) .request() .post(Entity.text(ENTITY)); From 30240fc45b100fb4788caa8ef751cec3173115ad Mon Sep 17 00:00:00 2001 From: "Nuno M. Santos" Date: Mon, 14 Mar 2022 03:32:11 +0000 Subject: [PATCH 2/3] Fix failing test Relates to issue #4734 and pull request #4745 --- .../main/java/org/glassfish/jersey/logging/LoggingFeature.java | 3 +-- .../glassfish/jersey/tests/e2e/common/LoggingFeatureTest.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeature.java b/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeature.java index e6ed421d5f..7ef1068a34 100644 --- a/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeature.java +++ b/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeature.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -222,7 +222,6 @@ public LoggingFeature(Logger logger, Level level, Verbosity verbosity, Integer m .level(level) .verbosity(verbosity) .maxEntitySize(maxEntitySize) - .separator(DEFAULT_SEPARATOR) ); } diff --git a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/LoggingFeatureTest.java b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/LoggingFeatureTest.java index 4eefcb5c73..8e5feb5713 100644 --- a/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/LoggingFeatureTest.java +++ b/tests/e2e/src/test/java/org/glassfish/jersey/tests/e2e/common/LoggingFeatureTest.java @@ -266,7 +266,7 @@ public void testLoggingFeatureBuilderSeparator() { } - @Test(expected = AssertionError.class) + @Test public void testLoggingFeatureBuilderProperty() { final Response response = target("/text") .register(LoggingFeature.class) From 24231e4348290b45e8c06182d5d8e1b8adec338d Mon Sep 17 00:00:00 2001 From: "Nuno M. Santos" Date: Mon, 14 Mar 2022 10:26:40 +0000 Subject: [PATCH 3/3] Fix documentation --- .../main/java/org/glassfish/jersey/logging/LoggingFeature.java | 1 + docs/src/main/docbook/jersey.ent | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeature.java b/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeature.java index 7ef1068a34..f9b4d51a5d 100644 --- a/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeature.java +++ b/core-common/src/main/java/org/glassfish/jersey/logging/LoggingFeature.java @@ -49,6 +49,7 @@ *
  • logger level: {@link Level#FINE}
  • *
  • verbosity: {@link Verbosity#PAYLOAD_TEXT}
  • *
  • maximum entity size: {@value #DEFAULT_MAX_ENTITY_SIZE}
  • + *
  • line separator: {@link #DEFAULT_SEPARATOR}
  • * *

    * Server configurable properties: diff --git a/docs/src/main/docbook/jersey.ent b/docs/src/main/docbook/jersey.ent index 9ebf17b6e5..1775c4c083 100644 --- a/docs/src/main/docbook/jersey.ent +++ b/docs/src/main/docbook/jersey.ent @@ -919,7 +919,7 @@ LoggingFeature.LOGGING_FEATURE_LOGGER_LEVEL_CLIENT"> LoggingFeature.LOGGING_FEATURE_VERBOSITY_CLIENT"> LoggingFeature.LOGGING_FEATURE_MAX_ENTITY_SIZE_CLIENT"> -LoggingFeature.LOGGING_FEATURE_SEPARATORE_CLIENT"> +LoggingFeature.LOGGING_FEATURE_SEPARATOR_CLIENT"> LoggingFeature.LOGGING_FEATURE_LOGGER_NAME_SERVER"> LoggingFeature.LOGGING_FEATURE_LOGGER_LEVEL_SERVER"> LoggingFeature.LOGGING_FEATURE_VERBOSITY_SERVER">