[logback-dev] svn commit: r735 - in logback/trunk/logback-core/src: main/java/ch/qos/logback/core/pattern test/java/ch/qos/logback/core/pattern/parser
noreply.ceki at qos.ch
noreply.ceki at qos.ch
Sat Oct 21 18:42:37 CEST 2006
Author: ceki
Date: Sat Oct 21 18:42:37 2006
New Revision: 735
Modified:
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/pattern/FormattingConverter.java
logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/FormatInfoTest.java
Log:
Licensing fix
Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/pattern/FormattingConverter.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/pattern/FormattingConverter.java (original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/pattern/FormattingConverter.java Sat Oct 21 18:42:37 2006
@@ -1,5 +1,5 @@
/**
- * LOGBack: the reliable, fast and flexible logging library for Java.
+ * Logback: the generic, reliable, fast and flexible logging framework.
*
* Copyright (C) 1999-2006, QOS.ch
*
Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/FormatInfoTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/FormatInfoTest.java (original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/FormatInfoTest.java Sat Oct 21 18:42:37 2006
@@ -1,3 +1,13 @@
+/**
+ * Logback: the generic, reliable, fast and flexible logging framework.
+ *
+ * Copyright (C) 1999-2006, QOS.ch
+ *
+ * This library is free software, you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation.
+ */
+
package ch.qos.logback.core.pattern.parser;
import ch.qos.logback.core.pattern.FormatInfo;
@@ -6,97 +16,95 @@
public class FormatInfoTest extends TestCase {
- public void testEndingInDot() {
- try {
- FormatInfo.valueOf("45.");
- fail("45. is not a valid format info string");
- } catch (IllegalArgumentException iae) {
- // OK
- }
- }
-
- public void testBasic() {
- {
- FormatInfo fi = FormatInfo.valueOf("45");
- FormatInfo witness = new FormatInfo();
- witness.setMin(45);
- assertEquals(witness, fi);
- }
-
- {
- FormatInfo fi = FormatInfo.valueOf("4.5");
- FormatInfo witness = new FormatInfo();
- witness.setMin(4);
- witness.setMax(5);
- assertEquals(witness, fi);
- }
- }
-
-
-
- public void testRightPad() {
- {
- FormatInfo fi = FormatInfo.valueOf("-40");
- FormatInfo witness = new FormatInfo();
- witness.setMin(40);
- witness.setLeftPad(false);
- assertEquals(witness, fi);
- }
-
- {
- FormatInfo fi = FormatInfo.valueOf("-12.5");
- FormatInfo witness = new FormatInfo();
- witness.setMin(12);
- witness.setMax(5);
- witness.setLeftPad(false);
- assertEquals(witness, fi);
- }
-
- {
- FormatInfo fi = FormatInfo.valueOf("-14.-5");
- FormatInfo witness = new FormatInfo();
- witness.setMin(14);
- witness.setMax(5);
- witness.setLeftPad(false);
- witness.setLeftTruncate(false);
- assertEquals(witness, fi);
- }
- }
-
- public void testMinOnly() {
- {
- FormatInfo fi = FormatInfo.valueOf("49");
- FormatInfo witness = new FormatInfo();
- witness.setMin(49);
- assertEquals(witness, fi);
- }
-
- {
- FormatInfo fi = FormatInfo.valueOf("-587");
- FormatInfo witness = new FormatInfo();
- witness.setMin(587);
- witness.setLeftPad(false);
- assertEquals(witness, fi);
- }
-
- }
-
- public void testMaxOnly() {
- {
- FormatInfo fi = FormatInfo.valueOf(".49");
- FormatInfo witness = new FormatInfo();
- witness.setMax(49);
- assertEquals(witness, fi);
- }
-
- {
- FormatInfo fi = FormatInfo.valueOf(".-5");
- FormatInfo witness = new FormatInfo();
- witness.setMax(5);
- witness.setLeftTruncate(false);
- assertEquals(witness, fi);
- }
-
- }
+ public void testEndingInDot() {
+ try {
+ FormatInfo.valueOf("45.");
+ fail("45. is not a valid format info string");
+ } catch (IllegalArgumentException iae) {
+ // OK
+ }
+ }
+
+ public void testBasic() {
+ {
+ FormatInfo fi = FormatInfo.valueOf("45");
+ FormatInfo witness = new FormatInfo();
+ witness.setMin(45);
+ assertEquals(witness, fi);
+ }
+
+ {
+ FormatInfo fi = FormatInfo.valueOf("4.5");
+ FormatInfo witness = new FormatInfo();
+ witness.setMin(4);
+ witness.setMax(5);
+ assertEquals(witness, fi);
+ }
+ }
+
+ public void testRightPad() {
+ {
+ FormatInfo fi = FormatInfo.valueOf("-40");
+ FormatInfo witness = new FormatInfo();
+ witness.setMin(40);
+ witness.setLeftPad(false);
+ assertEquals(witness, fi);
+ }
+
+ {
+ FormatInfo fi = FormatInfo.valueOf("-12.5");
+ FormatInfo witness = new FormatInfo();
+ witness.setMin(12);
+ witness.setMax(5);
+ witness.setLeftPad(false);
+ assertEquals(witness, fi);
+ }
+
+ {
+ FormatInfo fi = FormatInfo.valueOf("-14.-5");
+ FormatInfo witness = new FormatInfo();
+ witness.setMin(14);
+ witness.setMax(5);
+ witness.setLeftPad(false);
+ witness.setLeftTruncate(false);
+ assertEquals(witness, fi);
+ }
+ }
+
+ public void testMinOnly() {
+ {
+ FormatInfo fi = FormatInfo.valueOf("49");
+ FormatInfo witness = new FormatInfo();
+ witness.setMin(49);
+ assertEquals(witness, fi);
+ }
+
+ {
+ FormatInfo fi = FormatInfo.valueOf("-587");
+ FormatInfo witness = new FormatInfo();
+ witness.setMin(587);
+ witness.setLeftPad(false);
+ assertEquals(witness, fi);
+ }
+
+ }
+
+ public void testMaxOnly() {
+ {
+ FormatInfo fi = FormatInfo.valueOf(".49");
+ FormatInfo witness = new FormatInfo();
+ witness.setMax(49);
+ assertEquals(witness, fi);
+ }
+
+ {
+ FormatInfo fi = FormatInfo.valueOf(".-5");
+ FormatInfo witness = new FormatInfo();
+ witness.setMax(5);
+ witness.setLeftTruncate(false);
+ assertEquals(witness, fi);
+ }
+
+ }
}
\ No newline at end of file
More information about the logback-dev
mailing list