MentaContainer

Rev

Rev 39 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 39 Rev 41
Line 27... Line 27...
27
                // giveMeSomething => method that will be called to return object
27
                // giveMeSomething => method that will be called to return object
28
                Component generic = new GenericComponent(factory, "giveMeSomething");
28
                Component generic = new GenericComponent(factory, "giveMeSomething");
29
               
29
               
30
                c.ioc("myFactory", generic);
30
                c.ioc("myFactory", generic);
31
               
31
               
32
                String s1 = (String) c.get("myFactory");
-
 
-
 
32
                String s1 = c.get("myFactory");
33
               
33
               
34
                Thread.sleep(5); // so strings are different... my cpu is fast! :-)
34
                Thread.sleep(5); // so strings are different... my cpu is fast! :-)
35
               
35
               
36
                String s2 = (String) c.get("myFactory");
-
 
-
 
36
                String s2 = c.get("myFactory");
37
               
37
               
38
                Assert.assertNotNull(s1);
38
                Assert.assertNotNull(s1);
39
                Assert.assertNotNull(s2);
39
                Assert.assertNotNull(s2);
40
                Assert.assertTrue(s1 != s2);
40
                Assert.assertTrue(s1 != s2);
41
                Assert.assertTrue(!s1.equals(s2));
41
                Assert.assertTrue(!s1.equals(s2));