The latest cvs code throws a SecurityException wrapped in a RemoteException so you
can identify a security exception by looking at the remote exception detail value:

try
{
    ...
}
catch(RemoteException e)
{
    if( e.detail instance of SecurityException )
        System.out.println("Security violation");
}

----- Original Message ----- 
From: "Alexander Klyubin" <[EMAIL PROTECTED]>
To: "Jboss-User" <[EMAIL PROTECTED]>; "Jboss-Dev" 
<[EMAIL PROTECTED]>
Sent: Friday, January 19, 2001 4:00 AM
Subject: [jBoss-User] Testing bean security with JUnit


> Hi!
> 
> Has somebody figured out how to test bean security on the client side with
> JUnit? My problem is that I want to test whether security works as it should
> for certain beans' methods (by the business rules). In case access is denied
> to client with particular roles/principal how do I know (in the client code)
> whether RemoteException is connected to security or to other problems? Can I
> somehow differentiate between these two types of remote exceptions caught on
> the client side without parsing exception text?
> 
> Alexander Klyubin
> 




--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to