From 508b6798ff27df492710532b4745ba2feb0c02de Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 11 Sep 2019 17:20:38 +0100 Subject: [PATCH] Move jmx.log beneath build/ to avoid UP-TO-DATE pollution Previously, some tests in spring-context wrote a file named jmx.log into spring-context/. This led to the file being included in the sources of the Checkstyle NoHTTP Gradle task, breaking that task's UP-TO-DATE checks and causing it to execute unnecessarily. This commit updates the tests to write the jmx.log file beneath spring-context/build/ so that it is not included in the sources of the Checkstyle NoHTTP task. Closes gh-23623 --- .../src/test/java/org/springframework/jmx/JmxTestBean.java | 2 +- .../jmx/export/annotation/AnnotationTestBean.java | 2 +- .../jmx/export/assembler/AbstractMetadataAssemblerTests.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java b/spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java index 32a9eec11a..ccd3fb0c82 100644 --- a/spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java +++ b/spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java @@ -21,7 +21,7 @@ import java.io.IOException; /** * @@org.springframework.jmx.export.metadata.ManagedResource * (description="My Managed Bean", objectName="spring:bean=test", - * log=true, logFile="jmx.log", currencyTimeLimit=15, persistPolicy="OnUpdate", + * log=true, logFile="build/jmx.log", currencyTimeLimit=15, persistPolicy="OnUpdate", * persistPeriod=200, persistLocation="./foo", persistName="bar.jmx") * @@org.springframework.jmx.export.metadata.ManagedNotification * (name="My Notification", description="A Notification", notificationType="type.foo,type.bar") diff --git a/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBean.java b/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBean.java index dfcf0bb232..db38feb2be 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBean.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBean.java @@ -26,7 +26,7 @@ import org.springframework.stereotype.Service; */ @Service("testBean") @ManagedResource(objectName = "bean:name=testBean4", description = "My Managed Bean", log = true, - logFile = "jmx.log", currencyTimeLimit = 15, persistPolicy = "OnUpdate", persistPeriod = 200, + logFile = "build/jmx.log", currencyTimeLimit = 15, persistPolicy = "OnUpdate", persistPeriod = 200, persistLocation = "./foo", persistName = "bar.jmx") @ManagedNotification(name = "My Notification", notificationTypes = { "type.foo", "type.bar" }) public class AnnotationTestBean implements IJmxTestBean { diff --git a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerTests.java b/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerTests.java index 45a1bbeea7..9c979c3e99 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractMetadataAssemblerTests.java @@ -112,7 +112,7 @@ public abstract class AbstractMetadataAssemblerTests extends AbstractJmxAssemble Descriptor desc = info.getMBeanDescriptor(); assertThat(desc.getFieldValue("log")).as("Logging should be set to true").isEqualTo("true"); - assertThat(desc.getFieldValue("logFile")).as("Log file should be jmx.log").isEqualTo("jmx.log"); + assertThat(desc.getFieldValue("logFile")).as("Log file should be build/jmx.log").isEqualTo("build/jmx.log"); assertThat(desc.getFieldValue("currencyTimeLimit")).as("Currency Time Limit should be 15").isEqualTo("15"); assertThat(desc.getFieldValue("persistPolicy")).as("Persist Policy should be OnUpdate").isEqualTo("OnUpdate"); assertThat(desc.getFieldValue("persistPeriod")).as("Persist Period should be 200").isEqualTo("200");