コード例 #1
0
  /**
   * Converts the soap model instance into a normal model instance.
   *
   * @param soapModel the soap model instance to convert
   * @return the normal model instance
   */
  public static PasswordPolicy toModel(PasswordPolicySoap soapModel) {
    if (soapModel == null) {
      return null;
    }

    PasswordPolicy model = new PasswordPolicyImpl();

    model.setMvccVersion(soapModel.getMvccVersion());
    model.setUuid(soapModel.getUuid());
    model.setPasswordPolicyId(soapModel.getPasswordPolicyId());
    model.setCompanyId(soapModel.getCompanyId());
    model.setUserId(soapModel.getUserId());
    model.setUserName(soapModel.getUserName());
    model.setCreateDate(soapModel.getCreateDate());
    model.setModifiedDate(soapModel.getModifiedDate());
    model.setDefaultPolicy(soapModel.getDefaultPolicy());
    model.setName(soapModel.getName());
    model.setDescription(soapModel.getDescription());
    model.setChangeable(soapModel.getChangeable());
    model.setChangeRequired(soapModel.getChangeRequired());
    model.setMinAge(soapModel.getMinAge());
    model.setCheckSyntax(soapModel.getCheckSyntax());
    model.setAllowDictionaryWords(soapModel.getAllowDictionaryWords());
    model.setMinAlphanumeric(soapModel.getMinAlphanumeric());
    model.setMinLength(soapModel.getMinLength());
    model.setMinLowerCase(soapModel.getMinLowerCase());
    model.setMinNumbers(soapModel.getMinNumbers());
    model.setMinSymbols(soapModel.getMinSymbols());
    model.setMinUpperCase(soapModel.getMinUpperCase());
    model.setRegex(soapModel.getRegex());
    model.setHistory(soapModel.getHistory());
    model.setHistoryCount(soapModel.getHistoryCount());
    model.setExpireable(soapModel.getExpireable());
    model.setMaxAge(soapModel.getMaxAge());
    model.setWarningTime(soapModel.getWarningTime());
    model.setGraceLimit(soapModel.getGraceLimit());
    model.setLockout(soapModel.getLockout());
    model.setMaxFailure(soapModel.getMaxFailure());
    model.setLockoutDuration(soapModel.getLockoutDuration());
    model.setRequireUnlock(soapModel.getRequireUnlock());
    model.setResetFailureCount(soapModel.getResetFailureCount());
    model.setResetTicketMaxAge(soapModel.getResetTicketMaxAge());

    return model;
  }
