private User setUpUser1()
      throws InternalErrorException, WrongAttributeAssignmentException,
          WrongAttributeValueException, WrongReferenceAttributeValueException {
    User user = new User();
    user.setFirstName("James");
    user.setMiddleName("");
    user.setLastName("Bond");
    user.setTitleBefore("");
    user.setTitleAfter("");

    return perun.getUsersManagerBl().createUser(session, user);
  }
예제 #2
0
 // --------------------------------------------------------------------------
 // --------------------------BEANS CREATORS---------------------------------
 private static User createUser(Map<String, String> beanAttr) {
   if (beanAttr == null) return null;
   User user = new User();
   user.setId(Integer.valueOf(beanAttr.get("id")).intValue());
   user.setTitleBefore(BeansUtils.eraseEscaping(beanAttr.get("titleBefore")));
   user.setTitleAfter(BeansUtils.eraseEscaping(beanAttr.get("titleAfter")));
   user.setFirstName(BeansUtils.eraseEscaping(beanAttr.get("firstName")));
   user.setLastName(BeansUtils.eraseEscaping(beanAttr.get("lastName")));
   user.setMiddleName(BeansUtils.eraseEscaping(beanAttr.get("middleName")));
   user.setServiceUser(Boolean.valueOf(beanAttr.get("serviceAccount")).booleanValue());
   return user;
 }
  private void setUpUser() throws Exception {

    user = new User();
    user.setFirstName(userFirstName);
    user.setMiddleName("");
    user.setLastName(userLastName);
    user.setTitleBefore("");
    user.setTitleAfter("");
    assertNotNull(perun.getUsersManagerBl().createUser(sess, user));
    // create new user in database
    usersForDeletion.add(user);
    // save user for deletion after testing
  }