[logback-dev] svn commit: r896 - in logback/trunk: logback-classic/src/test/java/ch/qos/logback/classic logback-core/src/test/java/ch/qos/logback/core/pattern/parser
noreply.seb at qos.ch
noreply.seb at qos.ch
Fri Nov 10 19:03:28 CET 2006
Author: seb
Date: Fri Nov 10 19:03:27 2006
New Revision: 896
Modified:
logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/PatternLayoutTest.java
logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/AbstractPatternLayoutBaseTest.java
Log:
added a test method in PatternLayoutTest to test bug #29
Modified: logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/PatternLayoutTest.java
==============================================================================
--- logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/PatternLayoutTest.java (original)
+++ logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/PatternLayoutTest.java Fri Nov 10 19:03:27 2006
@@ -87,6 +87,18 @@
assertTrue(!val.contains("java.lang.Exception: Bogus exception"));
}
+ public void testWithParenthesis() {
+ PatternLayout pl = new PatternLayout();
+ pl.setPattern("(%msg:%msg) %msg");
+ Context context = new LoggerContext();
+ pl.setContext(context);
+ pl.start();
+ le = makeLoggingEvent(null);
+ String val = pl.doLayout(le);
+ //System.out.println("VAL == " + val);
+ assertEquals("(Some message:Some message) Some message", val);
+ }
+
public void testWithLettersComingFromLog4j() {
PatternLayout pl = new PatternLayout();
//Letters: p = level and c = logger
Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/AbstractPatternLayoutBaseTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/AbstractPatternLayoutBaseTest.java (original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/AbstractPatternLayoutBaseTest.java Fri Nov 10 19:03:27 2006
@@ -51,7 +51,7 @@
plb.start();
String result = plb.doLayout(getEventObject());
assertFalse(result.contains("%PARSER_ERROR_EX"));
- System.out.println("========="+result);
+ //System.out.println("========="+result);
}
public void testStarted() {
@@ -65,7 +65,7 @@
}
public void testNullPattern() {
- System.out.println("testNullPattern");
+ //System.out.println("testNullPattern");
PatternLayoutBase plb = getPatternLayoutBase();
Context context = new ContextBase();
plb.setContext(context);
@@ -73,7 +73,7 @@
String s = plb.doLayout(getEventObject());
assertEquals("", s);
StatusChecker checker = new StatusChecker(context.getStatusManager());
- StatusPrinter.print(context.getStatusManager());
+ //StatusPrinter.print(context.getStatusManager());
assertTrue(checker.containsMatch("Failed to parse pattern \"null\""));
}
More information about the logback-dev
mailing list