use of com.liferay.blade.samples.jndiservicebuilder.model.Region in project liferay-blade-samples by liferay.
the class RegionPersistenceTest method addRegion.
protected Region addRegion() throws Exception {
long pk = RandomTestUtil.nextLong();
Region region = _persistence.create(pk);
region.setRegionName(RandomTestUtil.randomString());
_regions.add(_persistence.update(region));
return region;
}
use of com.liferay.blade.samples.jndiservicebuilder.model.Region in project liferay-blade-samples by liferay.
the class RegionPersistenceTest method testFetchByPrimaryKeyExisting.
@Test
public void testFetchByPrimaryKeyExisting() throws Exception {
Region newRegion = addRegion();
Region existingRegion = _persistence.fetchByPrimaryKey(newRegion.getPrimaryKey());
Assert.assertEquals(existingRegion, newRegion);
}
use of com.liferay.blade.samples.jndiservicebuilder.model.Region in project liferay-blade-samples by liferay.
the class RegionPersistenceTest method testFindByPrimaryKeyExisting.
@Test
public void testFindByPrimaryKeyExisting() throws Exception {
Region newRegion = addRegion();
Region existingRegion = _persistence.findByPrimaryKey(newRegion.getPrimaryKey());
Assert.assertEquals(existingRegion, newRegion);
}
use of com.liferay.blade.samples.jndiservicebuilder.model.Region in project liferay-blade-samples by liferay.
the class RegionPersistenceTest method testCreate.
@Test
public void testCreate() throws Exception {
long pk = RandomTestUtil.nextLong();
Region region = _persistence.create(pk);
Assert.assertNotNull(region);
Assert.assertEquals(region.getPrimaryKey(), pk);
}
use of com.liferay.blade.samples.jndiservicebuilder.model.Region in project liferay-blade-samples by liferay.
the class RegionPersistenceTest method testFetchByPrimaryKeysWithOnePrimaryKey.
@Test
public void testFetchByPrimaryKeysWithOnePrimaryKey() throws Exception {
Region newRegion = addRegion();
Set<Serializable> primaryKeys = new HashSet<Serializable>();
primaryKeys.add(newRegion.getPrimaryKey());
Map<Serializable, Region> regions = _persistence.fetchByPrimaryKeys(primaryKeys);
Assert.assertEquals(1, regions.size());
Assert.assertEquals(newRegion, regions.get(newRegion.getPrimaryKey()));
}
Aggregations