You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Julian Reschke (JIRA)" <ji...@apache.org> on 2006/08/10 15:00:13 UTC

[jira] Created: (JCR-540) AbstractJCRTest fails on level 1 repositories

AbstractJCRTest fails on level 1 repositories
---------------------------------------------

                 Key: JCR-540
                 URL: http://issues.apache.org/jira/browse/JCR-540
             Project: Jackrabbit
          Issue Type: Bug
          Components: JCR TCK
            Reporter: Julian Reschke
            Priority: Minor


If a test case indicates that it's not read-only, org.apache.jackrabbit.test.AbstractJCRTest tries to cleanup the test root in the setUp method. This will cause the test case to fail, because a Level 1 repository will throw an UnsupportedOperationException here.

Proposal: before trying the cleanup, check for L2 functionality and throw a NotExecutableException otherwise:

            if (! isSupported(Repository.LEVEL_2_SUPPORTED)) {
              cleanUp();
              String msg = "Test case requires level 2 functionality";
              throw new NotExecutableException(msg);
            }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JCR-540) AbstractJCRTest fails on level 1 repositories

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-540?page=all ]

Marcel Reutegger updated JCR-540:
---------------------------------

    Issue Type: Bug  (was: Improvement)

I agree. This session leak should be fixed. Which means this is indeed a bug not an enhancement.

> AbstractJCRTest fails on level 1 repositories
> ---------------------------------------------
>
>                 Key: JCR-540
>                 URL: http://issues.apache.org/jira/browse/JCR-540
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: JCR TCK
>            Reporter: Julian Reschke
>            Priority: Minor
>         Attachments: JCR-540.diff.txt, JCR-540.diff.txt
>
>
> If a test case indicates that it's not read-only, org.apache.jackrabbit.test.AbstractJCRTest tries to cleanup the test root in the setUp method. This will cause the test case to fail, because a Level 1 repository will throw an UnsupportedOperationException here.
> Proposal: before trying the cleanup, check for L2 functionality and throw a NotExecutableException otherwise:
>             if (! isSupported(Repository.LEVEL_2_SUPPORTED)) {
>               cleanUp();
>               String msg = "Test case requires level 2 functionality";
>               throw new NotExecutableException(msg);
>             }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (JCR-540) AbstractJCRTest fails on level 1 repositories

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-540?page=all ]

Marcel Reutegger resolved JCR-540.
----------------------------------

    Fix Version/s: 1.1
       Resolution: Fixed

Applied JCR-540-svn430367.patch.

svn revision: 430758

Thank you for reporting this issue.

> AbstractJCRTest fails on level 1 repositories
> ---------------------------------------------
>
>                 Key: JCR-540
>                 URL: http://issues.apache.org/jira/browse/JCR-540
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: JCR TCK
>            Reporter: Julian Reschke
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: JCR-540-svn430367.patch, JCR-540.diff.txt, JCR-540.diff.txt
>
>
> If a test case indicates that it's not read-only, org.apache.jackrabbit.test.AbstractJCRTest tries to cleanup the test root in the setUp method. This will cause the test case to fail, because a Level 1 repository will throw an UnsupportedOperationException here.
> Proposal: before trying the cleanup, check for L2 functionality and throw a NotExecutableException otherwise:
>             if (! isSupported(Repository.LEVEL_2_SUPPORTED)) {
>               cleanUp();
>               String msg = "Test case requires level 2 functionality";
>               throw new NotExecutableException(msg);
>             }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JCR-540) AbstractJCRTest fails on level 1 repositories

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-540?page=comments#action_12427467 ] 
            
Marcel Reutegger commented on JCR-540:
--------------------------------------

> I'd still like to see an easy way to find out whether a repository supports L1 completely.

Yes, there is the official TCK, which comes with a test harness that executes the various test cases grouped in the specified compliance levels and optional features. There you can easily see which level 1 tests failed.

See: 
http://jcp.org/aboutJava/communityprocess/final/jsr170/index.html
and
http://www.day.com/site/en/index/related/downloads/tck_form.html

Please note that the currently available TCK is based on the test cases present in the jackrabbit branch ri-1.0. While you are the test cases from jackrabbit trunk, which will eventually go into a maintenance release of the TCK at some time.

