protected WikiPageResource addWikiPageResource() throws Exception { long pk = nextLong(); WikiPageResource wikiPageResource = _persistence.create(pk); wikiPageResource.setUuid(randomString()); wikiPageResource.setNodeId(nextLong()); wikiPageResource.setTitle(randomString()); _persistence.update(wikiPageResource, false); return wikiPageResource; }
public void testUpdateExisting() throws Exception { long pk = nextLong(); WikiPageResource newWikiPageResource = _persistence.create(pk); newWikiPageResource.setUuid(randomString()); newWikiPageResource.setNodeId(nextLong()); newWikiPageResource.setTitle(randomString()); _persistence.update(newWikiPageResource, false); WikiPageResource existingWikiPageResource = _persistence.findByPrimaryKey(newWikiPageResource.getPrimaryKey()); assertEquals(existingWikiPageResource.getUuid(), newWikiPageResource.getUuid()); assertEquals( existingWikiPageResource.getResourcePrimKey(), newWikiPageResource.getResourcePrimKey()); assertEquals(existingWikiPageResource.getNodeId(), newWikiPageResource.getNodeId()); assertEquals(existingWikiPageResource.getTitle(), newWikiPageResource.getTitle()); }