use of com.liferay.roster.model.RosterMember in project liferay-ide by liferay.
the class RosterMemberPersistenceTest method testFetchByPrimaryKeyExisting.
@Test
public void testFetchByPrimaryKeyExisting() throws Exception {
RosterMember newRosterMember = addRosterMember();
RosterMember existingRosterMember = _persistence.fetchByPrimaryKey(newRosterMember.getPrimaryKey());
Assert.assertEquals(existingRosterMember, newRosterMember);
}
use of com.liferay.roster.model.RosterMember in project liferay-ide by liferay.
the class RosterMemberPersistenceTest method addRosterMember.
protected RosterMember addRosterMember() throws Exception {
long pk = RandomTestUtil.nextLong();
RosterMember rosterMember = _persistence.create(pk);
rosterMember.setUuid(RandomTestUtil.randomString());
rosterMember.setCreateDate(RandomTestUtil.nextDate());
rosterMember.setModifiedDate(RandomTestUtil.nextDate());
rosterMember.setRosterId(RandomTestUtil.nextLong());
rosterMember.setContactId(RandomTestUtil.nextLong());
_rosterMembers.add(_persistence.update(rosterMember));
return rosterMember;
}
use of com.liferay.roster.model.RosterMember in project liferay-ide by liferay.
the class RosterMemberPersistenceTest method testDynamicQueryByPrimaryKeyExisting.
@Test
public void testDynamicQueryByPrimaryKeyExisting() throws Exception {
RosterMember newRosterMember = addRosterMember();
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(RosterMember.class, _dynamicQueryClassLoader);
dynamicQuery.add(RestrictionsFactoryUtil.eq("rosterMemberId", newRosterMember.getRosterMemberId()));
List<RosterMember> result = _persistence.findWithDynamicQuery(dynamicQuery);
Assert.assertEquals(1, result.size());
RosterMember existingRosterMember = result.get(0);
Assert.assertEquals(existingRosterMember, newRosterMember);
}
use of com.liferay.roster.model.RosterMember in project liferay-ide by liferay.
the class RosterMemberPersistenceTest method testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereAllPrimaryKeysExist.
@Test
public void testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereAllPrimaryKeysExist() throws Exception {
RosterMember newRosterMember1 = addRosterMember();
RosterMember newRosterMember2 = addRosterMember();
Set<Serializable> primaryKeys = new HashSet<Serializable>();
primaryKeys.add(newRosterMember1.getPrimaryKey());
primaryKeys.add(newRosterMember2.getPrimaryKey());
Map<Serializable, RosterMember> rosterMembers = _persistence.fetchByPrimaryKeys(primaryKeys);
Assert.assertEquals(2, rosterMembers.size());
Assert.assertEquals(newRosterMember1, rosterMembers.get(newRosterMember1.getPrimaryKey()));
Assert.assertEquals(newRosterMember2, rosterMembers.get(newRosterMember2.getPrimaryKey()));
}
use of com.liferay.roster.model.RosterMember in project liferay-ide by liferay.
the class RosterMemberPersistenceTest method testFetchByPrimaryKeysWithOnePrimaryKey.
@Test
public void testFetchByPrimaryKeysWithOnePrimaryKey() throws Exception {
RosterMember newRosterMember = addRosterMember();
Set<Serializable> primaryKeys = new HashSet<Serializable>();
primaryKeys.add(newRosterMember.getPrimaryKey());
Map<Serializable, RosterMember> rosterMembers = _persistence.fetchByPrimaryKeys(primaryKeys);
Assert.assertEquals(1, rosterMembers.size());
Assert.assertEquals(newRosterMember, rosterMembers.get(newRosterMember.getPrimaryKey()));
}
Aggregations