예제 #1
0
  @Test
  public void testGetParent() throws Exception {
    Path path;

    path = Path.fromDotString("1.2.3");
    Assert.assertThat(path.getParent(), is(Path.fromDotString("1.2")));

    path = Path.fromDotString("1");
    Assert.assertThat(path.getParent(), is(Path.fromDotString("")));

    path = Path.fromDotString("");
    Assert.assertThat(path.getParent(), nullValue());
  }
예제 #2
0
 @Test
 public void testGetParentOnEmptyPath() throws Exception {
   Path path = Path.fromDotString("");
   Assert.assertThat(path.getParent(), nullValue());
 }