예제 #1
0
  @Test
  public void testGetFromStringSingleItem() throws Exception {
    Path path = Path.fromDotString("1");

    Assert.assertThat(path.getSize(), is(1));
    Assert.assertThat(path.get(0), is("1"));
  }
예제 #2
0
  @Test
  public void testGetFromString() throws Exception {
    Path path = Path.fromDotString("1.2.3");

    Assert.assertThat(path.getSize(), is(3));

    Assert.assertThat(path.get(0), is("1"));
    Assert.assertThat(path.get(1), is("2"));
    Assert.assertThat(path.get(2), is("3"));
  }
예제 #3
0
  @Test
  public void testGetFromStringEmpty() throws Exception {
    Path path = Path.fromDotString("");

    Assert.assertThat(path.getSize(), is(0));
  }