@Test
public void shouldNotAllowInvalidStringValue() throws Exception {

    NodeType constrainedType = validateTypeDefinition();
    JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_STRING);
    assertThat(prop.satisfiesConstraints(valueFor("", PropertyType.STRING), session), is(false));
    assertThat(prop.satisfiesConstraints(valueFor("foot", PropertyType.STRING), session), is(false));
    assertThat(prop.satisfiesConstraints(valueFor("abar", PropertyType.STRING), session), is(false));
    assertThat(prop.satisfiesConstraints(valueFor("bard", PropertyType.STRING), session), is(false));
    assertThat(prop.satisfiesConstraints(valueFor("baz!", PropertyType.STRING), session), is(false));
    assertThat(prop.satisfiesConstraints(valueFor("bazzat", PropertyType.STRING), session), is(false));
}