jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcel Reutegger (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (JCR-498) TCK: ImpersonateTest#testImpersonate should allow LoginException
Date Wed, 02 Aug 2006 12:15:14 GMT
     [ http://issues.apache.org/jira/browse/JCR-498?page=all ]

Marcel Reutegger resolved JCR-498.
----------------------------------

    Fix Version/s: 1.1
       Resolution: Fixed

Fixed as suggested in revision: 427960

Thank you for reporting this issue.

> TCK: ImpersonateTest#testImpersonate should allow LoginException
> ----------------------------------------------------------------
>
>                 Key: JCR-498
>                 URL: http://issues.apache.org/jira/browse/JCR-498
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: test
>            Reporter: David Pitfield
>             Fix For: 1.1
>
>
> JSR-170 allows Session.impersonate to throw LoginException if the session lacks permission
to impersonate another user.  Some repositories may not allow any session to impersonate another
user, in which case this test would fail.
> Proposal: catch and consume LoginException.
> --- ImpersonateTest.java        (revision 422074)
> +++ ImpersonateTest.java        (working copy)
> @@ -17,11 +17,13 @@
>  package org.apache.jackrabbit.test.api;
>   
>  import org.apache.jackrabbit.test.AbstractJCRTest;
> +import org.apache.jackrabbit.test.NotExecutableException;
>   
>  import javax.jcr.Session;
>  import javax.jcr.Credentials;
>  import javax.jcr.NodeIterator;
>  import javax.jcr.Node;
> +import javax.jcr.LoginException;
>  import java.security.AccessControlException;
>   
>  /**
> @@ -40,7 +42,14 @@
>       */
>      public void testImpersonate() throws Exception {
>          // impersonate to read-only user
> -        Session session = superuser.impersonate(helper.getReadOnlyCredentials());
> +        Session session = null;
> +
> +        try {
> +            session = superuser.impersonate(helper.getReadOnlyCredentials());
> +        }
> +        catch (LoginException e) {
> +          throw new NotExecutableException("impersonate threw LoginException");
> +        }
>   
>          // get a path to test the permissions on
>          String thePath = "";

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

        

Mime
View raw message