コード例 #2
0
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = ServiceTestUtil.nextLong();

    PasswordPolicy newPasswordPolicy = _persistence.create(pk);

    newPasswordPolicy.setCompanyId(ServiceTestUtil.nextLong());

    newPasswordPolicy.setUserId(ServiceTestUtil.nextLong());

    newPasswordPolicy.setUserName(ServiceTestUtil.randomString());

    newPasswordPolicy.setCreateDate(ServiceTestUtil.nextDate());

    newPasswordPolicy.setModifiedDate(ServiceTestUtil.nextDate());

    newPasswordPolicy.setDefaultPolicy(ServiceTestUtil.randomBoolean());

    newPasswordPolicy.setName(ServiceTestUtil.randomString());

    newPasswordPolicy.setDescription(ServiceTestUtil.randomString());

    newPasswordPolicy.setChangeable(ServiceTestUtil.randomBoolean());

    newPasswordPolicy.setChangeRequired(ServiceTestUtil.randomBoolean());

    newPasswordPolicy.setMinAge(ServiceTestUtil.nextLong());

    newPasswordPolicy.setCheckSyntax(ServiceTestUtil.randomBoolean());

    newPasswordPolicy.setAllowDictionaryWords(ServiceTestUtil.randomBoolean());

    newPasswordPolicy.setMinAlphanumeric(ServiceTestUtil.nextInt());

    newPasswordPolicy.setMinLength(ServiceTestUtil.nextInt());

    newPasswordPolicy.setMinLowerCase(ServiceTestUtil.nextInt());

    newPasswordPolicy.setMinNumbers(ServiceTestUtil.nextInt());

    newPasswordPolicy.setMinSymbols(ServiceTestUtil.nextInt());

    newPasswordPolicy.setMinUpperCase(ServiceTestUtil.nextInt());

    newPasswordPolicy.setHistory(ServiceTestUtil.randomBoolean());

    newPasswordPolicy.setHistoryCount(ServiceTestUtil.nextInt());

    newPasswordPolicy.setExpireable(ServiceTestUtil.randomBoolean());

    newPasswordPolicy.setMaxAge(ServiceTestUtil.nextLong());

    newPasswordPolicy.setWarningTime(ServiceTestUtil.nextLong());

    newPasswordPolicy.setGraceLimit(ServiceTestUtil.nextInt());

    newPasswordPolicy.setLockout(ServiceTestUtil.randomBoolean());

    newPasswordPolicy.setMaxFailure(ServiceTestUtil.nextInt());

    newPasswordPolicy.setLockoutDuration(ServiceTestUtil.nextLong());

    newPasswordPolicy.setRequireUnlock(ServiceTestUtil.randomBoolean());

    newPasswordPolicy.setResetFailureCount(ServiceTestUtil.nextLong());

    newPasswordPolicy.setResetTicketMaxAge(ServiceTestUtil.nextLong());

    _persistence.update(newPasswordPolicy, false);

    PasswordPolicy existingPasswordPolicy =
        _persistence.findByPrimaryKey(newPasswordPolicy.getPrimaryKey());

    Assert.assertEquals(
        existingPasswordPolicy.getPasswordPolicyId(), newPasswordPolicy.getPasswordPolicyId());
    Assert.assertEquals(existingPasswordPolicy.getCompanyId(), newPasswordPolicy.getCompanyId());
    Assert.assertEquals(existingPasswordPolicy.getUserId(), newPasswordPolicy.getUserId());
    Assert.assertEquals(existingPasswordPolicy.getUserName(), newPasswordPolicy.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingPasswordPolicy.getCreateDate()),
        Time.getShortTimestamp(newPasswordPolicy.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingPasswordPolicy.getModifiedDate()),
        Time.getShortTimestamp(newPasswordPolicy.getModifiedDate()));
    Assert.assertEquals(
        existingPasswordPolicy.getDefaultPolicy(), newPasswordPolicy.getDefaultPolicy());
    Assert.assertEquals(existingPasswordPolicy.getName(), newPasswordPolicy.getName());
    Assert.assertEquals(
        existingPasswordPolicy.getDescription(), newPasswordPolicy.getDescription());
    Assert.assertEquals(existingPasswordPolicy.getChangeable(), newPasswordPolicy.getChangeable());
    Assert.assertEquals(
        existingPasswordPolicy.getChangeRequired(), newPasswordPolicy.getChangeRequired());
    Assert.assertEquals(existingPasswordPolicy.getMinAge(), newPasswordPolicy.getMinAge());
    Assert.assertEquals(
        existingPasswordPolicy.getCheckSyntax(), newPasswordPolicy.getCheckSyntax());
    Assert.assertEquals(
        existingPasswordPolicy.getAllowDictionaryWords(),
        newPasswordPolicy.getAllowDictionaryWords());
    Assert.assertEquals(
        existingPasswordPolicy.getMinAlphanumeric(), newPasswordPolicy.getMinAlphanumeric());
    Assert.assertEquals(existingPasswordPolicy.getMinLength(), newPasswordPolicy.getMinLength());
    Assert.assertEquals(
        existingPasswordPolicy.getMinLowerCase(), newPasswordPolicy.getMinLowerCase());
    Assert.assertEquals(existingPasswordPolicy.getMinNumbers(), newPasswordPolicy.getMinNumbers());
    Assert.assertEquals(existingPasswordPolicy.getMinSymbols(), newPasswordPolicy.getMinSymbols());
    Assert.assertEquals(
        existingPasswordPolicy.getMinUpperCase(), newPasswordPolicy.getMinUpperCase());
    Assert.assertEquals(existingPasswordPolicy.getHistory(), newPasswordPolicy.getHistory());
    Assert.assertEquals(
        existingPasswordPolicy.getHistoryCount(), newPasswordPolicy.getHistoryCount());
    Assert.assertEquals(existingPasswordPolicy.getExpireable(), newPasswordPolicy.getExpireable());
    Assert.assertEquals(existingPasswordPolicy.getMaxAge(), newPasswordPolicy.getMaxAge());
    Assert.assertEquals(
        existingPasswordPolicy.getWarningTime(), newPasswordPolicy.getWarningTime());
    Assert.assertEquals(existingPasswordPolicy.getGraceLimit(), newPasswordPolicy.getGraceLimit());
    Assert.assertEquals(existingPasswordPolicy.getLockout(), newPasswordPolicy.getLockout());
    Assert.assertEquals(existingPasswordPolicy.getMaxFailure(), newPasswordPolicy.getMaxFailure());
    Assert.assertEquals(
        existingPasswordPolicy.getLockoutDuration(), newPasswordPolicy.getLockoutDuration());
    Assert.assertEquals(
        existingPasswordPolicy.getRequireUnlock(), newPasswordPolicy.getRequireUnlock());
    Assert.assertEquals(
        existingPasswordPolicy.getResetFailureCount(), newPasswordPolicy.getResetFailureCount());
    Assert.assertEquals(
        existingPasswordPolicy.getResetTicketMaxAge(), newPasswordPolicy.getResetTicketMaxAge());
  }
