Package org.jboss.test.security.interfaces

Examples of org.jboss.test.security.interfaces.IOSession


      login();
      Object obj = getInitialContext().lookup("security-proxy/ProxiedStatelessBean");
      obj = PortableRemoteObject.narrow(obj, IOSessionHome.class);
      IOSessionHome home = (IOSessionHome) obj;
      log.debug("Found IOSessionHome");
      IOSession bean = home.create();
      log.debug("Created IOSession");
     
      try
      {
         // This should not be allowed
         bean.read("/restricted/pgp.keys");
         fail("Was able to call read(/restricted/pgp.keys)");
      }
      catch(RemoteException e)
      {
         log.debug("IOSession.read failed as expected");
      }
      bean.read("/public/pgp.keys");

      try
      {
         // This should not be allowed
         bean.retryableRead("/restricted/pgp.keys");
         fail("Was able to call read(/restricted/pgp.keys)");
      }
      catch(ReadAccessException e)
      {
         log.debug("IOSession.read failed as expected with ReadAccessException");
         bean.read("/public/pgp.keys");
      }

      try
      {
         // This should not be allowed
         bean.write("/restricted/pgp.keys");
         fail("Was able to call write(/restricted/pgp.keys)");
      }
      catch(RemoteException e)
      {
         log.debug("IOSession.write failed as expected");
      }
      bean.write("/public/pgp.keys");

      bean.remove();
   }
View Full Code Here

TOP

Related Classes of org.jboss.test.security.interfaces.IOSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.