MentaContainer

Compare Revisions

Ignore whitespace Rev 114 → Rev 115

/trunk/src/test/java/org/mentacontainer/impl/MentaContainerTest.java
307,6 → 307,45
Assert.assertNotNull(myDAO.getSomething());
}
public static class MyObject1 {
}
public static class MyObject2 {
}
public static class MyObject3 {
public MyObject3(MyObject2 o2, MyObject1 o1) {
 
}
}
private Container getConfiguredContainer2() {
Container c = new MentaContainer();
c.ioc("myObj1", MyObject1.class);
c.ioc("myObj2", MyObject2.class);
c.ioc("myObj3", MyObject3.class);
c.autowire("myObj1");
c.autowire("myObj2");
return c;
}
@Test
public void testAutoWiringWithTwoConstructors() {
Container c = getConfiguredContainer2();
MyObject3 obj3 = c.get("myObj3");
Assert.assertNotNull(obj3);
}
public static class SomeAction {
private MyDAO myDAO = null;