コード例 #1
0
 @Test
 public void testUserWithWrongPassWord() throws DispatchException {
   LoginResult result = dispatch.execute(new LoginAction("admin", "i don't know"));
   assertEquals(result, null);
 }
コード例 #2
0
 @Test
 public void testLoginWithAdmin() throws DispatchException {
   LoginResult result = dispatch.execute(new LoginAction("admin", md5hash("admin")));
   assertEquals(result.getUser().getUserName(), "admin");
   assertEquals(result.getUser().getUserRole(), ADMIN.getRole());
 }
コード例 #3
0
 @Test
 public void testLoginWithNotExistUser() throws DispatchException {
   LoginResult result = dispatch.execute(new LoginAction("unknown", "i don't know"));
   assertEquals(result, null);
 }