コード例 #1
0
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    JournalArticleImage newJournalArticleImage = _persistence.create(pk);

    newJournalArticleImage.setGroupId(RandomTestUtil.nextLong());

    newJournalArticleImage.setArticleId(RandomTestUtil.randomString());

    newJournalArticleImage.setVersion(RandomTestUtil.nextDouble());

    newJournalArticleImage.setElInstanceId(RandomTestUtil.randomString());

    newJournalArticleImage.setElName(RandomTestUtil.randomString());

    newJournalArticleImage.setLanguageId(RandomTestUtil.randomString());

    newJournalArticleImage.setTempImage(RandomTestUtil.randomBoolean());

    _journalArticleImages.add(_persistence.update(newJournalArticleImage));

    JournalArticleImage existingJournalArticleImage =
        _persistence.findByPrimaryKey(newJournalArticleImage.getPrimaryKey());

    Assert.assertEquals(
        existingJournalArticleImage.getArticleImageId(),
        newJournalArticleImage.getArticleImageId());
    Assert.assertEquals(
        existingJournalArticleImage.getGroupId(), newJournalArticleImage.getGroupId());
    Assert.assertEquals(
        existingJournalArticleImage.getArticleId(), newJournalArticleImage.getArticleId());
    AssertUtils.assertEquals(
        existingJournalArticleImage.getVersion(), newJournalArticleImage.getVersion());
    Assert.assertEquals(
        existingJournalArticleImage.getElInstanceId(), newJournalArticleImage.getElInstanceId());
    Assert.assertEquals(
        existingJournalArticleImage.getElName(), newJournalArticleImage.getElName());
    Assert.assertEquals(
        existingJournalArticleImage.getLanguageId(), newJournalArticleImage.getLanguageId());
    Assert.assertEquals(
        existingJournalArticleImage.getTempImage(), newJournalArticleImage.getTempImage());
  }
コード例 #2
0
  protected JournalArticleImage addJournalArticleImage() throws Exception {
    long pk = RandomTestUtil.nextLong();

    JournalArticleImage journalArticleImage = _persistence.create(pk);

    journalArticleImage.setGroupId(RandomTestUtil.nextLong());

    journalArticleImage.setArticleId(RandomTestUtil.randomString());

    journalArticleImage.setVersion(RandomTestUtil.nextDouble());

    journalArticleImage.setElInstanceId(RandomTestUtil.randomString());

    journalArticleImage.setElName(RandomTestUtil.randomString());

    journalArticleImage.setLanguageId(RandomTestUtil.randomString());

    journalArticleImage.setTempImage(RandomTestUtil.randomBoolean());

    _journalArticleImages.add(_persistence.update(journalArticleImage));

    return journalArticleImage;
  }