jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "chris meadows (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCR-854) allowSameNameSiblings not honoured for nt:file Node Type
Date Thu, 19 Apr 2007 11:05:16 GMT
allowSameNameSiblings not honoured for nt:file Node Type
--------------------------------------------------------

                 Key: JCR-854
                 URL: https://issues.apache.org/jira/browse/JCR-854
             Project: Jackrabbit
          Issue Type: Bug
          Components: core
    Affects Versions: 1.2.3
            Reporter: chris meadows
            Priority: Critical


It is possible to create mutiple nt:file sibling Node Types at the root of a repository:

  public void testUniqueFolders() {
    Node root = null;
    Node folder1 = null;
    Node folder2 = null;
    Session session = null;    
    try {
      Repository repository = new TransientRepository();
      session = repository.login(
            new SimpleCredentials("username", "password".toCharArray())); 
      root = session.getRootNode();
      System.out.println("root allows same name siblings: " + root.getDefinition().allowsSameNameSiblings());
      folder1 = root.addNode("myfolder",  "nt:folder");
      folder2 = root.addNode("myfolder",  "nt:folder");
      System.out.println("folder allows same name siblings: " + folder1.getDefinition().allowsSameNameSiblings());
      session.save();
      assertFalse( folder1.isSame(folder2) );
      fail("Expected ItemExistsException");
    }
    catch (Exception e) {
      e.printStackTrace(System.err);
      fail(e.getMessage());
    }
    finally {
      try {
        folder1.remove();
        folder2.remove();
        session.save();
      }
      catch (RepositoryException e) {
        e.printStackTrace(System.err);
        fail(e.getMessage());
      }
      
    }
    
  }  


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message