public void test_PasswordCallback(){
  String prompt="promptTest";
  try {
    PasswordCallback pc=new PasswordCallback(prompt,true);
    assertNotNull("Null object returned",pc);
    assertEquals(prompt,pc.getPrompt());
    assertEquals(true,pc.isEchoOn());
  }
 catch (  Exception e) {
    fail("Unexpected exception: " + e);
  }
  try {
    PasswordCallback pc=new PasswordCallback(prompt,false);
    assertNotNull("Null object returned",pc);
    assertEquals(prompt,pc.getPrompt());
    assertEquals(false,pc.isEchoOn());
  }
 catch (  Exception e) {
    fail("Unexpected exception: " + e);
  }
  try {
    PasswordCallback pc=new PasswordCallback(null,true);
    fail("IllegalArgumentException wasn't thrown");
  }
 catch (  IllegalArgumentException npe) {
  }
  try {
    PasswordCallback pc=new PasswordCallback("",true);
    fail("IllegalArgumentException wasn't thrown");
  }
 catch (  IllegalArgumentException npe) {
  }
}

public void test_PasswordCallback ( ) { String prompt = "promptTest" ; try { PasswordCallback pc = new PasswordCallback ( prompt , true ) ; assertNotNull ( "Null object returned" , pc ) ; assertEquals ( prompt , pc . getPrompt ( ) ) ; assertEquals ( true , pc . isEchoOn ( ) ) ; } catch ( Exception e ) { fail ( "Unexpected exception: " + e ) ; } try { PasswordCallback pc = new PasswordCallback ( prompt , false ) ; assertNotNull ( "Null object returned" , pc ) ; assertEquals ( prompt , pc . getPrompt ( ) ) ; assertEquals ( false , pc . isEchoOn ( ) ) ; } catch ( Exception e ) { fail ( "Unexpected exception: " + e ) ; } try { PasswordCallback pc = new PasswordCallback ( null , true ) ; fail ( "IllegalArgumentException wasn't thrown" ) ; } catch ( IllegalArgumentException npe ) { } try { PasswordCallback pc = new PasswordCallback ( "" , true ) ; fail ( "IllegalArgumentException wasn't thrown" ) ; } catch ( IllegalArgumentException npe ) { } }
javax . security . auth . callback . passwordcallback # passwordcallback ( string prompt , boolean echoon ) javax . security . auth . callback . passwordcallback # getprompt ( ) javax . security . auth . callback . passwordcallback # isechoon ( )
