}
@Test
public void testMapConstructor() throws Exception {
final ExtensibleBeanFactory fb = new ClassLoaderBeanFactory(
ClassLoaderBeanFactoryTest.class.getClassLoader(),
new HashMap<String, String>() {{
put("myDto", DtoClass.class.getCanonicalName());
put("myEntity", EntityClass.class.getCanonicalName());
}},
new HashMap<String, String>() {{
put("myEntity", EntityInterface.class.getCanonicalName());
}}
);
final Class myDtoClass = fb.getClazz("myDto");
assertNotNull(myDtoClass);
assertEquals(myDtoClass, DtoClass.class);
final Object myDtoInstance = fb.get("myDto");
assertNotNull(myDtoInstance);
assertEquals(myDtoInstance.getClass(), DtoClass.class);
final Class myEntityClass = fb.getClazz("myEntity");
assertNotNull(myEntityClass);
assertEquals(myEntityClass, EntityInterface.class);
final Object myEntityInstance = fb.get("myEntity");
assertNotNull(myEntityInstance);
assertEquals(myEntityInstance.getClass(), EntityClass.class);
}