示例#1
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]);
 }
示例#2
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]);
 }
示例#3
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]);
 }