@Test
public void shouldAllowValidNameValue() throws Exception {

    NodeType constrainedType = validateTypeDefinition();
    JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_NAME);
    assertThat(prop.satisfiesConstraints(valueFor("jcr:system", PropertyType.NAME), session), is(true));
    assertThat(prop.satisfiesConstraints(valueFor("modetest:constrainedType", PropertyType.NAME), session), is(true));
    // Test that names work across namespace remaps
    session.setNamespacePrefix("newprefix", TestLexicon.Namespace.URI);
    assertThat(prop.satisfiesConstraints(valueFor("newprefix:constrainedType", PropertyType.NAME), session), is(true));
}