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

[jira] Closed: (JCR-498) TCK: ImpersonateTest#testImpersonate should allow LoginException

     [ http://issues.apache.org/jira/browse/JCR-498?page=all ]

David Pitfield closed JCR-498.
------------------------------


> 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