示例#1
0
  @Test
  public void testPathSplitting() throws MalformedObjectNameException {
    List<String> paths = PathUtil.parsePath("hello/world");
    assertEquals(paths.size(), 2);
    assertEquals(paths.get(0), "hello");
    assertEquals(paths.get(1), "world");

    paths = PathUtil.parsePath("hello\\/world/second");
    assertEquals(paths.size(), 2);
    assertEquals(paths.get(0), "hello/world");
    assertEquals(paths.get(1), "second");
  }
示例#2
0
 @Test
 public void testPathGlueing() throws MalformedObjectNameException {
   String path = PathUtil.combineToPath(Arrays.asList("hello/world", "second"));
   assertEquals(path, "hello\\/world/second");
 }