User: peter   
  Date: 01/01/07 15:14:37

  Modified:    src/main/org/jboss/test/cts/ejb StatefulSessionBean.java
  Log:
  Trying to get JAAS to work within test suite.
  
  Revision  Changes    Path
  1.6       +16 -7     
jbosstest/src/main/org/jboss/test/cts/ejb/StatefulSessionBean.java
  
  Index: StatefulSessionBean.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jbosstest/src/main/org/jboss/test/cts/ejb/StatefulSessionBean.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- StatefulSessionBean.java  2001/01/05 01:24:10     1.5
  +++ StatefulSessionBean.java  2001/01/07 23:14:37     1.6
  @@ -16,7 +16,7 @@
    *
    *   @see <related>
    *   @author $Author: peter $
  - *   @version $Revision: 1.5 $
  + *   @version $Revision: 1.6 $
    */
   
   public class StatefulSessionBean
  @@ -146,6 +146,7 @@
       */
   
      public BeanContextInfo getBeanContextInfo ()
  +     throws java.rmi.RemoteException
      {
         BeanContextInfo ctx = new BeanContextInfo();
   
  @@ -160,15 +161,22 @@
         Class homeInterface = sessionCtx.getEJBHome().getClass();
   
         ctx.homeInterface = homeInterface.getName();
  +
  +      System.out.println("Getting CallerPrincipal...");
  +      Principal principal = sessionCtx.getCallerPrincipal();
  +
  +      if( principal == null )
  +      {
  +       System.out.println( "Went to get 'Principal', principal is null!" );
  +       throw new java.rmi.RemoteException( "Unable to get Principal, 
getCallerPrincipal() returned NULL");
  +      }
   
  -      //System.out.println("Getting CallerPrincipal...");
  -      //Principal principal = sessionCtx.getCallerPrincipal();
  -      //ctx.principleName = principal.getName();
  +      ctx.principleName = principal.getName();
         //ctx.isCallerInRole = sessionCtx.isCallerInRole();
  -      System.out.println("calling setRollbackOnly( ) on context");
  -      sessionCtx.setRollbackOnly();
  +      //System.out.println("calling setRollbackOnly( ) on context");
  +      //sessionCtx.setRollbackOnly();
   
  -      ctx.isRollbackOnly = new Boolean(sessionCtx.getRollbackOnly());
  +      //ctx.isRollbackOnly = new Boolean(sessionCtx.getRollbackOnly());
   
         return ctx;
      }
  @@ -194,6 +202,7 @@
         {
          System.out.println( "Could not locate bean instance" );
         }
  +      
      }
   
      /**
  
  
  

Reply via email to