コード例 #1
0
  /** test insert method */
  @Test
  public void testInsert() {
    UserDO userDO = new UserDO();
    userDO.setUserId("id_4_test");

    userDAO.insert(userDO);
    userDO = userDAO.queryById("id_4_test");
    System.out.print(userDO);
    Assert.assertEquals(userDO != null, true);

    userDAO.delete(userDO);
    userDO = userDAO.queryById("id_4_test");
    Assert.assertEquals(userDO == null, true);
  }
コード例 #2
0
  /** test qurey method */
  @Test
  public void testQueryById() {
    UserDO userDO = userDAO.queryById("1");

    System.out.print(userDO);

    Assert.assertEquals(userDO != null, true);
  }
コード例 #3
0
  /** test update method */
  @Test
  public void testUpdate() {
    UserDO userDO = new UserDO();
    userDO.setUserId("id_4_test");

    userDAO.insert(userDO);
    userDO = userDAO.queryById("id_4_test");
    System.out.print(userDO);
    Assert.assertEquals(userDO != null, true);

    userDO.setGroupId("group_4_test");
    userDAO.update(userDO);
    userDO = userDAO.queryById("id_4_test");
    Assert.assertEquals(userDO.getGroupId().equals("group_4_test"), true);

    userDAO.delete(userDO);
    userDO = userDAO.queryById("id_4_test");
    Assert.assertEquals(userDO == null, true);
  }