Revision: 1743
          http://svn.sourceforge.net/spring-rich-c/?rev=1743&view=rev
Author:   jhoskens
Date:     2007-04-10 02:17:10 -0700 (Tue, 10 Apr 2007)

Log Message:
-----------
metadata test changed according to spring-beans 2.0, different handling of 
nested null properties.

Modified Paths:
--------------
    
trunk/spring-richclient/support/src/test/java/org/springframework/binding/support/BeanPropertyAccessStrategyTests.java

Modified: 
trunk/spring-richclient/support/src/test/java/org/springframework/binding/support/BeanPropertyAccessStrategyTests.java
===================================================================
--- 
trunk/spring-richclient/support/src/test/java/org/springframework/binding/support/BeanPropertyAccessStrategyTests.java
      2007-04-09 18:31:56 UTC (rev 1742)
+++ 
trunk/spring-richclient/support/src/test/java/org/springframework/binding/support/BeanPropertyAccessStrategyTests.java
      2007-04-10 09:17:10 UTC (rev 1743)
@@ -277,6 +277,9 @@
         }
     }
     
+    /**
+     * Test the metadata on type/readability/writeability.
+     */
     public void testMetaData() {
         PropertyMetadataAccessStrategy mas = pas.getMetadataAccessStrategy();
         
@@ -285,22 +288,20 @@
         assertPropertyMetadata(mas, "listProperty", List.class, true, true);
         assertPropertyMetadata(mas, "readOnly", Object.class, true, false);
         assertPropertyMetadata(mas, "writeOnly", Object.class, false, true);   
     
-        
-        try {
-            assertPropertyMetadata(mas, "nestedProperty.simpleProperty", 
String.class, true, true);
-            fail("should have thrown NullValueInNestedPathException");
-        } catch(NullValueInNestedPathException e) {
-            // expected
-        }        
+
+        // test nested property
+        // when null, no type, not readable, not writeable
+        assertPropertyMetadata(mas, "nestedProperty.simpleProperty", null, 
false, false);
         final TestBean nestedProperty = new TestBean();
         testBean.setNestedProperty(nestedProperty);
+        // when provided, type/readable/writeable deducted from nested object
         assertPropertyMetadata(mas, "nestedProperty.simpleProperty", 
String.class, true, true);
         
-//          FIXME: this test should pass.        
-//        final Map map = new HashMap();
-//        testBean.setMapProperty(map);
-//        map.put(".key", new Integer(1));        
-//        assertPropertyMetadata(mas, "mapProperty[.key]", String.class, true, 
true);
+        // test access to map
+        final Map map = new HashMap();
+        testBean.setMapProperty(map);
+        map.put("key", new Integer(1));        
+        assertPropertyMetadata(mas, "mapProperty[key]", Integer.class, true, 
true);
     }
 
     private void assertPropertyMetadata(PropertyMetadataAccessStrategy mas, 
String property, Class type, boolean isReadable, boolean isWriteable) {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
spring-rich-c-cvs mailing list
spring-rich-c-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spring-rich-c-cvs

Reply via email to