assertTrue(um == null || um.size() == 0);
}
public void testBeanWithAnnotations() throws Exception {
final AnnotationAwareBeanPropertyAccessStrategy pas = new AnnotationAwareBeanPropertyAccessStrategy(new TestBean());
final PropertyMetadataAccessStrategy mas = pas.getMetadataAccessStrategy();
Map<String,Object> um = mas.getAllUserMetadata("name");
assertNotNull(um);
assertEquals(2, um.size());
assertEquals(Boolean.TRUE, um.get("org.springframework.binding.support.NoValueAnnotation"));
NoValueAnnotation nva = (NoValueAnnotation)um.get("@" + NoValueAnnotation.class.getName());
assertNotNull(nva);
um = mas.getAllUserMetadata("age");
assertNotNull(um);
assertEquals(4, um.size());
assertEquals(Boolean.TRUE, um.get("org.springframework.binding.support.NoValueAnnotation"));
assertEquals("The Age Method", um.get("org.springframework.binding.support.SingleValueAnnotation"));
nva = (NoValueAnnotation)um.get("@" + NoValueAnnotation.class.getName());
assertNotNull(nva);
SingleValueAnnotation sva = (SingleValueAnnotation)um.get("@" + SingleValueAnnotation.class.getName());
assertNotNull(sva);
assertEquals("The Age Method", sva.value());
um = mas.getAllUserMetadata("rank");
assertNotNull(um);
assertEquals(9, um.size());
assertEquals(Boolean.TRUE, um.get("org.springframework.binding.support.NoValueAnnotation"));
assertEquals("The Rank Method", um.get("org.springframework.binding.support.SingleValueAnnotation"));
assertEquals(Boolean.TRUE, um.get("org.springframework.binding.support.MultiValueAnnotation"));
assertEquals("First Test Name", um.get("org.springframework.binding.support.MultiValueAnnotation.name"));
assertEquals(24.5, um.get("org.springframework.binding.support.MultiValueAnnotation.age"));
assertEquals(10, um.get("org.springframework.binding.support.MultiValueAnnotation.rank"));
nva = (NoValueAnnotation)um.get("@" + NoValueAnnotation.class.getName());
assertNotNull(nva);
sva = (SingleValueAnnotation)um.get("@" + SingleValueAnnotation.class.getName());
assertNotNull(sva);
assertEquals("The Rank Method", sva.value());
MultiValueAnnotation mva = (MultiValueAnnotation)um.get("@" + MultiValueAnnotation.class.getName());
assertNotNull(mva);
assertEquals("First Test Name", mva.name());
assertEquals(24.5, mva.age());
assertEquals(10, mva.rank());
um = mas.getAllUserMetadata("description");
assertTrue(um == null || um.size() == 0);
}