> AbstractJCRTest fails on level 1 repositories
> ---------------------------------------------
>
>                 Key: JCR-540
>                 URL: http://issues.apache.org/jira/browse/JCR-540
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: JCR TCK
>            Reporter: Julian Reschke
>            Priority: Minor
>         Attachments: JCR-540-svn430367.patch, JCR-540.diff.txt, JCR-540.diff.txt
>
>
> If a test case indicates that it's not read-only, org.apache.jackrabbit.test.AbstractJCRTest tries to cleanup the test root in the setUp method. This will cause the test case to fail, because a Level 1 repository will throw an UnsupportedOperationException here.
> Proposal: before trying the cleanup, check for L2 functionality and throw a NotExecutableException otherwise:
>             if (! isSupported(Repository.LEVEL_2_SUPPORTED)) {
>               cleanUp();
>               String msg = "Test case requires level 2 functionality";
>               throw new NotExecutableException(msg);
>             }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JCR-540) AbstractJCRTest fails on level 1 repositories

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-540?page=comments#action_12427233 ] 
            
Julian Reschke commented on JCR-540:
------------------------------------

Well.

I can't run api.TestAll on a level 1 rep, because the cleanup code tails, and leaves dangling sessions. So - at least over here - the test suite never terminates. Can we agree that at a minimum, that needs to be fixed?

Furthermore, is there a way to run just the level 1 tests? If not, how is a tester supposed to know whether the repository is L1 compliant without having to investigate each and every test failure?



> AbstractJCRTest fails on level 1 repositories
> ---------------------------------------------
>
>                 Key: JCR-540
>                 URL: http://issues.apache.org/jira/browse/JCR-540
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: JCR TCK
>            Reporter: Julian Reschke
>            Priority: Minor
>         Attachments: JCR-540.diff.txt
>
>
> If a test case indicates that it's not read-only, org.apache.jackrabbit.test.AbstractJCRTest tries to cleanup the test root in the setUp method. This will cause the test case to fail, because a Level 1 repository will throw an UnsupportedOperationException here.
> Proposal: before trying the cleanup, check for L2 functionality and throw a NotExecutableException otherwise:
>             if (! isSupported(Repository.LEVEL_2_SUPPORTED)) {
>               cleanUp();
>               String msg = "Test case requires level 2 functionality";
>               throw new NotExecutableException(msg);
>             }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JCR-540) AbstractJCRTest fails on level 1 repositories

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-540?page=all ]

Julian Reschke updated JCR-540:
-------------------------------

    Attachment: JCR-540.diff.txt

Proposed patch.

> AbstractJCRTest fails on level 1 repositories
> ---------------------------------------------
>
>                 Key: JCR-540
>                 URL: http://issues.apache.org/jira/browse/JCR-540
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: JCR TCK
>            Reporter: Julian Reschke
>            Priority: Minor
>         Attachments: JCR-540.diff.txt
>
>
> If a test case indicates that it's not read-only, org.apache.jackrabbit.test.AbstractJCRTest tries to cleanup the test root in the setUp method. This will cause the test case to fail, because a Level 1 repository will throw an UnsupportedOperationException here.
> Proposal: before trying the cleanup, check for L2 functionality and throw a NotExecutableException otherwise:
>             if (! isSupported(Repository.LEVEL_2_SUPPORTED)) {
>               cleanUp();
>               String msg = "Test case requires level 2 functionality";
>               throw new NotExecutableException(msg);
>             }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JCR-540) AbstractJCRTest fails on level 1 repositories

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-540?page=all ]

Marcel Reutegger updated JCR-540:
---------------------------------

    Attachment: JCR-540-svn430367.patch

Thank you for the patch. I slightly changed your proposal because I would rather like to call fail() instead of throwing a RepositoryException.

WDYT?

Does that work for you?

> AbstractJCRTest fails on level 1 repositories
> ---------------------------------------------
>
>                 Key: JCR-540
>                 URL: http://issues.apache.org/jira/browse/JCR-540
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: JCR TCK
>            Reporter: Julian Reschke
>            Priority: Minor
>         Attachments: JCR-540-svn430367.patch, JCR-540.diff.txt, JCR-540.diff.txt
>
>
> If a test case indicates that it's not read-only, org.apache.jackrabbit.test.AbstractJCRTest tries to cleanup the test root in the setUp method. This will cause the test case to fail, because a Level 1 repository will throw an UnsupportedOperationException here.
> Proposal: before trying the cleanup, check for L2 functionality and throw a NotExecutableException otherwise:
>             if (! isSupported(Repository.LEVEL_2_SUPPORTED)) {
>               cleanUp();
>               String msg = "Test case requires level 2 functionality";
>               throw new NotExecutableException(msg);
>             }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JCR-540) AbstractJCRTest fails on level 1 repositories

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-540?page=all ]

