MentaContainer

Compare Revisions

Regard whitespace Rev 19 → Rev 20

/trunk/src/test/java/org/mentacontainer/impl/MentaContainerTest.java
30,10 → 30,8
Container c = new MentaContainer();
c.ioc("myStr", String.class);
c.ioc("myStr", String.class).addInitValue("hello");
c.init("myStr", "hello");
Assert.assertEquals("hello", c.get("myStr"));
String s1 = (String) c.get("myStr");
44,10 → 42,8
Assert.assertTrue(s1.equals(s2));
c.ioc("anotherStr", String.class);
c.ioc("anotherStr", String.class).addInitValue("hi");
c.init("anotherStr", "hi");
String s3 = (String) c.get("anotherStr");
Assert.assertTrue(s1 != s3);
60,10 → 56,8
Container c = new MentaContainer();
c.ioc("myStr", String.class, true);
c.ioc("myStr", String.class, true).addInitValue("hello");
c.init("myStr", "hello");
Assert.assertEquals("hello", c.get("myStr"));
String s1 = (String) c.get("myStr");
80,7 → 74,9
Container c = new MentaContainer();
c.ioc("myStr", String.class).ioc("myStr", String.class);
c.ioc("myStr", String.class);
c.ioc("myStr", String.class);
}
@Test(expected = RuntimeException.class)
92,12 → 88,4
c.autowire("myThread", Runnable.class);
}
@Test(expected = RuntimeException.class)
public void testAddingWiringNoInterface() {
Container c = new MentaContainer();
c.autowire("myThread", Thread.class);
}
}