behavior for ultra-long node names (not paths)
add test for creation that either expects success or a ContraintViolationException (currently ignored)
@@ -22,8 +22,10 @@ import java.util.ArrayList;
import javax.jcr.Node;
import javax.jcr.Session;
+import javax.jcr.nodetype.ConstraintViolationException;
import org.apache.jackrabbit.oak.fixture.NodeStoreFixture;
+import org.junit.Ignore;
import org.junit.Test;
public class LongPathTest extends AbstractRepositoryTest {
@@ -58,4 +60,28 @@ public class LongPathTest extends AbstractRepositoryTest {
s2.logout();
}
+ @Test
+ @Ignore("OAK-1629")
+ public void testLongName() throws Exception {
+
+ try {
+ Session s = getAdminSession();
+
+ StringBuilder buff = new StringBuilder();
+ for (int i = 0; i < 100; i++) {
+ buff.append("0123456789");
+ }
+ String longName = "n" + buff.toString();
+ Node n = s.getRootNode().addNode(longName);
+ s.save();
+
+ Session s2 = createAdminSession();
+ Node n2 = s2.getRootNode().getNode(longName);
+ assertEquals(n.getPath(), n2.getPath());
+
+ s2.logout();
+ } catch (ConstraintViolationException ex) {
+ // acceptable
+ }
+ }
}
\ No newline at end of file
