@ -62,6 +62,28 @@ public class BindingPreparationTests {
@@ -62,6 +62,28 @@ public class BindingPreparationTests {
assertNotNull ( wrapper . getPropertyValue ( "nested[foo]" ) ) ;
}
@Test
public void testListOfBeansWithList ( ) throws Exception {
TargetWithNestedListOfBeansWithList target = new TargetWithNestedListOfBeansWithList ( ) ;
BeanWrapperImpl wrapper = new BeanWrapperImpl ( target ) ;
wrapper . setAutoGrowNestedPaths ( true ) ;
RelaxedDataBinder binder = new RelaxedDataBinder ( target ) ;
binder . normalizePath ( wrapper , "nested[0].list[1]" ) ;
assertNotNull ( wrapper . getPropertyValue ( "nested" ) ) ;
assertNotNull ( wrapper . getPropertyValue ( "nested[0].list[1]" ) ) ;
}
@Test
public void testListOfBeansWithListAndNoPeriod ( ) throws Exception {
TargetWithNestedListOfBeansWithList target = new TargetWithNestedListOfBeansWithList ( ) ;
BeanWrapperImpl wrapper = new BeanWrapperImpl ( target ) ;
wrapper . setAutoGrowNestedPaths ( true ) ;
RelaxedDataBinder binder = new RelaxedDataBinder ( target ) ;
binder . normalizePath ( wrapper , "nested[0]list[1]" ) ;
assertNotNull ( wrapper . getPropertyValue ( "nested" ) ) ;
assertNotNull ( wrapper . getPropertyValue ( "nested[0].list[1]" ) ) ;
}
@Test
public void testAutoGrowWithFuzzyNameCapitals ( ) throws Exception {
TargetWithNestedMap target = new TargetWithNestedMap ( ) ;
@ -259,6 +281,31 @@ public class BindingPreparationTests {
@@ -259,6 +281,31 @@ public class BindingPreparationTests {
}
}
public static class TargetWithNestedListOfBeansWithList {
private List < TargetWithList > nested ;
public List < TargetWithList > getNested ( ) {
return this . nested ;
}
public void setNested ( List < TargetWithList > nested ) {
this . nested = nested ;
}
}
public static class TargetWithList {
private List < VanillaTarget > list ;
public List < VanillaTarget > getList ( ) {
return this . list ;
}
public void setList ( List < VanillaTarget > list ) {
this . list = list ;
}
}
public static class TargetWithNestedMapOfBean {
private Map < String , VanillaTarget > nested ;