public void testUpdateExisting() throws Exception { long pk = nextLong(); SocialEquityLog newSocialEquityLog = _persistence.create(pk); newSocialEquityLog.setGroupId(nextLong()); newSocialEquityLog.setCompanyId(nextLong()); newSocialEquityLog.setUserId(nextLong()); newSocialEquityLog.setAssetEntryId(nextLong()); newSocialEquityLog.setActionId(randomString()); newSocialEquityLog.setActionDate(nextInt()); newSocialEquityLog.setActive(randomBoolean()); newSocialEquityLog.setExpiration(nextInt()); newSocialEquityLog.setType(nextInt()); newSocialEquityLog.setValue(nextInt()); newSocialEquityLog.setExtraData(randomString()); _persistence.update(newSocialEquityLog, false); SocialEquityLog existingSocialEquityLog = _persistence.findByPrimaryKey(newSocialEquityLog.getPrimaryKey()); assertEquals(existingSocialEquityLog.getEquityLogId(), newSocialEquityLog.getEquityLogId()); assertEquals(existingSocialEquityLog.getGroupId(), newSocialEquityLog.getGroupId()); assertEquals(existingSocialEquityLog.getCompanyId(), newSocialEquityLog.getCompanyId()); assertEquals(existingSocialEquityLog.getUserId(), newSocialEquityLog.getUserId()); assertEquals(existingSocialEquityLog.getAssetEntryId(), newSocialEquityLog.getAssetEntryId()); assertEquals(existingSocialEquityLog.getActionId(), newSocialEquityLog.getActionId()); assertEquals(existingSocialEquityLog.getActionDate(), newSocialEquityLog.getActionDate()); assertEquals(existingSocialEquityLog.getActive(), newSocialEquityLog.getActive()); assertEquals(existingSocialEquityLog.getExpiration(), newSocialEquityLog.getExpiration()); assertEquals(existingSocialEquityLog.getType(), newSocialEquityLog.getType()); assertEquals(existingSocialEquityLog.getValue(), newSocialEquityLog.getValue()); assertEquals(existingSocialEquityLog.getExtraData(), newSocialEquityLog.getExtraData()); }
public void testFindByPrimaryKeyExisting() throws Exception { SocialEquityLog newSocialEquityLog = addSocialEquityLog(); SocialEquityLog existingSocialEquityLog = _persistence.findByPrimaryKey(newSocialEquityLog.getPrimaryKey()); assertEquals(existingSocialEquityLog, newSocialEquityLog); }
public void testCreate() throws Exception { long pk = nextLong(); SocialEquityLog socialEquityLog = _persistence.create(pk); assertNotNull(socialEquityLog); assertEquals(socialEquityLog.getPrimaryKey(), pk); }
public void testRemove() throws Exception { SocialEquityLog newSocialEquityLog = addSocialEquityLog(); _persistence.remove(newSocialEquityLog); SocialEquityLog existingSocialEquityLog = _persistence.fetchByPrimaryKey(newSocialEquityLog.getPrimaryKey()); assertNull(existingSocialEquityLog); }
public void testResetOriginalValues() throws Exception { if (!PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) { return; } SocialEquityLog newSocialEquityLog = addSocialEquityLog(); _persistence.clearCache(); SocialEquityLogModelImpl existingSocialEquityLogModelImpl = (SocialEquityLogModelImpl) _persistence.findByPrimaryKey(newSocialEquityLog.getPrimaryKey()); assertEquals( existingSocialEquityLogModelImpl.getUserId(), existingSocialEquityLogModelImpl.getOriginalUserId()); assertEquals( existingSocialEquityLogModelImpl.getAssetEntryId(), existingSocialEquityLogModelImpl.getOriginalAssetEntryId()); assertTrue( Validator.equals( existingSocialEquityLogModelImpl.getActionId(), existingSocialEquityLogModelImpl.getOriginalActionId())); assertEquals( existingSocialEquityLogModelImpl.getActionDate(), existingSocialEquityLogModelImpl.getOriginalActionDate()); assertEquals( existingSocialEquityLogModelImpl.getActive(), existingSocialEquityLogModelImpl.getOriginalActive()); assertEquals( existingSocialEquityLogModelImpl.getType(), existingSocialEquityLogModelImpl.getOriginalType()); assertTrue( Validator.equals( existingSocialEquityLogModelImpl.getExtraData(), existingSocialEquityLogModelImpl.getOriginalExtraData())); }