コード例 #3
0
  protected PasswordPolicy addPasswordPolicy() throws Exception {
    long pk = ServiceTestUtil.nextLong();

    PasswordPolicy passwordPolicy = _persistence.create(pk);

    passwordPolicy.setCompanyId(ServiceTestUtil.nextLong());

    passwordPolicy.setUserId(ServiceTestUtil.nextLong());

    passwordPolicy.setUserName(ServiceTestUtil.randomString());

    passwordPolicy.setCreateDate(ServiceTestUtil.nextDate());

    passwordPolicy.setModifiedDate(ServiceTestUtil.nextDate());

    passwordPolicy.setDefaultPolicy(ServiceTestUtil.randomBoolean());

    passwordPolicy.setName(ServiceTestUtil.randomString());

    passwordPolicy.setDescription(ServiceTestUtil.randomString());

    passwordPolicy.setChangeable(ServiceTestUtil.randomBoolean());

    passwordPolicy.setChangeRequired(ServiceTestUtil.randomBoolean());

    passwordPolicy.setMinAge(ServiceTestUtil.nextLong());

    passwordPolicy.setCheckSyntax(ServiceTestUtil.randomBoolean());

    passwordPolicy.setAllowDictionaryWords(ServiceTestUtil.randomBoolean());

    passwordPolicy.setMinAlphanumeric(ServiceTestUtil.nextInt());

    passwordPolicy.setMinLength(ServiceTestUtil.nextInt());

    passwordPolicy.setMinLowerCase(ServiceTestUtil.nextInt());

    passwordPolicy.setMinNumbers(ServiceTestUtil.nextInt());

    passwordPolicy.setMinSymbols(ServiceTestUtil.nextInt());

    passwordPolicy.setMinUpperCase(ServiceTestUtil.nextInt());

    passwordPolicy.setHistory(ServiceTestUtil.randomBoolean());

    passwordPolicy.setHistoryCount(ServiceTestUtil.nextInt());

    passwordPolicy.setExpireable(ServiceTestUtil.randomBoolean());

    passwordPolicy.setMaxAge(ServiceTestUtil.nextLong());

    passwordPolicy.setWarningTime(ServiceTestUtil.nextLong());

    passwordPolicy.setGraceLimit(ServiceTestUtil.nextInt());

    passwordPolicy.setLockout(ServiceTestUtil.randomBoolean());

    passwordPolicy.setMaxFailure(ServiceTestUtil.nextInt());

    passwordPolicy.setLockoutDuration(ServiceTestUtil.nextLong());

    passwordPolicy.setRequireUnlock(ServiceTestUtil.randomBoolean());

    passwordPolicy.setResetFailureCount(ServiceTestUtil.nextLong());

    passwordPolicy.setResetTicketMaxAge(ServiceTestUtil.nextLong());

    _persistence.update(passwordPolicy, false);

    return passwordPolicy;
  }