@Test
@FixFor( "MODE-1857" )
public void shouldAllowOverridingOfPropertyDefinitionsWithResidualDefinitions() throws Exception {

    InputStream cnd = getClass().getClassLoader().getResourceAsStream("cnd/overridingPropertyDefinitionWithResidual.cnd");
    assertThat(cnd, is(notNullValue()));
    session.getWorkspace().getNodeTypeManager().registerNodeTypes(cnd, true);
    Node car = session.getRootNode().addNode("car", "car");
    car.setProperty("engine", "4CYL");
    Node cycle = session.getRootNode().addNode("cycle", "motorcycle");
    cycle.setProperty("engine", "2CYL");
    session.save();
    try {
        car.setProperty("engine", "2CYL");
        fail("Should not have allowed setting the 'engine' property on a node of type 'car' to \"2CYL\"");
    } catch (ConstraintViolationException e) {
        // expected ...
    }
    try {
        cycle.setProperty("engine", "4CYL");
        fail("Should not have allowed setting the 'engine' property on a node of type 'car' to \"2CYL\"");
    } catch (ConstraintViolationException e) {
        // expected ...
    }
}