Package org.jboss.security.auth.callback

Examples of org.jboss.security.auth.callback.AppCallbackHandler.handle()


   public void testUserNamePassword() throws Exception
   {
      AppCallbackHandler apc = new AppCallbackHandler("jduke","theduke".toCharArray());
      //Create the Callbacks
      Callback[] cb = new Callback[]{ncb,pcb};
      apc.handle(cb);
      assertTrue("jduke", "jduke".equals(ncb.getName()));
      assertTrue("theduke","theduke".equals(new String(pcb.getPassword())) );
   }
  
   public void testMapCallback() throws Exception
View Full Code Here


      HashMap hm = new HashMap();
      hm.put("jduke","theduke");
      hm.put("scott","echoman");
      AppCallbackHandler apc = new AppCallbackHandler(hm);
      Callback[] cb = new Callback[]{mcb};
      apc.handle(cb);
      assertTrue("jduke=theduke", "theduke".equals(mcb.getInfo("jduke")));
      assertTrue("scott=echoman", "echoman".equals(mcb.getInfo("scott")));
   }
  
   public void testByteArrayCallback() throws Exception
View Full Code Here

   {
      AppCallbackHandler apc = new AppCallbackHandler("scott",
                      "echoman".toCharArray(), "Loves Skiing!!!".getBytes());
      //Create the Callbacks
      Callback[] cb = new Callback[]{ncb,pcb,bacb};
      apc.handle(cb);
      assertTrue("scott", "scott".equals(ncb.getName()));
      assertTrue("echoman","echoman".equals(new String(pcb.getPassword())) );
      assertTrue("Loves Skiing!!!",
            "Loves Skiing!!!".equals(new String(bacb.getByteArray())));
   }
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.