assertTrue(um == null || um.size() == 0);
}
public void testInFormModel() {
final AnnotationAwareBeanPropertyAccessStrategy pas = new AnnotationAwareBeanPropertyAccessStrategy(new TestBean());
final FormModel fm = new DefaultFormModel(pas);
FieldMetadata pm = fm.getFieldMetadata("name");
assertNotNull(pm);
assertEquals(Boolean.TRUE, pm.getUserMetadata("org.springframework.binding.support.NoValueAnnotation"));
NoValueAnnotation nva = (NoValueAnnotation)pm.getUserMetadata("@" + NoValueAnnotation.class.getName());
assertNotNull(nva);
assertEquals(2, pm.getAllUserMetadata().size());
pm = fm.getFieldMetadata("age");
assertNotNull(pm);
assertEquals(Boolean.TRUE, pm.getUserMetadata("org.springframework.binding.support.NoValueAnnotation"));
assertEquals("The Age Method", pm.getUserMetadata("org.springframework.binding.support.SingleValueAnnotation"));
nva = (NoValueAnnotation)pm.getUserMetadata("@" + NoValueAnnotation.class.getName());
assertNotNull(nva);
SingleValueAnnotation sva = (SingleValueAnnotation)pm.getUserMetadata("@" + SingleValueAnnotation.class.getName());
assertNotNull(sva);
assertEquals("The Age Method", sva.value());
assertEquals(4, pm.getAllUserMetadata().size());
pm = fm.getFieldMetadata("rank");
assertNotNull(pm);
assertEquals(Boolean.TRUE, pm.getUserMetadata("org.springframework.binding.support.NoValueAnnotation"));
assertEquals("The Rank Method", pm.getUserMetadata("org.springframework.binding.support.SingleValueAnnotation"));
assertEquals(Boolean.TRUE, pm.getUserMetadata("org.springframework.binding.support.MultiValueAnnotation"));
assertEquals("First Test Name", pm.getUserMetadata("org.springframework.binding.support.MultiValueAnnotation.name"));
assertEquals(24.5, pm.getUserMetadata("org.springframework.binding.support.MultiValueAnnotation.age"));
assertEquals(10, pm.getUserMetadata("org.springframework.binding.support.MultiValueAnnotation.rank"));
nva = (NoValueAnnotation)pm.getUserMetadata("@" + NoValueAnnotation.class.getName());
assertNotNull(nva);
sva = (SingleValueAnnotation)pm.getUserMetadata("@" + SingleValueAnnotation.class.getName());
assertNotNull(sva);
assertEquals("The Rank Method", sva.value());
MultiValueAnnotation mva = (MultiValueAnnotation)pm.getUserMetadata("@" + MultiValueAnnotation.class.getName());
assertNotNull(mva);
assertEquals("First Test Name", mva.name());
assertEquals(24.5, mva.age());
assertEquals(10, mva.rank());
assertEquals(9, pm.getAllUserMetadata().size());
pm = fm.getFieldMetadata("description");
assertNotNull(pm);
assertTrue(pm.getAllUserMetadata() == null || pm.getAllUserMetadata().size() == 0);
}