@Test
public void shouldNotAllowInvalidLongValue() throws Exception {

    NodeType constrainedType = validateTypeDefinition();
    JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_LONG);
    assertThat(prop.satisfiesConstraints(valueFor(5, PropertyType.LONG), session), is(false));
    assertThat(prop.satisfiesConstraints(valueFor(9, PropertyType.LONG), session), is(false));
    assertThat(prop.satisfiesConstraints(valueFor(20, PropertyType.LONG), session), is(false));
    assertThat(prop.satisfiesConstraints(valueFor(30, PropertyType.LONG), session), is(false));
    assertThat(prop.satisfiesConstraints(valueFor(41, PropertyType.LONG), session), is(false));
    assertThat(prop.satisfiesConstraints(valueFor(49, PropertyType.LONG), session), is(false));
}