示例#1
0
 @Test
 public void testMakeOneUserAuthenticator() throws Exception {
   Authenticator a = loader.makeAuthenticator("bob:uncle");
   assertTrue(a instanceof OneUserAuthenticator);
   OneUserAuthenticator oua = (OneUserAuthenticator) a;
   assertEquals("bob", oua.getUser());
   assertEquals("uncle", oua.getPassword());
 }
示例#2
0
 @Test
 public void testMakeMultiUserAuthenticator() throws Exception {
   final String passwordFilename = "testpasswd";
   File passwd = new File(passwordFilename);
   passwd.createNewFile();
   Authenticator a = loader.makeAuthenticator(passwordFilename);
   assertTrue(a instanceof MultiUserAuthenticator);
   passwd.delete();
 }
示例#3
0
 @Test
 public void testMakeNullAuthenticator() throws Exception {
   Authenticator a = loader.makeAuthenticator(null);
   assertTrue(a instanceof PromiscuousAuthenticator);
 }