[logback-dev] svn commit: r1894 - logback/trunk/logback-core/src/test/java/ch/qos/logback/core/joran/action

noreply.ceki at qos.ch noreply.ceki at qos.ch
Tue Oct 28 17:04:09 CET 2008


Author: ceki
Date: Tue Oct 28 17:04:09 2008
New Revision: 1894

Modified:
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/joran/action/PropertyActionTest.java

Log:
- small improvements to test case

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/joran/action/PropertyActionTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/joran/action/PropertyActionTest.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/joran/action/PropertyActionTest.java	Tue Oct 28 17:04:09 2008
@@ -14,6 +14,7 @@
 import ch.qos.logback.core.joran.spi.InterpretationContext;
 import ch.qos.logback.core.status.ErrorStatus;
 import ch.qos.logback.core.util.Constants;
+import ch.qos.logback.core.util.StatusPrinter;
 
 public class PropertyActionTest  {
 
@@ -38,7 +39,7 @@
   }
   
   @Test
-  public void testBegin() {
+  public void nameValuePair() {
     atts.setValue("name", "v1");
     atts.setValue("value", "work");
     spAction.begin(ec, null, atts);
@@ -46,7 +47,16 @@
   }
   
   @Test
-  public void testBeginNoValue() {
+  public void nameValuePairWithPrerequisiteSubsitution() {
+    context.putProperty("w", "wor");
+    atts.setValue("name", "v1");
+    atts.setValue("value", "${w}k");
+    spAction.begin(ec, null, atts);
+    assertEquals("work", ec.getSubstitutionProperty("v1"));
+  }
+  
+  @Test
+  public void noValue() {
     atts.setValue("name", "v1");
     spAction.begin(ec, null, atts);
     assertEquals(1, context.getStatusManager().getCount());
@@ -54,7 +64,7 @@
   }
 
   @Test
-  public void testBeginNoName() {
+  public void noName() {
     atts.setValue("value", "v1");
     spAction.begin(ec, null, atts);
     assertEquals(1, context.getStatusManager().getCount());
@@ -62,10 +72,11 @@
   }
   
   @Test
-  public void testBeginNothing() {
+  public void noAttributes() {
     spAction.begin(ec, null, atts);
     assertEquals(1, context.getStatusManager().getCount());
     assertTrue(checkError());
+    StatusPrinter.print(context);
   } 
   
   @Test


More information about the logback-dev mailing list