[logback-dev] svn commit: r1414 - logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util

noreply.seb at qos.ch noreply.seb at qos.ch
Thu Mar 8 15:35:19 CET 2007


Author: seb
Date: Thu Mar  8 15:35:19 2007
New Revision: 1414

Modified:
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java

Log:
Added a test case about bug 52


Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/util/PropertySetterTest.java	Thu Mar  8 15:35:19 2007
@@ -122,6 +122,14 @@
     setter.setProperty("fs", "2 kb");
     assertEquals(2*1024, house.getFs().getSize());
   }
+  
+  public void testEnum() {
+    //test case reproducing bug #52
+    House house = new House();
+    PropertySetter setter = new PropertySetter(house);
+    setter.setProperty("houseColor", "BLUE");
+    assertEquals(HouseColor.BLUE, house.getHouseColor());
+  }
 }
 
 class House {
@@ -133,6 +141,7 @@
   SwimmingPool pool;
   Duration duration;
   FileSize fs;
+  HouseColor houseColor;
   
   List<String> adjectiveList = new ArrayList<String>();
   List<Window> windowList = new ArrayList<Window>();
@@ -209,6 +218,14 @@
   public void setFs(FileSize fs) {
     this.fs = fs;
   }
+  
+  public void setHouseColor(String color) {
+    this.houseColor = HouseColor.valueOf(color);
+  }
+  
+  public HouseColor getHouseColor() {
+    return houseColor;
+  }
 }
 
 class Door {
@@ -224,3 +241,7 @@
   int width;
   int depth;
 }
+
+enum HouseColor {
+  WHITE, BLUE
+}



More information about the logback-dev mailing list