Package org.makersoft.shards.domain

Examples of org.makersoft.shards.domain.User


      String username = "makersoft_" + i;
      String password = "makersoft_" + i;
      int age = random.nextInt(30);
      int gender = (i % 2 == 0) ? User.SEX_MALE : User.SEX_FEMALE;
     
      User user = this.insertUser(username, password, age, gender);
      Assert.assertNotNull(user.getId());
    }
   
    List<User> users = userMapper.findByGender(User.SEX_MALE);
    Assert.assertEquals(5, users.size());
  }
View Full Code Here


  }
 
  @Test
  @Transactional
  public void testGetById() throws Exception{
    User user = this.insertUser("makersoft", "makersoft", 26, User.SEX_MALE);
    User result = userMapper.getById(user.getId());
   
    Assert.assertNotNull(result);
   
    Assert.assertEquals(user, result);
  }
View Full Code Here

  }
 
  @Test
  @Transactional
  public void testDeleteById() throws Exception{
    User user = this.insertUser("makersoft", "makersoft", 26, User.SEX_MALE);
    int rows = userMapper.deleteById(user.getId());
    Assert.assertEquals(1, rows);
   
    user = userMapper.getById(user.getId());
   
    Assert.assertNull(user);
   
  }
View Full Code Here

      String username = "makersoft_" + i;
      String password = "makersoft_" + i;
      int age = random.nextInt(30);
      int gender = (i % 2 == 0) ? User.SEX_MALE : User.SEX_FEMALE;
     
      User user = this.insertUser(username, password, age, gender);
      Assert.assertNotNull(user.getId());
    }
   
    int rows = userMapper.deleteAll();
    Assert.assertEquals(10, rows);
   
View Full Code Here

 
  /**
   * for insert new user
   */
  private User insertUser(String username, String password, int age,  int gender){
    User user = new User(username, password, gender);
    user.setAge(age);
    userMapper.insertUser(user);
   
    Assert.assertNotNull(user.getId());
   
    return user;
  }
View Full Code Here

TOP

Related Classes of org.makersoft.shards.domain.User

Copyright © 2018 www.massapicom. 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.