@Test
public void shouldAllowValidPathValue() throws Exception {

    NodeType constrainedType = validateTypeDefinition();
    JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_PATH);
    assertThat(prop.satisfiesConstraints(valueFor("b", PropertyType.PATH), session), is(true));
    assertThat(prop.satisfiesConstraints(valueFor("/a/b/c", PropertyType.PATH), session), is(true));
    assertThat(prop.satisfiesConstraints(valueFor("/jcr:system/mode:namespace", PropertyType.PATH), session), is(true));
    assertThat(prop.satisfiesConstraints(valueFor("/a/b/c/", PropertyType.PATH), session), is(true));
    // Test that constraints work after session rename
    session.setNamespacePrefix("jcr2", JcrLexicon.Namespace.URI);
    assertThat(prop.satisfiesConstraints(valueFor("/jcr2:system/mode:foo", PropertyType.PATH), session), is(true));
}