Marcel Reutegger updated JCR-540:
---------------------------------

    Issue Type: Improvement  (was: Bug)

This is done on purpose. Throwing a NotExecutableException will indicate to the TCK that the test case
did not fail even though it did not run. Hence the test was successful.

If all Level 2 tests on a Level 1 repository throw NotExecutableExceptions the TCK would finally declare the Repository Level 2 compliant which is not the case.

Failing Level 2 test cases of a Level 1 repository do *not* have an effect on its Level 1 compliance.

> AbstractJCRTest fails on level 1 repositories
> ---------------------------------------------
>
>                 Key: JCR-540
>                 URL: http://issues.apache.org/jira/browse/JCR-540
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: JCR TCK
>            Reporter: Julian Reschke
>            Priority: Minor
>         Attachments: JCR-540.diff.txt
>
>
> If a test case indicates that it's not read-only, org.apache.jackrabbit.test.AbstractJCRTest tries to cleanup the test root in the setUp method. This will cause the test case to fail, because a Level 1 repository will throw an UnsupportedOperationException here.
> Proposal: before trying the cleanup, check for L2 functionality and throw a NotExecutableException otherwise:
>             if (! isSupported(Repository.LEVEL_2_SUPPORTED)) {
>               cleanUp();
>               String msg = "Test case requires level 2 functionality";
>               throw new NotExecutableException(msg);
>             }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JCR-540) AbstractJCRTest fails on level 1 repositories

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-540?page=all ]

Julian Reschke updated JCR-540:
-------------------------------

    Attachment: JCR-540.diff.txt

New proposed patch, not using NotExecutableException.

I'd still like to see an easy way to find out whether a repository supports L1 completely. Did I miss something? If not, should I open a separate issue?


> AbstractJCRTest fails on level 1 repositories
> ---------------------------------------------
>
>                 Key: JCR-540
>                 URL: http://issues.apache.org/jira/browse/JCR-540
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: JCR TCK
>            Reporter: Julian Reschke
>            Priority: Minor
>         Attachments: JCR-540.diff.txt, JCR-540.diff.txt
>
>
> If a test case indicates that it's not read-only, org.apache.jackrabbit.test.AbstractJCRTest tries to cleanup the test root in the setUp method. This will cause the test case to fail, because a Level 1 repository will throw an UnsupportedOperationException here.
> Proposal: before trying the cleanup, check for L2 functionality and throw a NotExecutableException otherwise:
>             if (! isSupported(Repository.LEVEL_2_SUPPORTED)) {
>               cleanUp();
>               String msg = "Test case requires level 2 functionality";
>               throw new NotExecutableException(msg);
>             }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JCR-540) AbstractJCRTest fails on level 1 repositories

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-540?page=comments#action_12427479 ] 
            
Julian Reschke commented on JCR-540:
------------------------------------

Marcel, yes that patch works for me. Thanks.


> AbstractJCRTest fails on level 1 repositories
> ---------------------------------------------
>
>                 Key: JCR-540
>                 URL: http://issues.apache.org/jira/browse/JCR-540
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: JCR TCK
>            Reporter: Julian Reschke
>            Priority: Minor
>         Attachments: JCR-540-svn430367.patch, JCR-540.diff.txt, JCR-540.diff.txt
>
>
> If a test case indicates that it's not read-only, org.apache.jackrabbit.test.AbstractJCRTest tries to cleanup the test root in the setUp method. This will cause the test case to fail, because a Level 1 repository will throw an UnsupportedOperationException here.
> Proposal: before trying the cleanup, check for L2 functionality and throw a NotExecutableException otherwise:
>             if (! isSupported(Repository.LEVEL_2_SUPPORTED)) {
>               cleanUp();
>               String msg = "Test case requires level 2 functionality";
>               throw new NotExecutableException(msg);
>             }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira