Search in sources :

Example 1 with Bee

use of org.nutz.ioc.loader.xml.meta.Bee in project nutz by nutzam.

the class XmlIocLoaderTest method test_simple_case.

@Test
public void test_simple_case() {
    Ioc ioc = new NutIoc(getNew("org/nutz/ioc/loader/xml/conf/simple.xml"));
    Bee c = ioc.get(Bee.class, "C");
    assertEquals("TheC", c.getName());
    assertEquals(15, c.getAge());
    assertEquals("TheQueen", c.getMother().getName());
    assertEquals(3, c.getFriends().size());
    assertEquals("TheA", c.getFriends().get(0).getName());
    assertEquals("TheB", c.getFriends().get(1).getName());
    assertEquals(1, c.getMap().size());
    assertEquals("ABC", c.getMap().get("abc"));
    ioc.depose();
}
Also used : NutIoc(org.nutz.ioc.impl.NutIoc) Bee(org.nutz.ioc.loader.xml.meta.Bee) Ioc(org.nutz.ioc.Ioc) NutIoc(org.nutz.ioc.impl.NutIoc) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Ioc (org.nutz.ioc.Ioc)1 NutIoc (org.nutz.ioc.impl.NutIoc)1 Bee (org.nutz.ioc.loader.xml.meta.Bee)1