public void test_doAs_01(){
  Subject subj=new Subject();
  PrivilegedAction<Object> pa=new myPrivilegedAction();
  PrivilegedAction<Object> paNull=null;
  try {
    Object obj=Subject.doAs(null,pa);
  }
 catch (  Exception e) {
    fail("Unexpected exception: " + e);
  }
  try {
    Object obj=Subject.doAs(subj,pa);
  }
 catch (  Exception e) {
    fail("Unexpected exception: " + e);
  }
  try {
    Object obj=Subject.doAs(subj,paNull);
    fail("NullPointerException wasn't thrown");
  }
 catch (  NullPointerException npe) {
  }
}

public void test_doAs_01 ( ) { Subject subj = new Subject ( ) ; PrivilegedAction < Object > pa = new myPrivilegedAction ( ) ; PrivilegedAction < Object > paNull = null ; try { Object obj = Subject . doAs ( null , pa ) ; } catch ( Exception e ) { fail ( "Unexpected exception: " + e ) ; } try { Object obj = Subject . doAs ( subj , pa ) ; } catch ( Exception e ) { fail ( "Unexpected exception: " + e ) ; } try { Object obj = Subject . doAs ( subj , paNull ) ; fail ( "NullPointerException wasn't thrown" ) ; } catch ( NullPointerException npe ) { } }
javax . security . auth . subject # doas ( subject subject , privilegedaction action )
