use of org.neo4j.graphdb.ConstraintViolationException in project neo4j by neo4j.
the class UniqueConstraintCompatibility method onlineConstraintShouldRejectChangingEntryToAlreadyIndexedValueThatOtherTransactionsAreRemoving.
@Test
public void onlineConstraintShouldRejectChangingEntryToAlreadyIndexedValueThatOtherTransactionsAreRemoving() throws Exception {
// Given
givenOnlineConstraint();
transaction(setProperty(b, "b"), success);
Transaction otherTx = db.beginTx();
a.removeLabel(label);
suspend(otherTx);
// When
try {
transaction(setProperty(b, "a"), success, fail("Changing a property to an already indexed value should have thrown"));
} catch (ConstraintViolationException ignore) {
// we're happy
} finally {
resume(otherTx);
otherTx.failure();
otherTx.close();
}
}
Aggregations