@Test
public void shouldAllowValidStringValue() throws Exception {

    NodeType constrainedType = validateTypeDefinition();
    JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_STRING);
    assertThat(prop.satisfiesConstraints(valueFor("foo", PropertyType.STRING), session), is(true));
    assertThat(prop.satisfiesConstraints(valueFor("bar", PropertyType.STRING), session), is(true));
    assertThat(prop.satisfiesConstraints(valueFor("barr", PropertyType.STRING), session), is(true));
    assertThat(prop.satisfiesConstraints(valueFor("barrrrrrrrr", PropertyType.STRING), session), is(true));
    assertThat(prop.satisfiesConstraints(valueFor("baz", PropertyType.STRING), session), is(true));
    assertThat(prop.satisfiesConstraints(valueFor("shabaz", PropertyType.STRING), session), is(true));
}