IndexStore { protected void deleteViewIndex(Graph graph) { if (graph.getView().isMainView()) { throw new IllegalArgumentException("Can't delete a view index for the main view"); } lock(); try { IndexImpl<T> index = viewIndexes.remove(graph.getView()); if (index != null) { index.destroy(); } } finally { unlock(); } } IndexStore(ColumnStore<T> columnStore); Object set(Column column, Object oldValue, Object value, T element); void clear(T element); void index(T element); void indexView(Graph graph); void indexInView(T element, GraphView view); void clearInView(T element, GraphView view); void clear(GraphView view); void clear();  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testDeleteViewIndexMainView() { GraphStore graphStore = new GraphStore(); graphStore.nodeTable.store.indexStore.deleteViewIndex(graphStore); }
@Test public void testDeleteViewIndex() { GraphStore graphStore = GraphGenerator.generateTinyGraphStore(); IndexStore<Node> indexStore = graphStore.nodeTable.store.indexStore; ColumnImpl column = new ColumnImpl("foo", String.class, "Foo", null, Origin.DATA, true, false); graphStore.nodeTable.store.addColumn(column); NodeImpl n1 = graphStore.getNode("1"); n1.setAttribute(column, "bar"); GraphViewImpl view = graphStore.viewStore.createView(); view.fill(); Graph graph = graphStore.viewStore.getGraph(view); IndexImpl index = indexStore.createViewIndex(graph); indexStore.deleteViewIndex(graph); Assert.assertFalse(index.hasColumn(column)); }