Java Code Examples for org.springframework.tests.sample.beans.GenericBean#setListOfLists()

The following examples show how to use org.springframework.tests.sample.beans.GenericBean#setListOfLists() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BeanWrapperGenericsTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void testGenericListOfLists() throws MalformedURLException {
	GenericBean<String> gb = new GenericBean<>();
	List<List<Integer>> list = new LinkedList<>();
	list.add(new LinkedList<>());
	gb.setListOfLists(list);
	BeanWrapper bw = new BeanWrapperImpl(gb);
	bw.setPropertyValue("listOfLists[0][0]", new Integer(5));
	assertEquals(new Integer(5), bw.getPropertyValue("listOfLists[0][0]"));
	assertEquals(new Integer(5), gb.getListOfLists().get(0).get(0));
}
 
Example 2
Source File: BeanWrapperGenericsTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void testGenericListOfListsWithElementConversion() throws MalformedURLException {
	GenericBean<String> gb = new GenericBean<>();
	List<List<Integer>> list = new LinkedList<>();
	list.add(new LinkedList<>());
	gb.setListOfLists(list);
	BeanWrapper bw = new BeanWrapperImpl(gb);
	bw.setPropertyValue("listOfLists[0][0]", "5");
	assertEquals(new Integer(5), bw.getPropertyValue("listOfLists[0][0]"));
	assertEquals(new Integer(5), gb.getListOfLists().get(0).get(0));
}
 
Example 3
Source File: BeanWrapperGenericsTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void testGenericListOfLists() throws MalformedURLException {
	GenericBean<String> gb = new GenericBean<>();
	List<List<Integer>> list = new LinkedList<>();
	list.add(new LinkedList<>());
	gb.setListOfLists(list);
	BeanWrapper bw = new BeanWrapperImpl(gb);
	bw.setPropertyValue("listOfLists[0][0]", new Integer(5));
	assertEquals(new Integer(5), bw.getPropertyValue("listOfLists[0][0]"));
	assertEquals(new Integer(5), gb.getListOfLists().get(0).get(0));
}
 
Example 4
Source File: BeanWrapperGenericsTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void testGenericListOfListsWithElementConversion() throws MalformedURLException {
	GenericBean<String> gb = new GenericBean<>();
	List<List<Integer>> list = new LinkedList<>();
	list.add(new LinkedList<>());
	gb.setListOfLists(list);
	BeanWrapper bw = new BeanWrapperImpl(gb);
	bw.setPropertyValue("listOfLists[0][0]", "5");
	assertEquals(new Integer(5), bw.getPropertyValue("listOfLists[0][0]"));
	assertEquals(new Integer(5), gb.getListOfLists().get(0).get(0));
}
 
Example 5
Source File: BeanWrapperGenericsTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void testGenericListOfLists() throws MalformedURLException {
	GenericBean<String> gb = new GenericBean<String>();
	List<List<Integer>> list = new LinkedList<List<Integer>>();
	list.add(new LinkedList<Integer>());
	gb.setListOfLists(list);
	BeanWrapper bw = new BeanWrapperImpl(gb);
	bw.setPropertyValue("listOfLists[0][0]", new Integer(5));
	assertEquals(new Integer(5), bw.getPropertyValue("listOfLists[0][0]"));
	assertEquals(new Integer(5), gb.getListOfLists().get(0).get(0));
}
 
Example 6
Source File: BeanWrapperGenericsTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void testGenericListOfListsWithElementConversion() throws MalformedURLException {
	GenericBean<String> gb = new GenericBean<String>();
	List<List<Integer>> list = new LinkedList<List<Integer>>();
	list.add(new LinkedList<Integer>());
	gb.setListOfLists(list);
	BeanWrapper bw = new BeanWrapperImpl(gb);
	bw.setPropertyValue("listOfLists[0][0]", "5");
	assertEquals(new Integer(5), bw.getPropertyValue("listOfLists[0][0]"));
	assertEquals(new Integer(5), gb.getListOfLists().get(0).get(0));
}