Java Code Examples for org.springframework.tests.sample.beans.GenericBean#setListOfMaps()
The following examples show how to use
org.springframework.tests.sample.beans.GenericBean#setListOfMaps() .
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 |
@Test public void testGenericListOfMaps() throws MalformedURLException { GenericBean<String> gb = new GenericBean<>(); List<Map<Integer, Long>> list = new LinkedList<>(); list.add(new HashMap<>()); gb.setListOfMaps(list); BeanWrapper bw = new BeanWrapperImpl(gb); bw.setPropertyValue("listOfMaps[0][10]", new Long(5)); assertEquals(new Long(5), bw.getPropertyValue("listOfMaps[0][10]")); assertEquals(new Long(5), gb.getListOfMaps().get(0).get(10)); }
Example 2
Source File: BeanWrapperGenericsTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void testGenericListOfMapsWithElementConversion() throws MalformedURLException { GenericBean<String> gb = new GenericBean<>(); List<Map<Integer, Long>> list = new LinkedList<>(); list.add(new HashMap<>()); gb.setListOfMaps(list); BeanWrapper bw = new BeanWrapperImpl(gb); bw.setPropertyValue("listOfMaps[0][10]", "5"); assertEquals(new Long(5), bw.getPropertyValue("listOfMaps[0][10]")); assertEquals(new Long(5), gb.getListOfMaps().get(0).get(10)); }
Example 3
Source File: BeanWrapperGenericsTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void testGenericListOfMaps() throws MalformedURLException { GenericBean<String> gb = new GenericBean<>(); List<Map<Integer, Long>> list = new LinkedList<>(); list.add(new HashMap<>()); gb.setListOfMaps(list); BeanWrapper bw = new BeanWrapperImpl(gb); bw.setPropertyValue("listOfMaps[0][10]", new Long(5)); assertEquals(new Long(5), bw.getPropertyValue("listOfMaps[0][10]")); assertEquals(new Long(5), gb.getListOfMaps().get(0).get(10)); }
Example 4
Source File: BeanWrapperGenericsTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void testGenericListOfMapsWithElementConversion() throws MalformedURLException { GenericBean<String> gb = new GenericBean<>(); List<Map<Integer, Long>> list = new LinkedList<>(); list.add(new HashMap<>()); gb.setListOfMaps(list); BeanWrapper bw = new BeanWrapperImpl(gb); bw.setPropertyValue("listOfMaps[0][10]", "5"); assertEquals(new Long(5), bw.getPropertyValue("listOfMaps[0][10]")); assertEquals(new Long(5), gb.getListOfMaps().get(0).get(10)); }
Example 5
Source File: BeanWrapperGenericsTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Test public void testGenericListOfMaps() throws MalformedURLException { GenericBean<String> gb = new GenericBean<String>(); List<Map<Integer, Long>> list = new LinkedList<Map<Integer, Long>>(); list.add(new HashMap<Integer, Long>()); gb.setListOfMaps(list); BeanWrapper bw = new BeanWrapperImpl(gb); bw.setPropertyValue("listOfMaps[0][10]", new Long(5)); assertEquals(new Long(5), bw.getPropertyValue("listOfMaps[0][10]")); assertEquals(new Long(5), gb.getListOfMaps().get(0).get(10)); }
Example 6
Source File: BeanWrapperGenericsTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Test public void testGenericListOfMapsWithElementConversion() throws MalformedURLException { GenericBean<String> gb = new GenericBean<String>(); List<Map<Integer, Long>> list = new LinkedList<Map<Integer, Long>>(); list.add(new HashMap<Integer, Long>()); gb.setListOfMaps(list); BeanWrapper bw = new BeanWrapperImpl(gb); bw.setPropertyValue("listOfMaps[0][10]", "5"); assertEquals(new Long(5), bw.getPropertyValue("listOfMaps[0][10]")); assertEquals(new Long(5), gb.getListOfMaps().get(0).get(10)); }