public void testParallelSingletonContextualize() throws Exception { BasicContextOriented co2 = new BasicContextOriented(new CoinjemaContext("units/elf")); BasicContextOriented b = new BasicContextOriented(new CoinjemaContext("units/orc")); assertEquals(co2.getMyService(), b.getMyService()); assertEquals( new CoinjemaContext(""), ((ContextOriented) co2.getMyService()).getCoinjemaContext()); }
public void testNested() throws Exception { BasicContextOriented co = new BasicContextOriented(new CoinjemaContext("custom")); assertEquals("A Test String", co.getSimple().getCircular().getTest()); assertEquals("test string", co.getSimple().getTest()); assertEquals( co.getMyService(), co.getSimple().getCircular().getCircular().getCircular().getService()); }