[ 
https://issues.apache.org/jira/browse/JCR-2666?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Randall Hauch updated JCR-2666:
-------------------------------

    Attachment: 0001-JCR-2666-Corrected-expectation-for-a-test-in-Restore.patch

Attached a patch file that corrects the 'testRestoreNameJcr2()' test in the 
'org.apache.jackrabbit.test.version.RestoreTest' JCR TCK test case.

The change replaces the last 3 lines of the test (which incorrectly expect the 
version of the child to change) with the last 3 lines (plus comment) from the 
'testRestoreName()' test method. The latter tests the "Node.restore(String 
versionName, boolean removeExisting)" method that was deprecated in JCR 2.0 and 
has comments reflecting the change in behavior in JCR 2.0, while the test in 
question tests the "VersionManager.restore(String path, String versionName, 
boolean removeExisting)" method that was added in JCR 2.0 to replace the 
deprecated Node-based method. The tests should expect similar results, since 
the Node-based method can be replaced with the VersionManager-based method.

Unfortunately, when applying this change, Jackrabbit Core now fails this test. 
So, either this is a problem within Jackrabbit Core, or the test is indeed 
correct and the VersionManager-based "restore" method does not and should not 
have the same behavior as the deprecated Node-based method.

I'm not a Jackrabbit Core developer (I am interested in contributing to and 
correcting the TCK tests), I'm not sure what to do next. Please advise.
                
> JCR TCK Test for Restoring Version Tests That Versionable Child Is also 
> Restored, contrary to JCR 2.0 specification
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-2666
>                 URL: https://issues.apache.org/jira/browse/JCR-2666
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jcr-tests, JCR 2.0
>    Affects Versions: 2.1
>            Reporter: Brian Carothers
>         Attachments: 
> 0001-JCR-2666-Corrected-expectation-for-a-test-in-Restore.patch
>
>
> The test case testRestoreNameJcr2 in o.a.j.test.version.RestoreTest, ends by 
> validating that restoring a versionable parent also restores its versionable 
> child.  This was the correct behavior in JCR 1.0, but was changed in JCR 21]. 
>  The testRestoreName method in the same class correctly notes this and 
> changed the behavior for JCR 2.
> This can be corrected by replacing the last 3 lines of testRestoreNameJcr2 
> with something analogous to the last 5 lines of testRestoreName.
> Thanks!
> [1] - JCR2 specification, section 15.7.5 - "If the workspace currently has an 
> already existing node corresponding to C's version history and the 
> removeExisting flag of the restore is set to true, then that instance of C 
> becomes the child of the restored N."

--
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

        

Reply via email to