private static Log log = LogFactory.getInstance().getLog("firefly-system");
public static ApplicationContext xmlApplicationContext = new XmlApplicationContext();
@Test
public void testXmlInject() {
Person person = xmlApplicationContext.getBean("person");
Assert.assertThat(person.getName(), is("Jack"));
PersonService personService = xmlApplicationContext
.getBean("personService");
List<Object> l = personService.getTestList();
Assert.assertThat(l.size(), greaterThan(0));
int i = 0;
for (Object p : l) {
if (p instanceof Person) {
person = (Person) p;
i++;
log.debug(person.getName());
} else if (p instanceof Map) {
@SuppressWarnings("unchecked")
Map<Object, Object> map = (Map<Object, Object>)p;
log.info(map.toString());
Assert.assertThat(map.entrySet().size(), greaterThan(0));