@Override public void remove() { iter.remove(); }
@Override public void remove() { iter.remove(); }
@Override public void remove() { iter.remove(); }
@Override public void remove() { iter.remove(); }
@Override public void remove() { lazy(); it.remove(); }
@Override public void remove() { lazy(); it.remove(); }
public void testWrappedNoRemove() { Iterator<Node> base = nodeSet( "a b c" ).iterator(); base.next(); base.remove(); ExtendedIterator<Node> wrapped = WrappedIterator.createNoRemove( base ); wrapped.next(); try { wrapped.remove(); fail( "wrapped-no-remove iterator should deny .remove()" ); } catch (UnsupportedOperationException e) { pass(); } } }
public void testWrappedNoRemove() { Iterator<Node> base = nodeSet( "a b c" ).iterator(); base.next(); base.remove(); ExtendedIterator<Node> wrapped = WrappedIterator.createNoRemove( base ); wrapped.next(); try { wrapped.remove(); fail( "wrapped-no-remove iterator should deny .remove()" ); } catch (UnsupportedOperationException e) { pass(); } } }
public void testRemove3() { List<String> L = listOfStrings("a b c"); List<String> R = listOfStrings("d e f"); ExtendedIterator<String> Lit = WrappedIterator.create(L.iterator()); ExtendedIterator<String> Rit = WrappedIterator.create(R.iterator()); ExtendedIterator<String> LR = Lit.andThen( Rit ) ; while (LR.hasNext()) { LR.next(); } LR.remove(); assertEquals("abc", concatAsString(L)); assertEquals("de", concatAsString(R)); }
public void testRemove3() { List<String> L = listOfStrings("a b c"); List<String> R = listOfStrings("d e f"); ExtendedIterator<String> Lit = WrappedIterator.create(L.iterator()); ExtendedIterator<String> Rit = WrappedIterator.create(R.iterator()); ExtendedIterator<String> LR = Lit.andThen( Rit ) ; while (LR.hasNext()) { LR.next(); } LR.remove(); assertEquals("abc", concatAsString(L)); assertEquals("de", concatAsString(R)); }
public void testRemove2() { List<String> L = listOfStrings("a b c"); List<String> R = listOfStrings("d e f"); ExtendedIterator<String> Lit = WrappedIterator.create(L.iterator()); ExtendedIterator<String> Rit = WrappedIterator.create(R.iterator()); ExtendedIterator<String> LR = Lit.andThen( Rit ) ; while (LR.hasNext()) { String s = LR.next(); if ("d".equals(s)) { LR.hasNext(); // test for JENA-60 LR.remove(); } } assertEquals("abc", concatAsString(L)); assertEquals("ef", concatAsString(R)); }
/** Ensure that triples removed by calling .remove() on the iterator returned by a find() will generate deletion notifications. */ public void testEventDeleteByFind() { Graph g = getAndRegister( L ); Triple toRemove = triple( "remove this triple" ); g.add( toRemove ); try { ExtendedIterator<Triple> rtr = g.find( toRemove ); assertTrue( "ensure a(t least) one triple", rtr.hasNext() ); rtr.next(); rtr.remove(); rtr.close(); L.assertHas( new Object[] { "add", g, toRemove, "delete", g, toRemove} ); } catch (UnsupportedOperationException ex) { // No iterator remove } }
public void testRemove( String findRemove, String findCheck ) { Graph g = getGraphWith( "S P O" ); ExtendedIterator<Triple> it = g.find( NodeCreateUtils.createTriple( findRemove ) ); try { it.next(); it.remove(); it.close(); assertEquals( "remove with " + findRemove + ":", 0, g.size() ); assertFalse( g.contains( NodeCreateUtils.createTriple( findCheck ) ) ); } catch (UnsupportedOperationException e) { // No iterator remove. it.close(); } }
public void testRemove( String findRemove, String findCheck ) { Graph g = getGraphWith( "S P O" ); ExtendedIterator<Triple> it = g.find( NodeCreateUtils.createTriple( findRemove ) ); try { it.next(); it.remove(); it.close(); assertEquals( "remove with " + findRemove + ":", 0, g.size() ); assertFalse( g.contains( NodeCreateUtils.createTriple( findCheck ) ) ); } catch (UnsupportedOperationException e) { // No iterator remove. it.close(); } }
@ContractTest public void testIteratorRemoveOneItem() { testingBunch.add(triple("a P b")); testingBunch.add(triple("c Q d")); testingBunch.add(triple("e R f")); ExtendedIterator<Triple> it = testingBunch.iterator(); while (it.hasNext()) if (it.next().equals(triple("c Q d"))) it.remove(); assertEquals(tripleSet("a P b; e R f"), testingBunch.iterator().toSet()); }
@ContractTest public void testIteratorRemoveOneItem() { testingBunch.add(triple("a P b")); testingBunch.add(triple("c Q d")); testingBunch.add(triple("e R f")); ExtendedIterator<Triple> it = testingBunch.iterator(); while (it.hasNext()) if (it.next().equals(triple("c Q d"))) it.remove(); assertEquals(tripleSet("a P b; e R f"), testingBunch.iterator().toSet()); }
public void testIteratorRemoveOneItem() { TripleBunch b = getBunch(); b.add( triple( "a P b" ) ); b.add( triple( "c Q d" ) ); b.add( triple( "e R f" ) ); ExtendedIterator<Triple> it = b.iterator(); while (it.hasNext()) if (it.next().equals( triple( "c Q d") )) it.remove(); assertEquals( tripleSet( "a P b; e R f" ), b.iterator().toSet() ); }
public void testIteratorRemoveOneItem() { TripleBunch b = getBunch(); b.add( triple( "a P b" ) ); b.add( triple( "c Q d" ) ); b.add( triple( "e R f" ) ); ExtendedIterator<Triple> it = b.iterator(); while (it.hasNext()) if (it.next().equals( triple( "c Q d") )) it.remove(); assertEquals( tripleSet( "a P b; e R f" ), b.iterator().toSet() ); }
private void testRemove(String findRemove, String findCheck) { Graph g = graphWith(producer.newInstance(), "S P O"); txnBegin(g); ExtendedIterator<Triple> it = g .find(NodeCreateUtils.createTriple(findRemove)); txnRollback(g); try { it.next(); it.remove(); it.close(); assertEquals("remove with " + findRemove + ":", 0, g.size()); assertFalse(g.contains(NodeCreateUtils.createTriple(findCheck))); } catch (UnsupportedOperationException e) { it.close(); } }
private void testRemove(String findRemove, String findCheck) { Graph g = graphWith(producer.newInstance(), "S P O"); txnBegin(g); ExtendedIterator<Triple> it = g .find(NodeCreateUtils.createTriple(findRemove)); txnRollback(g); try { it.next(); it.remove(); it.close(); assertEquals("remove with " + findRemove + ":", 0, g.size()); assertFalse(g.contains(NodeCreateUtils.createTriple(findCheck))); } catch (UnsupportedOperationException e) { it.close(); } }