@Test public void testUnexistentPathRemoval() throws Exception { populate(false, points1, points2, points3); try { geogig.command(CleanOp.class).setPath(linesName).call(); fail("expected IllegalArgumentException"); } catch (IllegalArgumentException e) { assertTrue(true); } }
@Test public void testClean() throws Exception { insert(points1, points2, points3); geogig.command(CleanOp.class).call(); try (AutoCloseableIterator<DiffEntry> deleted = geogig.command(DiffWorkTree.class).call()) { ArrayList<DiffEntry> list = Lists.newArrayList(deleted); // Check that all the features have been deleted assertEquals(0, list.size()); } }
@Test public void testClean() throws Exception { insert(points1, points2, points3); geogig.command(CleanOp.class).call(); try (AutoCloseableIterator<DiffEntry> deleted = geogig.command(DiffWorkTree.class).call()) { ArrayList<DiffEntry> list = Lists.newArrayList(deleted); // Check that all the features have been deleted assertEquals(0, list.size()); } }
@Test public void testUnexistentPathRemoval() throws Exception { populate(false, points1, points2, points3); try { geogig.command(CleanOp.class).setPath(linesName).call(); fail("expected IllegalArgumentException"); } catch (IllegalArgumentException e) { assertTrue(true); } }
@Test public void testTreeClean() throws Exception { insert(points1, points2, points3, lines1); geogig.command(CleanOp.class).setPath(pointsName).call(); try (AutoCloseableIterator<DiffEntry> deleted = geogig.command(DiffWorkTree.class).call()) { ArrayList<DiffEntry> list = Lists.newArrayList(deleted); // Check that all the point features have been deleted but not the line one assertEquals(1, list.size()); } }
@Test public void testTreeClean() throws Exception { insert(points1, points2, points3, lines1); geogig.command(CleanOp.class).setPath(pointsName).call(); try (AutoCloseableIterator<DiffEntry> deleted = geogig.command(DiffWorkTree.class).call()) { ArrayList<DiffEntry> list = Lists.newArrayList(deleted); // Check that all the point features have been deleted but not the line one assertEquals(1, list.size()); } }