use of org.neo4j.kernel.api.impl.schema.verification.UniquenessVerifier in project neo4j by neo4j.
the class SimpleUniquenessVerifierTest method assertDuplicatesCreated.
private void assertDuplicatesCreated(PropertyAccessor propertyAccessor, List<Object> updatedPropertyValues) {
try (UniquenessVerifier verifier = newSimpleUniquenessVerifier()) {
verifier.verify(propertyAccessor, PROPERTY_KEY_IDS, updatedPropertyValues);
fail("Uniqueness verification was successful. This is not expected...");
} catch (Throwable t) {
assertThat(t, instanceOf(IndexEntryConflictException.class));
}
}
use of org.neo4j.kernel.api.impl.schema.verification.UniquenessVerifier in project neo4j by neo4j.
the class SimpleUniquenessVerifierTest method assertHasDuplicates.
private void assertHasDuplicates(PropertyAccessor propertyAccessor) {
try (UniquenessVerifier verifier = newSimpleUniquenessVerifier()) {
verifier.verify(propertyAccessor, PROPERTY_KEY_IDS);
fail("Uniqueness verification was successful. This is not expected...");
} catch (Throwable t) {
assertThat(t, instanceOf(IndexEntryConflictException.class));
}
}
use of org.neo4j.kernel.api.impl.schema.verification.UniquenessVerifier in project neo4j by neo4j.
the class SimpleUniquenessVerifierTest method runUniquenessVerification.
private void runUniquenessVerification(PropertyAccessor propertyAccessor, IndexSearcher indexSearcher) throws IOException, IndexEntryConflictException {
try {
PartitionSearcher partitionSearcher = mock(PartitionSearcher.class);
when(partitionSearcher.getIndexSearcher()).thenReturn(indexSearcher);
try (UniquenessVerifier verifier = new SimpleUniquenessVerifier(partitionSearcher)) {
verifier.verify(propertyAccessor, PROPERTY_KEY_IDS);
}
} finally {
searcherManager.release(indexSearcher);
}
}
Aggregations