private void assertIAE(String prefixPath, String path) { Path p = Path.parse(prefixPath); try { p.append(path); throw AbstractTestCase.failure("Was expecting parsing of " + path + " to throw an IAE"); } catch (IllegalArgumentException e) { // Ok } }
private void assertIAE(String prefixPath, String path) { Path p = Path.parse(prefixPath); try { p.append(path); throw AbstractTestCase.failure("Was expecting parsing of " + path + " to throw an IAE"); } catch (IllegalArgumentException e) { // Ok } }
@Test public void testAppendIAE() { assertPath(false, new String[]{}, "b", null, Path.parse("").append("b")); assertPath(false, new String[]{}, "b", "c", Path.parse("").append("b.c")); assertPath(false, new String[]{}, "b", null, Path.parse("").append("./b")); assertPath(false, new String[]{}, "c", null, Path.parse("a/b").append("../c")); assertPath(false, new String[]{}, "b", null, Path.parse("").append("a/../b")); assertPath(false, new String[]{}, "b", "c", Path.parse("").append("b.c")); assertPath(false, new String[]{"a"}, "c", null, Path.parse("a/b").append("c")); assertPath(false, new String[]{"a"}, "d", null, Path.parse("a/b.c").append("d")); }
@Test public void testAppendIAE() { assertPath(false, new String[]{}, "b", null, Path.parse("").append("b")); assertPath(false, new String[]{}, "b", "c", Path.parse("").append("b.c")); assertPath(false, new String[]{}, "b", null, Path.parse("").append("./b")); assertPath(false, new String[]{}, "c", null, Path.parse("a/b").append("../c")); assertPath(false, new String[]{}, "b", null, Path.parse("").append("a/../b")); assertPath(false, new String[]{}, "b", "c", Path.parse("").append("b.c")); assertPath(false, new String[]{"a"}, "c", null, Path.parse("a/b").append("c")); assertPath(false, new String[]{"a"}, "d", null, Path.parse("a/b.c").append("d")); }