[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v0.9.18-53-g0b234ba

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Wed Mar 3 12:46:19 CET 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".

The branch, master has been updated
       via  0b234ba87bac07b450a46fd472e233c9e181f4ec (commit)
      from  650b73413e7b5aa4b0ef2fb59f0e3187c68b0554 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=0b234ba87bac07b450a46fd472e233c9e181f4ec
http://github.com/ceki/logback/commit/0b234ba87bac07b450a46fd472e233c9e181f4ec

commit 0b234ba87bac07b450a46fd472e233c9e181f4ec
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Wed Mar 3 12:45:21 2010 +0100

    - testing the error status code emitted by OutputStreamAppender when a layout is set instead of an encoder

diff --git a/logback-classic/src/test/input/joran/compatibility/layoutInsteadOfEncoder.xml b/logback-classic/src/test/input/joran/compatibility/layoutInsteadOfEncoder.xml
new file mode 100644
index 0000000..a50b1da
--- /dev/null
+++ b/logback-classic/src/test/input/joran/compatibility/layoutInsteadOfEncoder.xml
@@ -0,0 +1,15 @@
+<configuration>
+
+  <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+    <file>target/test-output/layoutInsteadOfEncoder.log</file>
+    <append>true</append>
+                
+    <layout class="ch.qos.logback.classic.PatternLayout">
+      <pattern>%msg%n</pattern>
+    </layout>
+  </appender>
+        
+  <root level="debug">
+    <appender-ref ref="FILE" />
+  </root>
+</configuration>
\ No newline at end of file
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/encoder/LayoutInsteadOfEncoderTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/encoder/LayoutInsteadOfEncoderTest.java
new file mode 100644
index 0000000..f19db29
--- /dev/null
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/encoder/LayoutInsteadOfEncoderTest.java
@@ -0,0 +1,40 @@
+package ch.qos.logback.classic.encoder;
+
+import static ch.qos.logback.core.CoreConstants.CODES_URL;
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import ch.qos.logback.classic.ClassicTestConstants;
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.joran.JoranConfigurator;
+import ch.qos.logback.core.joran.spi.JoranException;
+import ch.qos.logback.core.status.Status;
+import ch.qos.logback.core.status.StatusChecker;
+import ch.qos.logback.core.util.StatusPrinter;
+
+public class LayoutInsteadOfEncoderTest {
+
+  // TeztConstants.TEST_DIR_PREFIX + "input/joran/ignore.xml"
+  JoranConfigurator jc = new JoranConfigurator();
+  LoggerContext loggerContext = new LoggerContext();
+
+  @Before
+  public void setUp() {
+    jc.setContext(loggerContext);
+
+  }
+
+  // jc.doConfigure(TeztConstants.TEST_DIR_PREFIX + "input/joran/ignore.xml");
+
+  @Test
+  public void layoutInsteadOfEncoer() throws JoranException {
+    jc.doConfigure(ClassicTestConstants.JORAN_INPUT_PREFIX
+        + "compatibility/layoutInsteadOfEncoder.xml");
+    StatusPrinter.print(loggerContext);
+    StatusChecker checker = new StatusChecker(loggerContext);
+    assertTrue(checker.containsMatch(Status.ERROR, "This appender no longer admits a layout as a sub-component"));
+    assertTrue(checker.containsMatch(Status.ERROR, "See also "+CODES_URL+"#layoutInsteadOfEncoder for details"));
+  }
+}

-----------------------------------------------------------------------

Summary of changes:
 .../joran/compatibility/layoutInsteadOfEncoder.xml |   15 +++++++
 .../encoder/LayoutInsteadOfEncoderTest.java        |   40 ++++++++++++++++++++
 2 files changed, 55 insertions(+), 0 deletions(-)
 create mode 100644 logback-classic/src/test/input/joran/compatibility/layoutInsteadOfEncoder.xml
 create mode 100644 logback-classic/src/test/java/ch/qos/logback/classic/encoder/LayoutInsteadOfEncoderTest.java


hooks/post-receive
-- 
Logback: the generic, reliable, fast and flexible logging framework.


More information about the logback-dev mailing list