/** test for method getPropertyValue(..) Multiple */ public void testGetPropertyValueMultiple() throws Exception { vo.setFullName("John Smith"); vo.setActive(true); holder.setValueObject(vo); assertEquals("FullName", "John Smith", holder.getPropertyValue("fullName")); assertEquals("active", Boolean.TRUE, holder.getPropertyValue("active")); }
public void testParentValueHolderMultiChange() throws Exception { TestAddressValueObject addr = new TestAddressValueObject("Seattle", "WA", "98116"); vo.setHomeAddress(addr); VOValueHolder addrHolder = new VOValueHolder(); addrHolder.setParentValueHolder(holder); addrHolder.setParentPropertyName("homeAddress"); holder.setObject(vo); assertEquals("Address city", "Seattle", addrHolder.getPropertyValue("city")); vo.setHomeAddress(new TestAddressValueObject("Tacoma", "WA", "98320")); holder.fireContentValueChanged(); assertEquals("Address city", "Tacoma", addrHolder.getPropertyValue("city")); }
/** test for method getPropertyValue(..) Multiple access of same */ public void testGetPropertyValueMultipleAccessOfSame() throws Exception { vo.setFullName("John Smith"); holder.setValueObject(vo); assertEquals("FullName", "John Smith", holder.getPropertyValue("fullName")); assertEquals("FullName", "John Smith", holder.getPropertyValue("fullName")); assertEquals("FullName", "John Smith", holder.getPropertyValue("fullName")); // Now make sure only 1 entry in Map assertEquals("Size of map", 1, holder.getPropertyAccessors().size()); }
/** test for method setPropertyValue(..) */ public void testSetPropertyValue() throws Exception { holder.setValueObject(vo); String value = "John Smith"; holder.setPropertyValue("fullName", value); assertEquals("FullName", value, vo.getFullName()); }