Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9821

PROPERTY_CHANGE event is not coming when property is changed of node and node moved in same session

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • lucene
    • None

    Description

       

      Change the property of source node and the move the node and save session. Property_change event is not generated. Is this expected?

       

       
      @Test
      public void testPropertyChangedAndMove() throws RepositoryException, ExecutionException, InterruptedException {
      Node testNode = getNode(TEST_PATH);
      Session session = testNode.getSession();
      Node nodeA = testNode.addNode("a");
      Node nodeT = testNode.addNode("t");
      session.save();

      ExpectationListener listener = new ExpectationListener();
      observationManager.addEventListener(listener, ALL_EVENTS, "/", true, null, null, false);

      // Added a property
      Property p = nodeA.setProperty("p", "v");
      listener.expectAdd(p);
      session.save();

      // Changed the property and moved the source node in one session
      p = nodeA.setProperty("p", "v1");
      String src1 = nodeA.getPath();
      String dst1 = nodeT.getPath() + "/b";
      session.move(src1, dst1);
      listener.expectMove(src1, dst1);
      listener.expectChange(p); // coming in missing event
      session.save();

      List<Expectation> missing = listener.getMissing(TIME_OUT, TimeUnit.SECONDS);
      assertTrue("Missing events: " + missing, missing.isEmpty());
      List<Event> unexpected = listener.getUnexpected();
      assertTrue("Unexpected events: " + unexpected, unexpected.isEmpty());
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            mohitar Mohit
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: