MentaContainer

Compare Revisions

Ignore whitespace Rev 38 → Rev 39

/trunk/src/test/java/org/mentacontainer/impl/GenericComponentTest.java
25,9 → 25,9
Container c = new MentaContainer();
// giveMeSomething => method that will be called to return object
Component generic = new GenericComponent("myFactory", factory, "giveMeSomething");
Component generic = new GenericComponent(factory, "giveMeSomething");
c.ioc(generic);
c.ioc("myFactory", generic);
String s1 = (String) c.get("myFactory");
/trunk/src/test/java/org/mentacontainer/impl/MentaComponentTest.java
29,9 → 29,9
@Test
public void testComponent() throws Exception {
Component c1 = new MentaComponent("user1", User.class).addInitValue("saoj");
Component c1 = new MentaComponent(User.class).addInitValue("saoj");
Component c2 = new MentaComponent("user2", User.class).addProperty("username", "soliveira");
Component c2 = new MentaComponent(User.class).addProperty("username", "soliveira");
User u1 = (User) c1.getInstance();
45,7 → 45,7
@Test
public void testSingleton() throws Exception {
Component c1 = new MentaComponent("user", User.class, true).addInitValue("saoj");
Component c1 = new MentaComponent(User.class, true).addInitValue("saoj");
User u1 = (User) c1.getInstance();