[LOG4J2-1620] .7-rc1: RollingFileAppender immediateFlush default value should be true, not false. Add tests.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/6bedc20e Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/6bedc20e Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/6bedc20e Branch: refs/heads/LOG4J2-1390 Commit: 6bedc20e375a54b7887ebff5b799f0612c314bf2 Parents: 003cada Author: Gary Gregory <ggreg...@apache.org> Authored: Thu Sep 29 12:17:21 2016 -0700 Committer: Gary Gregory <ggreg...@apache.org> Committed: Thu Sep 29 12:17:21 2016 -0700 ---------------------------------------------------------------------- .../appender/ConsoleAppenderBuilderTest.java | 31 +++++++++++++++++++ .../core/appender/FileAppenderBuilderTest.java | 31 +++++++++++++++++++ .../appender/SocketAppenderBuilderTest.java | 32 ++++++++++++++++++++ .../rolling/RollingFileAppenderBuilderTest.java | 32 ++++++++++++++++++++ 4 files changed, 126 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6bedc20e/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java new file mode 100644 index 0000000..2531a31 --- /dev/null +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache license, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the license for the specific language governing permissions and + * limitations under the license. + */ +package org.apache.logging.log4j.core.appender; + +import org.junit.Assert; +import org.junit.Test; + +public class ConsoleAppenderBuilderTest { + + /** + * Tests https://issues.apache.org/jira/browse/LOG4J2-1620 + */ + @Test + public void testDefaultImmediateFlush() { + Assert.assertTrue(ConsoleAppender.newBuilder().isImmediateFlush()); + } +} http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6bedc20e/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderBuilderTest.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderBuilderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderBuilderTest.java new file mode 100644 index 0000000..8305a07 --- /dev/null +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderBuilderTest.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache license, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the license for the specific language governing permissions and + * limitations under the license. + */ +package org.apache.logging.log4j.core.appender; + +import org.junit.Assert; +import org.junit.Test; + +public class FileAppenderBuilderTest { + + /** + * Tests https://issues.apache.org/jira/browse/LOG4J2-1620 + */ + @Test + public void testDefaultImmediateFlush() { + Assert.assertTrue(FileAppender.newBuilder().isImmediateFlush()); + } +} http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6bedc20e/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderBuilderTest.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderBuilderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderBuilderTest.java new file mode 100644 index 0000000..bdfd35a --- /dev/null +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderBuilderTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache license, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the license for the specific language governing permissions and + * limitations under the license. + */ +package org.apache.logging.log4j.core.appender; + +import org.apache.logging.log4j.core.appender.SocketAppender; +import org.junit.Assert; +import org.junit.Test; + +public class SocketAppenderBuilderTest { + + /** + * Tests https://issues.apache.org/jira/browse/LOG4J2-1620 + */ + @Test + public void testDefaultImmediateFlush() { + Assert.assertTrue(SocketAppender.newBuilder().isImmediateFlush()); + } +} http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6bedc20e/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderBuilderTest.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderBuilderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderBuilderTest.java new file mode 100644 index 0000000..4bf0dca --- /dev/null +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderBuilderTest.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache license, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the license for the specific language governing permissions and + * limitations under the license. + */ +package org.apache.logging.log4j.core.appender.rolling; + +import org.apache.logging.log4j.core.appender.RollingFileAppender; +import org.junit.Assert; +import org.junit.Test; + +public class RollingFileAppenderBuilderTest { + + /** + * Tests https://issues.apache.org/jira/browse/LOG4J2-1620 + */ + @Test + public void testDefaultImmediateFlush() { + Assert.assertTrue(RollingFileAppender.newBuilder().isImmediateFlush()); + } +}