You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Randall Hauch (JIRA)" <ji...@apache.org> on 2012/07/03 04:00:46 UTC

[jira] [Created] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Randall Hauch created JCR-3371:
----------------------------------

             Summary: TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
                 Key: JCR-3371
                 URL: https://issues.apache.org/jira/browse/JCR-3371
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-jcr-tests, JCR 2.0, test
    Affects Versions: 2.5
            Reporter: Randall Hauch
            Priority: Critical
             Fix For: 2.5.1, 2.6


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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13405891#comment-13405891 ] 

Julian Reschke edited comment on JCR-3371 at 7/3/12 1:18 PM:
-------------------------------------------------------------

Optimally, the test checks that when removeMixin succeeds, the node indeed isn't shareable anymore. Can you suggest a patch that does this and works for your repository?

(Also, as this is about test cases, downgrading from "critical bug" to "task")
                
      was (Author: reschke):
    Optimally, the test checks that when removeMixin succeeds, the node indeed isn't shareable anymore. Can you suggest a patch that does this and works for your repository?
                  
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>             Fix For: 2.5.1, 2.6
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Randall Hauch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13407067#comment-13407067 ] 

Randall Hauch commented on JCR-3371:
------------------------------------

Yes, regardless of the implementation, b2 should never be the same as b1 since at the very least b1 will no longer be in the shared set (if there still is a shared set).

So the last check is perfectly valid.
                
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>            Assignee: Julian Reschke
>             Fix For: 2.5.1, 2.6
>
>         Attachments: JCR-3371-CorrectedShareableNodeTest-logic.patch, JCR-3371.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Randall Hauch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13405977#comment-13405977 ] 

Randall Hauch edited comment on JCR-3371 at 7/3/12 6:33 PM:
------------------------------------------------------------


The existing ShareableNodeTest.testRemoveMixin() test method assumed that an implementation would 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.

This change fixes that test method to check only for the ConstraintViolationException or an UnsupportedOperationException, or if neither of those happen then the test verifies that the implementation correctly removed the mixin.

This test attempts to remove the mixin only after creating the node, adding the mixin, and then saving the session. In other words, the shareable node was never used to create a shared node. An additional test was added to test trying to remove the mixin from a node that has already been shared. Again, either the ConstraintViolationException or UnsupportedOperationException are thrown, or the test verifies that the implementation correctly removed the mixin.

Note that a local Jackrabbit build with the latest codebase completes successfully with the proposed changes.
                
      was (Author: rhauch):
    
The existing ShareableNodeTest.testRemoveMixin() test method assumed that an implementation would 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.

This change fixes that test method to check only for the ConstraintViolationException or an UnsupportedOperationException, or if neither of those happen then the test verifies that the implementation correctly removed the mixin.

This test attempts to remove the mixin only after creating the node, adding the mixin, and then saving the session. In other words, the shareable node was never used to create a shared node. An additional test was added to test trying to remove the mixin from a node that has already been shared. Again, either the ConstraintViolationException or UnsupportedOperationException are thrown, or the test verifies that the implementation correctly removed the mixin.

                  
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>             Fix For: 2.5.1, 2.6
>
>         Attachments: JCR-3371-CorrectedShareableNodeTest-logic.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Reschke updated JCR-3371:
--------------------------------

      Priority: Major  (was: Critical)
    Issue Type: Task  (was: Bug)
    
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>             Fix For: 2.5.1, 2.6
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Randall Hauch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13405920#comment-13405920 ] 

Randall Hauch commented on JCR-3371:
------------------------------------

I'll upload a patch with a proposal.
                
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>             Fix For: 2.5.1, 2.6
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13407043#comment-13407043 ] 

Julian Reschke commented on JCR-3371:
-------------------------------------

I see your point with respect to 

            assertFalse(b2.isNodeType(mixShareable));

However the last check:

            assertFalse(b2.isSame(b1)); 

should be OK, no? If b2 and b1 have different paths, and b1 is not shareable anymore, isSame() should return false, right?
                
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>            Assignee: Julian Reschke
>             Fix For: 2.5.1, 2.6
>
>         Attachments: JCR-3371-CorrectedShareableNodeTest-logic.patch, JCR-3371.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13406427#comment-13406427 ] 

Julian Reschke commented on JCR-3371:
-------------------------------------

Randall: next time can you please attach the patch in a ready-to-apply format (svn diff)?
                
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>            Assignee: Julian Reschke
>             Fix For: 2.5.1, 2.6
>
>         Attachments: JCR-3371-CorrectedShareableNodeTest-logic.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Reschke resolved JCR-3371.
---------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 2.5.1)

Patch applied with minor changes (thanks, Randall!)
                
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>            Assignee: Julian Reschke
>             Fix For: 2.6
>
>         Attachments: JCR-3371-CorrectedShareableNodeTest-logic.patch, JCR-3371.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Randall Hauch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13407085#comment-13407085 ] 

Randall Hauch commented on JCR-3371:
------------------------------------

Thanks for fixing, Julian, and also for the patience.
                
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>            Assignee: Julian Reschke
>             Fix For: 2.6
>
>         Attachments: JCR-3371-CorrectedShareableNodeTest-logic.patch, JCR-3371.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Randall Hauch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13407037#comment-13407037 ] 

