@Test public void testUpdateIndexNoTreeName() { exception.expect(IllegalArgumentException.class); exception.expectMessage("Tree ref spec not provided."); geogig.command(UpdateIndexOp.class).call(); }
@Test public void testUpdateIndexNoTreeName() { exception.expect(IllegalArgumentException.class); exception.expectMessage("Tree ref spec not provided."); geogig.command(UpdateIndexOp.class).call(); }
private Index updateIndex(String treeName, @Nullable String... extraAttributes) { List<String> extraAtts = null; if (extraAttributes != null) { extraAtts = Lists.newArrayList(extraAttributes); } Index index = geogig.command(UpdateIndexOp.class)// .setOverwrite(true)// .setTreeRefSpec(treeName)// .setExtraAttributes(extraAtts)// .setBounds(new Envelope(-180, 180, -90, 90))// .call(); return index; } }
private Index updateIndex(String treeName, @Nullable String... extraAttributes) { List<String> extraAtts = null; if (extraAttributes != null) { extraAtts = Lists.newArrayList(extraAttributes); } Index index = geogig.command(UpdateIndexOp.class)// .setOverwrite(true)// .setTreeRefSpec(treeName)// .setExtraAttributes(extraAtts)// .setBounds(new Envelope(-180, 180, -90, 90))// .call(); return index; } }
@Test public void testUpdateIndexWrongTreeName() { exception.expect(IllegalArgumentException.class); exception.expectMessage("Can't find feature tree 'nonexistent'"); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec("nonexistent")// .call(); }
@Test public void testUpdateIndexWrongTreeName() { exception.expect(IllegalArgumentException.class); exception.expectMessage("Can't find feature tree 'nonexistent'"); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec("nonexistent")// .call(); }
@Test public void testUpdateNoExistingIndex() { exception.expect(IllegalArgumentException.class); exception.expectMessage("A matching index could not be found."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .setExtraAttributes(Lists.newArrayList("y"))// .call(); }
@Test public void testUpdateNoExistingIndex() { exception.expect(IllegalStateException.class); exception.expectMessage("A matching index could not be found."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .setExtraAttributes(Lists.newArrayList("y"))// .call(); }
@Test public void testUpdateIndexAttributesNoFlagSpecified() { createIndex("x"); exception.expect(IllegalArgumentException.class); exception.expectMessage( "Extra attributes already exist on index, specify add or overwrite to update."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .setExtraAttributes(Lists.newArrayList("y"))// .call(); }
@Test public void testUpdateIndexAttributesNoFlagSpecified() { createIndex("x"); exception.expect(IllegalStateException.class); exception.expectMessage( "Extra attributes already exist on index, specify add or overwrite to update."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .setExtraAttributes(Lists.newArrayList("y"))// .call(); }
@Test public void testUpdateIndexAddSameAttribute() { createIndex("x", "y"); exception.expect(IllegalStateException.class); exception.expectMessage("Nothing to update..."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .setExtraAttributes(Lists.newArrayList("x"))// .setAdd(true)// .call(); }
@Test public void testUpdateIndexOverwriteSameAttribute() { createIndex("x"); exception.expect(IllegalArgumentException.class); exception.expectMessage("Nothing to update..."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .setExtraAttributes(Lists.newArrayList("x"))// .setOverwrite(true)// .call(); }
@Test public void testUpdateIndexAddSameAttribute() { createIndex("x", "y"); exception.expect(IllegalArgumentException.class); exception.expectMessage("Nothing to update..."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .setExtraAttributes(Lists.newArrayList("x"))// .setAdd(true)// .call(); }
@Test public void testUpdateIndexOverwriteSameAttribute() { createIndex("x"); exception.expect(IllegalStateException.class); exception.expectMessage("Nothing to update..."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .setExtraAttributes(Lists.newArrayList("x"))// .setOverwrite(true)// .call(); }
@Test public void testUpdateIndexDoNothing() { createIndex("x"); exception.expect(IllegalStateException.class); exception.expectMessage("Nothing to update..."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .call(); }
@Test public void testUpdateIndexDoNothing() { createIndex("x"); exception.expect(IllegalArgumentException.class); exception.expectMessage("Nothing to update..."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .call(); }
@Test public void testUpdateNoMatchingIndex() { indexdb.createIndexInfo(worldPointsLayer.getName(), "x", IndexType.QUADTREE, null); exception.expect(IllegalArgumentException.class); exception.expectMessage("A matching index could not be found."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .setAttributeName("y")// .call(); }
@Test public void testUpdateNoMatchingIndex() { indexdb.createIndexInfo(worldPointsLayer.getName(), "x", IndexType.QUADTREE, null); exception.expect(IllegalStateException.class); exception.expectMessage("A matching index could not be found."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .setAttributeName("y")// .call(); }
@Test public void testUpdateMultipleMatchingIndexes() { indexdb.createIndexInfo(worldPointsLayer.getName(), "x", IndexType.QUADTREE, null); indexdb.createIndexInfo(worldPointsLayer.getName(), "y", IndexType.QUADTREE, null); exception.expect(IllegalStateException.class); exception.expectMessage( "Multiple indexes were found for the specified tree, please specify the attribute."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .call(); }
@Test public void testUpdateMultipleMatchingIndexes() { indexdb.createIndexInfo(worldPointsLayer.getName(), "x", IndexType.QUADTREE, null); indexdb.createIndexInfo(worldPointsLayer.getName(), "y", IndexType.QUADTREE, null); exception.expect(IllegalArgumentException.class); exception.expectMessage( "Multiple indexes were found for the specified tree, please specify the attribute."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .call(); }