@Override public void removeValue(final String value, final boolean p) throws DataAccessLayerException { _index.remove(value); } }
@Override public void removeValue(final String value, final boolean p) throws DataAccessLayerException { _index.remove(value); } }
@Override public void removeValue(final Value value, final boolean p) throws DataAccessLayerException { if (value instanceof URI && contains(((URI) value).getNamespace())) { final String n3 = NTriplesUtil.toNTriplesString(value); _index.remove(n3); } else { _decoratee.removeValue(value, p); } }
@Override public void removeValue(final Value value, final boolean p) throws DataAccessLayerException { if (value instanceof URI && contains(((URI) value).getNamespace())) { final String n3 = NTriplesUtil.toNTriplesString(value); _index.remove(n3); } else { _decoratee.removeValue(value, p); } }
/** * Remove must remove the value from the underlying index. * * @throws Exception never otherwise the test fails. */ @Test public void removeValue() throws Exception { final String aValue = randomString(); _cut.removeValue(aValue, RANDOMIZER.nextBoolean()); verify(_dummyIndex).remove(aValue); } }
/** * remove method should use the both indexes. * * @throws Exception never otherwise the test fails. */ @Test public void remove() throws Exception { final byte[] id = { 1, 2, 3, 4 }; final String value = randomString(); when(_byValue.get(value)).thenReturn(id); _cut.remove(value); verify(_byValue).get(value); verify(_byId).removeQuick(id); verify(_byValue).removeQuick(value); } }
/** * Tests remove() method with managed URI. * * @throws Exception never otherwise the test fails. */ @Test public void removeManagedURI() throws Exception { final String[] managedNamespaces = { FOAF.NAMESPACE, RDFS.NAMESPACE, OWL.NAMESPACE }; for (final String managedNamespace : managedNamespaces) { assertTrue(_cut.contains(managedNamespace)); final Value uri = buildResource(managedNamespace + randomString()); final String n3 = NTriplesUtil.toNTriplesString(uri); _cut.removeValue(uri, _isPredicate); verify(_dummyIndex).remove(n3); reset(_dummyIndex); } }