Randall Hauch commented on JCR-3371:
------------------------------------

Apologies for the wrong patch format. Your additional changes are good, except for one thing that I'm not sure of. In the new 'testRemoveMixinFromSharedNode()" method, the last few lines of the proposed try block are

            // If this happens, then b1 nor b2 shouldn't be shareable anymore
            // ...
            assertFalse(b1.isNodeType(mixShareable));
            assertFalse(b2.isNodeType(mixShareable));
            assertFalse(b2.isSame(b1));

where 'b1' and 'b2' are nodes that were in the same shared set before the removal of the mixin. While it seems logical to have these checks, they do seem to go beyond what section 14.15 "RemoveMixin" in the specification requires, which actually states that the implementation "may either throw a ConstraintViolationException or allow the removal and change the subgraph in some implementation-specific manner."

I can imagine one possible behavior allowed by the spec but not allowed by this test would be if the implementation, upon the client removing the 'mix:shareable' mixin from node b1, simply removed the mixin as requested and then treated that as an "unlinking" of that node from the shared set. Per the spec, the implementation could replace b1 with a copy of the shared content, or even leave b1 as a simple node with no children. IIUC, the implementation does not require changing any of the other nodes in the shared set (which in this case consists only of b2). 

Therefore, I think the test should not assume/require that b2 is no longer shareable, and that the *second-to-last line* listed above should not be included in the change.

                
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>            Assignee: Julian Reschke
>             Fix For: 2.5.1, 2.6
>
>         Attachments: JCR-3371-CorrectedShareableNodeTest-logic.patch, JCR-3371.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Randall Hauch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Randall Hauch updated JCR-3371:
-------------------------------

    Attachment: JCR-3371-CorrectedShareableNodeTest-logic.patch


The existing ShareableNodeTest.testRemoveMixin() test method assumed that an implementation would 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.

This change fixes that test method to check only for the ConstraintViolationException or an UnsupportedOperationException, or if neither of those happen then the test verifies that the implementation correctly removed the mixin.

This test attempts to remove the mixin only after creating the node, adding the mixin, and then saving the session. In other words, the shareable node was never used to create a shared node. An additional test was added to test trying to remove the mixin from a node that has already been shared. Again, either the ConstraintViolationException or UnsupportedOperationException are thrown, or the test verifies that the implementation correctly removed the mixin.

                
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>             Fix For: 2.5.1, 2.6
>
>         Attachments: JCR-3371-CorrectedShareableNodeTest-logic.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Randall Hauch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Randall Hauch updated JCR-3371:
-------------------------------

    Status: Patch Available  (was: Open)

See "JCR-3371-CorrectedShareableNodeTest-logic.patch" attachment.
                
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>             Fix For: 2.5.1, 2.6
>
>         Attachments: JCR-3371-CorrectedShareableNodeTest-logic.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13405891#comment-13405891 ] 

Julian Reschke commented on JCR-3371:
-------------------------------------

Optimally, the test checks that when removeMixin succeeds, the node indeed isn't shareable anymore. Can you suggest a patch that does this and works for your repository?
                
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>            Priority: Critical
>             Fix For: 2.5.1, 2.6
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Reschke reassigned JCR-3371:
-----------------------------------

    Assignee: Julian Reschke
    
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>            Assignee: Julian Reschke
>             Fix For: 2.5.1, 2.6
>
>         Attachments: JCR-3371-CorrectedShareableNodeTest-logic.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Reschke updated JCR-3371:
--------------------------------

    Attachment: JCR-3371.patch

Minor changes, plus some more checks added in the new test case.
                
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>            Assignee: Julian Reschke
>             Fix For: 2.5.1, 2.6
>
>         Attachments: JCR-3371-CorrectedShareableNodeTest-logic.patch, JCR-3371.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Reschke updated JCR-3371:
--------------------------------

    Status: In Progress  (was: Patch Available)
    
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>            Assignee: Julian Reschke
>             Fix For: 2.5.1, 2.6
>
>         Attachments: JCR-3371-CorrectedShareableNodeTest-logic.patch, JCR-3371.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (JCR-3371) TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13406443#comment-13406443 ] 

Julian Reschke edited comment on JCR-3371 at 7/4/12 11:02 AM:
--------------------------------------------------------------

Minor changes, plus some more checks added in the new test case.

Randall, can you please double-check with your implementation?
                
      was (Author: reschke):
    Minor changes, plus some more checks added in the new test case.
                  
> TCK test for shareable nodes incorrectly assumes the 'mix:shareable' mixin cannot be removed
> --------------------------------------------------------------------------------------------
>
>                 Key: JCR-3371
>                 URL: https://issues.apache.org/jira/browse/JCR-3371
>             Project: Jackrabbit Content Repository
>          Issue Type: Task
>          Components: jackrabbit-jcr-tests, JCR 2.0, test
>    Affects Versions: 2.5
>            Reporter: Randall Hauch
>            Assignee: Julian Reschke
>             Fix For: 2.5.1, 2.6
>
>         Attachments: JCR-3371-CorrectedShareableNodeTest-logic.patch, JCR-3371.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira