コード例 #1
0
  protected SCFrameworkVersion addSCFrameworkVersion() throws Exception {
    long pk = nextLong();

    SCFrameworkVersion scFrameworkVersion = _persistence.create(pk);

    scFrameworkVersion.setGroupId(nextLong());
    scFrameworkVersion.setCompanyId(nextLong());
    scFrameworkVersion.setUserId(nextLong());
    scFrameworkVersion.setUserName(randomString());
    scFrameworkVersion.setCreateDate(nextDate());
    scFrameworkVersion.setModifiedDate(nextDate());
    scFrameworkVersion.setName(randomString());
    scFrameworkVersion.setUrl(randomString());
    scFrameworkVersion.setActive(randomBoolean());
    scFrameworkVersion.setPriority(nextInt());

    _persistence.update(scFrameworkVersion, false);

    return scFrameworkVersion;
  }
コード例 #2
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 SCFrameworkVersion toModel(SCFrameworkVersionSoap soapModel) {
    if (soapModel == null) {
      return null;
    }

    SCFrameworkVersion model = new SCFrameworkVersionImpl();

    model.setFrameworkVersionId(soapModel.getFrameworkVersionId());
    model.setGroupId(soapModel.getGroupId());
    model.setCompanyId(soapModel.getCompanyId());
    model.setUserId(soapModel.getUserId());
    model.setUserName(soapModel.getUserName());
    model.setCreateDate(soapModel.getCreateDate());
    model.setModifiedDate(soapModel.getModifiedDate());
    model.setName(soapModel.getName());
    model.setUrl(soapModel.getUrl());
    model.setActive(soapModel.getActive());
    model.setPriority(soapModel.getPriority());

    return model;
  }
コード例 #3
0
  public void testUpdateExisting() throws Exception {
    long pk = nextLong();

    SCFrameworkVersion newSCFrameworkVersion = _persistence.create(pk);

    newSCFrameworkVersion.setGroupId(nextLong());
    newSCFrameworkVersion.setCompanyId(nextLong());
    newSCFrameworkVersion.setUserId(nextLong());
    newSCFrameworkVersion.setUserName(randomString());
    newSCFrameworkVersion.setCreateDate(nextDate());
    newSCFrameworkVersion.setModifiedDate(nextDate());
    newSCFrameworkVersion.setName(randomString());
    newSCFrameworkVersion.setUrl(randomString());
    newSCFrameworkVersion.setActive(randomBoolean());
    newSCFrameworkVersion.setPriority(nextInt());

    _persistence.update(newSCFrameworkVersion, false);

    SCFrameworkVersion existingSCFrameworkVersion =
        _persistence.findByPrimaryKey(newSCFrameworkVersion.getPrimaryKey());

    assertEquals(
        existingSCFrameworkVersion.getFrameworkVersionId(),
        newSCFrameworkVersion.getFrameworkVersionId());
    assertEquals(existingSCFrameworkVersion.getGroupId(), newSCFrameworkVersion.getGroupId());
    assertEquals(existingSCFrameworkVersion.getCompanyId(), newSCFrameworkVersion.getCompanyId());
    assertEquals(existingSCFrameworkVersion.getUserId(), newSCFrameworkVersion.getUserId());
    assertEquals(existingSCFrameworkVersion.getUserName(), newSCFrameworkVersion.getUserName());
    assertEquals(
        Time.getShortTimestamp(existingSCFrameworkVersion.getCreateDate()),
        Time.getShortTimestamp(newSCFrameworkVersion.getCreateDate()));
    assertEquals(
        Time.getShortTimestamp(existingSCFrameworkVersion.getModifiedDate()),
        Time.getShortTimestamp(newSCFrameworkVersion.getModifiedDate()));
    assertEquals(existingSCFrameworkVersion.getName(), newSCFrameworkVersion.getName());
    assertEquals(existingSCFrameworkVersion.getUrl(), newSCFrameworkVersion.getUrl());
    assertEquals(existingSCFrameworkVersion.getActive(), newSCFrameworkVersion.getActive());
    assertEquals(existingSCFrameworkVersion.getPriority(), newSCFrameworkVersion.getPriority());
  }