Index: oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/NamePathTest.java =================================================================== --- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/NamePathTest.java (revision 1773405) +++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/NamePathTest.java (working copy) @@ -26,6 +26,7 @@ import javax.jcr.Session; import com.google.common.collect.ImmutableList; +import static junit.framework.TestCase.fail; import org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider; import org.junit.After; @@ -208,6 +209,43 @@ session.getNode(n.getPath()); } + @Test + public void testCurlyBrackets() throws RepositoryException { + session.getRootNode().addNode("parent"); + + assertNodeFound(true, + "/parent", + + // TODO these should not be found + "/parent/{childA1", + "/parent/{{childA2" + ); + + assertNodeFound(false, + "/parent/childB1", + "/parent/}childB2", + "/parent/{childB3}", + "/parent/sub/childB4", + "/parent/sub/}childB5", + "/parent/sub/{childB6}", + "/parent/sub/{childB7" + ); + } + + private void assertNodeFound(boolean expected, String ... paths) { + for(String path : paths) { + try { + session.getNode(path); + if(!expected) { + fail("Expected node to be absent:" + path); + } + } catch(RepositoryException rex) { + if(expected) { + fail("Expected node to be present:" + path); + } + } + } + } private void testPaths(List paths) throws RepositoryException { for (String path : paths) {