}
@Test
public void testPropertyToMap() throws Exception {
mapper = getMapper(new String[] { "dozerBeanMapping.xml" });
PropertyToMap ptm = newInstance(PropertyToMap.class);
ptm.setStringProperty("stringPropertyValue");
ptm.addStringProperty2("stringProperty2Value");
ptm.setStringProperty6("string6Value");
Map<String, Object> hashMap = newInstance(HashMap.class);
hashMap.put("reverseMapString", "reverseMapStringValue");
hashMap.put("reverseMapInteger", new Integer("567"));
ptm.setReverseMap(hashMap);
MapToProperty mtp = mapper.map(ptm, MapToProperty.class);
assertTrue(mtp.getHashMap().containsKey("stringProperty"));
assertTrue(mtp.getHashMap().containsValue("stringPropertyValue"));
assertTrue(mtp.getHashMap().containsKey("myStringProperty"));
assertTrue(mtp.getHashMap().containsValue("stringProperty2Value"));
assertFalse(mtp.getHashMap().containsValue("nullStringProperty"));
assertTrue(mtp.getNullHashMap().containsValue("string6Value"));
assertEquals("reverseMapStringValue", mtp.getReverseMapString());
assertEquals(((Integer) hashMap.get("reverseMapInteger")).toString(), mtp.getReverseMapInteger());
// Map Back
PropertyToMap dest = mapper.map(mtp, PropertyToMap.class);
assertTrue(dest.getStringProperty().equals("stringPropertyValue"));
assertTrue(dest.getStringProperty2().equals("stringProperty2Value"));
assertTrue(dest.getReverseMap().containsKey("reverseMapString"));
assertTrue(dest.getReverseMap().containsValue("reverseMapStringValue"));
assertNull(dest.getNullStringProperty());
}