Commit 8c3cb511 authored by Dave Syer's avatar Dave Syer

Add extra test for nested list binding

parent 620e98ce
...@@ -235,6 +235,14 @@ public class RelaxedDataBinderTests { ...@@ -235,6 +235,14 @@ public class RelaxedDataBinderTests {
assertEquals("[bar, foo]", target.getNested().toString()); assertEquals("[bar, foo]", target.getNested().toString());
} }
@Test
public void testBindDoubleNestedReadOnlyListIndexed() throws Exception {
TargetWithReadOnlyDoubleNestedList target = new TargetWithReadOnlyDoubleNestedList();
this.conversionService = new DefaultConversionService();
bind(target, "bean.nested[0]:bar\nbean.nested[1]:foo");
assertEquals("[bar, foo]", target.getBean().getNested().toString());
}
@Test @Test
public void testBindNestedReadOnlyCollectionIndexed() throws Exception { public void testBindNestedReadOnlyCollectionIndexed() throws Exception {
TargetWithReadOnlyNestedCollection target = new TargetWithReadOnlyNestedCollection(); TargetWithReadOnlyNestedCollection target = new TargetWithReadOnlyNestedCollection();
...@@ -561,6 +569,14 @@ public class RelaxedDataBinderTests { ...@@ -561,6 +569,14 @@ public class RelaxedDataBinderTests {
} }
} }
public static class TargetWithReadOnlyDoubleNestedList {
TargetWithReadOnlyNestedList bean = new TargetWithReadOnlyNestedList();
public TargetWithReadOnlyNestedList getBean() {
return this.bean;
}
}
public static class TargetWithReadOnlyNestedCollection { public static class TargetWithReadOnlyNestedCollection {
private final Collection<String> nested = new ArrayList<String>(); private final Collection<String> nested = new ArrayList<String>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment