Examples of BadBean


Examples of org.jboss.test.securitymgr.ejb.BadBean

   /** Test that a bean cannot access the SecurityAssociation class
    */
   public void testSecurityAssociation() throws Exception
   {
      log.debug("+++ testSecurityAssociation()");
      BadBean bean = getBadSession();

      try
      {
         bean.getPrincipal();
         doFail("Was able to call Bad.getPrincipal");
      }
      catch(Exception e)
      {
         log.debug("Bad.getPrincipal failed as expected", e);
      }

      try
      {
         bean.getCredential();
         doFail("Was able to call Bad.getCredential");
      }
      catch(Exception e)
      {
         log.debug("Bad.getCredential failed as expected", e);
      }

      try
      {
         bean.setPrincipal(null);
         doFail("Was able to call Bad.setPrincipal");
      }
      catch(Exception e)
      {
         log.debug("Bad.setPrincipal failed as expected", e);
      }

      try
      {
         char[] password = "secret".toCharArray();
         bean.setCredential(password);
         doFail("Was able to call Bad.setCredential");
      }
      catch(Exception e)
      {
         log.debug("Bad.setCredential failed as expected", e);
View Full Code Here

Examples of org.jboss.test.securitymgr.ejb.BadBean

      return suite;
   }

   private BadBean getBadSession()
   {
      BadBean bean = new BadBean();
      return bean;
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.