Exemplo n.º 1
0
 public void testSmartSubContext() throws Exception {
   BasicContextOriented co1 = new BasicContextOriented(new CoinjemaContext("units/elf"));
   assertEquals("elf_path1", co1.getPaths()[0]);
   BasicContextOriented co2 = new BasicContextOriented(new CoinjemaContext("custom"));
   BasicContextOriented co3 = co2.getSubObject("units/elf");
   assertEquals("custom/units/elf", co3.getPaths()[0]);
 }
Exemplo n.º 2
0
 public void testBasicCO() throws Exception {
   BasicContextOriented co = new BasicContextOriented();
   assertNotNull(co);
   assertEquals("path1", co.getPaths()[0]);
   assertEquals("path2", co.getPaths()[1]);
   assertEquals(new URL("http://coinjema.sourceforge.net/"), co.getHome());
   BasicContextOriented co2 = new BasicContextOriented();
   assertNotNull(co2);
   assertEquals("path1", co2.getPaths()[0]);
   assertEquals("path2", co2.getPaths()[1]);
   assertEquals(new URL("http://coinjema.sourceforge.net/"), co2.getHome());
 }
Exemplo n.º 3
0
 public void testSubContext() throws Exception {
   BasicContextOriented co2 = new BasicContextOriented(new CoinjemaContext("config2"));
   BasicContextOriented co1 = new BasicContextOriented();
   assertEquals("Root Value", co1.getRedirectedService().getMainValue());
   assertEquals("config2 Value", co2.getRedirectedService().getMainValue());
   assertEquals("path1", co2.getPaths()[0]);
   BasicContextOriented co3 = new BasicContextOriented(new CoinjemaContext("override"));
   assertEquals("path3", co3.getPaths()[0]);
   assertEquals("path4", co3.getPaths()[1]);
   BasicContextOriented co4 = co3.getSubObject();
   assertEquals("path3", co4.getPaths()[0]);
   assertEquals("path4", co4.getPaths()[1]);
   co4 = co3.getSubObject(co1);
   assertEquals("path1", co4.getPaths()[0]);
 }
Exemplo n.º 4
0
 public void testTooDeepContextFind() throws Exception {
   BasicContextOriented elf = new BasicContextOriented(new CoinjemaContext("units/elf/empty.txt"));
   BasicContextOriented orc = elf.getSubObject("orc");
   assertEquals("orc_path2", orc.getPaths()[1]);
 }