[LOGBack-dev] svn commit: r274 - logback/core/trunk/src/test/java/ch/qos/logback/core/status

noreply.seb at qos.ch noreply.seb at qos.ch
Tue Jul 25 14:34:46 CEST 2006


Author: seb
Date: Tue Jul 25 14:34:44 2006
New Revision: 274

Modified:
   logback/core/trunk/src/test/java/ch/qos/logback/core/status/StatusBaseTest.java
Log:
added tests for getEffectiveLevel()

Modified: logback/core/trunk/src/test/java/ch/qos/logback/core/status/StatusBaseTest.java
==============================================================================
--- logback/core/trunk/src/test/java/ch/qos/logback/core/status/StatusBaseTest.java	(original)
+++ logback/core/trunk/src/test/java/ch/qos/logback/core/status/StatusBaseTest.java	Tue Jul 25 14:34:44 2006
@@ -47,5 +47,33 @@
 			assertFalse("Remove result was not false", result);
 		}
 	}
+	
+	public void testEffectiveLevel() {
+		{
+			//effective level = 0 level deep
+			ErrorStatus status = new ErrorStatus("error", this);
+			WarnStatus warn = new WarnStatus("warning", this);
+			status.add(warn);
+			assertEquals("effective level misevaluated", status.getEffectiveLevel(), Status.ERROR);
+		}
+		
+		{
+			//effective level = 1 level deep
+			InfoStatus status = new InfoStatus("info", this);
+			WarnStatus warn = new WarnStatus("warning", this);
+			status.add(warn);
+			assertEquals("effective level misevaluated", status.getEffectiveLevel(), Status.WARN);
+		}
+		
+		{
+			//effective level = 2 levels deep
+			InfoStatus status = new InfoStatus("info", this);
+			WarnStatus warn = new WarnStatus("warning", this);
+			ErrorStatus error = new ErrorStatus("error", this);
+			status.add(warn);
+			warn.add(error);
+			assertEquals("effective level misevaluated", status.getEffectiveLevel(), Status.ERROR);
+		}
+	}
 
 }



More information about the logback-dev mailing list