Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3371

TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed




      The ShareableNodeTest.testRemoveMixin() assumes that removing the "mix:shareable" mixin will always throw an UnsupportedOperationException. This is not only checking for the incorrect exception, section 14.15 "RemoveMixin" specifically states that it is possible for an implementation to support removing the 'mix:shareable' mixin:

      "If an attempt is made to remove the mix:shareable mixin node type from a node in a
      shared set the implementation may either throw a ConstraintViolationException or allow
      the removal and change the subgraph in some implementation-specific manner.
      One possibility is to replace the node with a copy that has no children (if this does not
      violate the node type restrictions of that node). Another possibility is to give the node
      a copy of all of its descendants (unless the resulting copy operation would be unfeasible,
      as would be the case if a share cycle were involved)."

      Thus, even though it is possible for an implementation not to allow removing the "mix:shareable" mixin, the test shouldn't expect that an implementation will throw an exception. For example, one particularly easy thing for an implementation to support is removing 'mix:shareable' if and only if there are no other shared nodes (e.g., the "getSharedSet().getSize() == 1").

      This test could be removed, or perhaps it might be possible to test that removing the mixin (and saving) will either succeed or will throws only a ConstraintViolationException.

      I marked as critical because the TCK test prevents other implementations from correctly proving compatibility.


        1. JCR-3371-CorrectedShareableNodeTest-logic.patch
          4 kB
          Randall Hauch
        2. JCR-3371.patch
          4 kB
          Julian Reschke



            reschke Julian Reschke
            rhauch Randall Hauch
            0 Vote for this issue
            2 Start watching this issue