Java Code Examples for org.springframework.tests.sample.beans.TestBean#getSomeMap()
The following examples show how to use
org.springframework.tests.sample.beans.TestBean#getSomeMap() .
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: UtilNamespaceHandlerTests.java From spring-analysis-note with MIT License | 6 votes |
@Test public void testNestedInCollections() { TestBean bean = (TestBean) this.beanFactory.getBean("nestedCustomTagBean"); List list = bean.getSomeList(); assertEquals(1, list.size()); assertEquals(Integer.MIN_VALUE, list.get(0)); Set set = bean.getSomeSet(); assertEquals(2, set.size()); assertTrue(set.contains(Thread.State.NEW)); assertTrue(set.contains(Thread.State.RUNNABLE)); Map map = bean.getSomeMap(); assertEquals(1, map.size()); assertEquals(CustomEnum.VALUE_1, map.get("min")); TestBean bean2 = (TestBean) this.beanFactory.getBean("nestedCustomTagBean"); assertEquals(list, bean2.getSomeList()); assertEquals(set, bean2.getSomeSet()); assertEquals(map, bean2.getSomeMap()); assertFalse(list == bean2.getSomeList()); assertFalse(set == bean2.getSomeSet()); assertFalse(map == bean2.getSomeMap()); }
Example 2
Source File: UtilNamespaceHandlerTests.java From spring-analysis-note with MIT License | 6 votes |
@Test public void testCircularCollections() { TestBean bean = (TestBean) this.beanFactory.getBean("circularCollectionsBean"); List list = bean.getSomeList(); assertEquals(1, list.size()); assertEquals(bean, list.get(0)); Set set = bean.getSomeSet(); assertEquals(1, set.size()); assertTrue(set.contains(bean)); Map map = bean.getSomeMap(); assertEquals(1, map.size()); assertEquals(bean, map.get("foo")); }
Example 3
Source File: UtilNamespaceHandlerTests.java From spring-analysis-note with MIT License | 6 votes |
@Test public void testCircularCollectionBeansStartingWithList() { this.beanFactory.getBean("circularList"); TestBean bean = (TestBean) this.beanFactory.getBean("circularCollectionBeansBean"); List list = bean.getSomeList(); assertTrue(Proxy.isProxyClass(list.getClass())); assertEquals(1, list.size()); assertEquals(bean, list.get(0)); Set set = bean.getSomeSet(); assertFalse(Proxy.isProxyClass(set.getClass())); assertEquals(1, set.size()); assertTrue(set.contains(bean)); Map map = bean.getSomeMap(); assertFalse(Proxy.isProxyClass(map.getClass())); assertEquals(1, map.size()); assertEquals(bean, map.get("foo")); }
Example 4
Source File: UtilNamespaceHandlerTests.java From spring4-understanding with Apache License 2.0 | 6 votes |
@Test public void testNestedInCollections() { TestBean bean = (TestBean) this.beanFactory.getBean("nestedCustomTagBean"); List list = bean.getSomeList(); assertEquals(1, list.size()); assertEquals(Integer.MIN_VALUE, list.get(0)); Set set = bean.getSomeSet(); assertEquals(2, set.size()); assertTrue(set.contains(Thread.State.NEW)); assertTrue(set.contains(Thread.State.RUNNABLE)); Map map = bean.getSomeMap(); assertEquals(1, map.size()); assertEquals(CustomEnum.VALUE_1, map.get("min")); TestBean bean2 = (TestBean) this.beanFactory.getBean("nestedCustomTagBean"); assertEquals(list, bean2.getSomeList()); assertEquals(set, bean2.getSomeSet()); assertEquals(map, bean2.getSomeMap()); assertFalse(list == bean2.getSomeList()); assertFalse(set == bean2.getSomeSet()); assertFalse(map == bean2.getSomeMap()); }
Example 5
Source File: UtilNamespaceHandlerTests.java From spring-analysis-note with MIT License | 6 votes |
@Test public void testCircularCollectionBeansStartingWithMap() { this.beanFactory.getBean("circularMap"); TestBean bean = (TestBean) this.beanFactory.getBean("circularCollectionBeansBean"); List list = bean.getSomeList(); assertFalse(Proxy.isProxyClass(list.getClass())); assertEquals(1, list.size()); assertEquals(bean, list.get(0)); Set set = bean.getSomeSet(); assertFalse(Proxy.isProxyClass(set.getClass())); assertEquals(1, set.size()); assertTrue(set.contains(bean)); Map map = bean.getSomeMap(); assertTrue(Proxy.isProxyClass(map.getClass())); assertEquals(1, map.size()); assertEquals(bean, map.get("foo")); }
Example 6
Source File: UtilNamespaceHandlerTests.java From spring4-understanding with Apache License 2.0 | 6 votes |
@Test public void testCircularCollectionBeansStartingWithList() { this.beanFactory.getBean("circularList"); TestBean bean = (TestBean) this.beanFactory.getBean("circularCollectionBeansBean"); List list = bean.getSomeList(); assertTrue(Proxy.isProxyClass(list.getClass())); assertEquals(1, list.size()); assertEquals(bean, list.get(0)); Set set = bean.getSomeSet(); assertFalse(Proxy.isProxyClass(set.getClass())); assertEquals(1, set.size()); assertTrue(set.contains(bean)); Map map = bean.getSomeMap(); assertFalse(Proxy.isProxyClass(map.getClass())); assertEquals(1, map.size()); assertEquals(bean, map.get("foo")); }
Example 7
Source File: UtilNamespaceHandlerTests.java From java-technology-stack with MIT License | 6 votes |
@Test public void testNestedInCollections() { TestBean bean = (TestBean) this.beanFactory.getBean("nestedCustomTagBean"); List list = bean.getSomeList(); assertEquals(1, list.size()); assertEquals(Integer.MIN_VALUE, list.get(0)); Set set = bean.getSomeSet(); assertEquals(2, set.size()); assertTrue(set.contains(Thread.State.NEW)); assertTrue(set.contains(Thread.State.RUNNABLE)); Map map = bean.getSomeMap(); assertEquals(1, map.size()); assertEquals(CustomEnum.VALUE_1, map.get("min")); TestBean bean2 = (TestBean) this.beanFactory.getBean("nestedCustomTagBean"); assertEquals(list, bean2.getSomeList()); assertEquals(set, bean2.getSomeSet()); assertEquals(map, bean2.getSomeMap()); assertFalse(list == bean2.getSomeList()); assertFalse(set == bean2.getSomeSet()); assertFalse(map == bean2.getSomeMap()); }
Example 8
Source File: UtilNamespaceHandlerTests.java From java-technology-stack with MIT License | 6 votes |
@Test public void testCircularCollectionBeansStartingWithMap() { this.beanFactory.getBean("circularMap"); TestBean bean = (TestBean) this.beanFactory.getBean("circularCollectionBeansBean"); List list = bean.getSomeList(); assertFalse(Proxy.isProxyClass(list.getClass())); assertEquals(1, list.size()); assertEquals(bean, list.get(0)); Set set = bean.getSomeSet(); assertFalse(Proxy.isProxyClass(set.getClass())); assertEquals(1, set.size()); assertTrue(set.contains(bean)); Map map = bean.getSomeMap(); assertTrue(Proxy.isProxyClass(map.getClass())); assertEquals(1, map.size()); assertEquals(bean, map.get("foo")); }
Example 9
Source File: UtilNamespaceHandlerTests.java From java-technology-stack with MIT License | 6 votes |
@Test public void testCircularCollectionBeansStartingWithList() { this.beanFactory.getBean("circularList"); TestBean bean = (TestBean) this.beanFactory.getBean("circularCollectionBeansBean"); List list = bean.getSomeList(); assertTrue(Proxy.isProxyClass(list.getClass())); assertEquals(1, list.size()); assertEquals(bean, list.get(0)); Set set = bean.getSomeSet(); assertFalse(Proxy.isProxyClass(set.getClass())); assertEquals(1, set.size()); assertTrue(set.contains(bean)); Map map = bean.getSomeMap(); assertFalse(Proxy.isProxyClass(map.getClass())); assertEquals(1, map.size()); assertEquals(bean, map.get("foo")); }
Example 10
Source File: UtilNamespaceHandlerTests.java From spring4-understanding with Apache License 2.0 | 6 votes |
@Test public void testCircularCollectionBeansStartingWithMap() { this.beanFactory.getBean("circularMap"); TestBean bean = (TestBean) this.beanFactory.getBean("circularCollectionBeansBean"); List list = bean.getSomeList(); assertFalse(Proxy.isProxyClass(list.getClass())); assertEquals(1, list.size()); assertEquals(bean, list.get(0)); Set set = bean.getSomeSet(); assertFalse(Proxy.isProxyClass(set.getClass())); assertEquals(1, set.size()); assertTrue(set.contains(bean)); Map map = bean.getSomeMap(); assertTrue(Proxy.isProxyClass(map.getClass())); assertEquals(1, map.size()); assertEquals(bean, map.get("foo")); }
Example 11
Source File: CollectionMergingTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void mergeMapWithInnerBeanAsMapEntryValueInConstructor() throws Exception { TestBean bean = (TestBean) this.beanFactory.getBean("childWithMapOfRefsInConstructor"); Map map = bean.getSomeMap(); assertNotNull(map); assertEquals(2, map.size()); assertNotNull(map.get("Rob")); assertTrue(map.get("Rob") instanceof TestBean); assertEquals("Sally", ((TestBean) map.get("Rob")).getName()); }
Example 12
Source File: CollectionMergingTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Test public void mergeMapInConstructor() throws Exception { TestBean bean = (TestBean) this.beanFactory.getBean("childWithMapInConstructor"); Map map = bean.getSomeMap(); assertEquals("Incorrect size", 3, map.size()); assertEquals(map.get("Rob"), "Sally"); assertEquals(map.get("Rod"), "Kerry"); assertEquals(map.get("Juergen"), "Eva"); }
Example 13
Source File: CollectionMergingTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void mergeMapInConstructor() throws Exception { TestBean bean = (TestBean) this.beanFactory.getBean("childWithMapInConstructor"); Map map = bean.getSomeMap(); assertEquals("Incorrect size", 3, map.size()); assertEquals("Sally", map.get("Rob")); assertEquals("Kerry", map.get("Rod")); assertEquals("Eva", map.get("Juergen")); }
Example 14
Source File: CollectionMergingTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void mergeMapWithInnerBeanAsMapEntryValue() throws Exception { TestBean bean = (TestBean) this.beanFactory.getBean("childWithMapOfRefs"); Map map = bean.getSomeMap(); assertNotNull(map); assertEquals(2, map.size()); assertNotNull(map.get("Rob")); assertTrue(map.get("Rob") instanceof TestBean); assertEquals("Sally", ((TestBean) map.get("Rob")).getName()); }
Example 15
Source File: UtilNamespaceHandlerTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Test public void testNestedCollections() { TestBean bean = (TestBean) this.beanFactory.getBean("nestedCollectionsBean"); List list = bean.getSomeList(); assertEquals(1, list.size()); assertEquals("foo", list.get(0)); Set set = bean.getSomeSet(); assertEquals(1, set.size()); assertTrue(set.contains("bar")); Map map = bean.getSomeMap(); assertEquals(1, map.size()); assertTrue(map.get("foo") instanceof Set); Set innerSet = (Set) map.get("foo"); assertEquals(1, innerSet.size()); assertTrue(innerSet.contains("bar")); TestBean bean2 = (TestBean) this.beanFactory.getBean("nestedCollectionsBean"); assertEquals(list, bean2.getSomeList()); assertEquals(set, bean2.getSomeSet()); assertEquals(map, bean2.getSomeMap()); assertFalse(list == bean2.getSomeList()); assertFalse(set == bean2.getSomeSet()); assertFalse(map == bean2.getSomeMap()); }
Example 16
Source File: CollectionMergingTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Test public void mergeMapWithInnerBeanAsMapEntryValueInConstructor() throws Exception { TestBean bean = (TestBean) this.beanFactory.getBean("childWithMapOfRefsInConstructor"); Map map = bean.getSomeMap(); assertNotNull(map); assertEquals(2, map.size()); assertNotNull(map.get("Rob")); assertTrue(map.get("Rob") instanceof TestBean); assertEquals("Sally", ((TestBean) map.get("Rob")).getName()); }
Example 17
Source File: UtilNamespaceHandlerTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void testNestedCollections() { TestBean bean = (TestBean) this.beanFactory.getBean("nestedCollectionsBean"); List list = bean.getSomeList(); assertEquals(1, list.size()); assertEquals("foo", list.get(0)); Set set = bean.getSomeSet(); assertEquals(1, set.size()); assertTrue(set.contains("bar")); Map map = bean.getSomeMap(); assertEquals(1, map.size()); assertTrue(map.get("foo") instanceof Set); Set innerSet = (Set) map.get("foo"); assertEquals(1, innerSet.size()); assertTrue(innerSet.contains("bar")); TestBean bean2 = (TestBean) this.beanFactory.getBean("nestedCollectionsBean"); assertEquals(list, bean2.getSomeList()); assertEquals(set, bean2.getSomeSet()); assertEquals(map, bean2.getSomeMap()); assertFalse(list == bean2.getSomeList()); assertFalse(set == bean2.getSomeSet()); assertFalse(map == bean2.getSomeMap()); }
Example 18
Source File: CollectionMergingTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void mergeMapWithInnerBeanAsMapEntryValueInConstructor() throws Exception { TestBean bean = (TestBean) this.beanFactory.getBean("childWithMapOfRefsInConstructor"); Map map = bean.getSomeMap(); assertNotNull(map); assertEquals(2, map.size()); assertNotNull(map.get("Rob")); assertTrue(map.get("Rob") instanceof TestBean); assertEquals("Sally", ((TestBean) map.get("Rob")).getName()); }
Example 19
Source File: CollectionMergingTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void mergeMapInConstructor() throws Exception { TestBean bean = (TestBean) this.beanFactory.getBean("childWithMapInConstructor"); Map map = bean.getSomeMap(); assertEquals("Incorrect size", 3, map.size()); assertEquals("Sally", map.get("Rob")); assertEquals("Kerry", map.get("Rod")); assertEquals("Eva", map.get("Juergen")); }
Example 20
Source File: CollectionMergingTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void mergeMap() throws Exception { TestBean bean = (TestBean) this.beanFactory.getBean("childWithMap"); Map map = bean.getSomeMap(); assertEquals("Incorrect size", 3, map.size()); assertEquals("Sally", map.get("Rob")); assertEquals("Kerry", map.get("Rod")); assertEquals("Eva", map.get("Juergen")); }