Package com.foxconn.gds.security.facade

Examples of com.foxconn.gds.security.facade.IUserAccountServices


   * 同時生成UserProfile,UserGroup
   */
  @Test
  public void testCreateUserAccount() {
    try {
      IUserAccountServices accMgr = UserAccountServices.getInstance();
      UserAccount acc;
      UserProfile pfl;
      String accId;
      for (int i = 0; i < 500; i++) {
        pfl = new UserProfile(
            ("eId-" + i), //unique
            ("name-" + i),
            ("name-" + i+ "@foxconn.com"),
            ("861350000" + i)
        );
        //
        accMgr.createUserProfile(pfl);
       
        for (int j = 0; j < 1; j++) {//Note: AS Cascade.PERSIST, only one !!!
          acc = new UserAccount(i + "-acc-" + j, "Foxconn88");
          acc.setProfile(pfl);
          //accMgr.createUserAccount(acc);
         
          //同時創建一個組與account相同,並將此account加到此組中
          Group group = new Group(acc.getAccount());
          accMgr.createGroup(group);
         
          //
          UserGroup userGroup = new UserGroup(acc, group);
          Collection<UserGroup> inGroups = new ArrayList<UserGroup>();
          inGroups.add(userGroup);
          //注:創建一個UserAccount,會同時創建UserProfile和UserGroup
          acc.setInGroups(inGroups);
          accMgr.createUserAccount(acc);
         
        }
      }
    } catch (Exception e) {
      // TODO Auto-generated catch block
View Full Code Here

TOP

Related Classes of com.foxconn.gds.security.facade.IUserAccountServices

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.