Exemplo n.º 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"));
  }
Exemplo n.º 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"));
  }
Exemplo n.º 3
0
  @Test
  public void testGetFromStringEmpty() throws Exception {
    Path path = Path.fromDotString("");

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