Uploaded image for project: '[Read Only] - Hippo Repository'
  1. [Read Only] - Hippo Repository
  2. REPO-1549

MockNode#hasNodes does not work correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 2.26.21, 3.2.4, 4.0.1, 4.1.0
    • Fix Version/s: 4.1.0
    • Component/s: None
    • Labels:
      None
    • Similar issues:
    • Story Points:
      0.5
    • Processed by team:
      Pulsar
    • Sprint:
      Platform Sprint 137

      Description

      Please run the following unit-test.

      import javax.jcr.Node;
      import javax.jcr.RepositoryException;
      
      import org.junit.Test;
      import org.onehippo.repository.mock.MockNode;
      
      import static org.hamcrest.Matchers.is;
      import static org.junit.Assert.assertThat;
      
      public class TestMockNode {
      
          @Test
          public void testHasNode() throws RepositoryException {
              final MockNode root = MockNode.root();
              final Node fooNode = root.addNode("foo", "hst:virtualhost");
              
              assertThat(root.hasNode("foo"), is(true));
              assertThat(root.hasNodes(), is(true));
      
              fooNode.remove();
      
              assertThat(root.getNodes().hasNext(), is(false));
              assertThat(root.hasNodes(), is(false));
          }
      }
      

      After the child node 'foo' is removed, root.hasNode() should return false. However it still returns true.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                cngo Canh Ngo (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: