コード例 #1
0
  @Test
  public void testGetUser() {
    UserDAO dao = new UserDAO();
    User user = dao.getUserByName("cyclops");

    System.out.println("user: "******"  " + user.getUserId());
    assertNotNull(user);
  }
コード例 #2
0
 @Test
 public void testGetUserByProject() {
   UserDAO dao = new UserDAO();
   List<User> userByProject = dao.getUserByProject(1);
   for (User user : userByProject) {
     System.out.println(user.getUserId());
   }
   assertNotNull(userByProject);
 }
コード例 #3
0
  @Test
  public void testInsertUser() {
    UserDAO dao = new UserDAO();
    int id = dao.insert(userTest);

    System.out.println("insertedUser: " + id);
    assertTrue(id > 0);

    dao.delete(userTest.getUsername());
  }