use of com.liferay.blade.workflow.asset.model.Qux in project liferay-blade-samples by liferay.
the class QuxPersistenceTest method testActionableDynamicQuery.
@Test
public void testActionableDynamicQuery() throws Exception {
final IntegerWrapper count = new IntegerWrapper();
ActionableDynamicQuery actionableDynamicQuery = QuxLocalServiceUtil.getActionableDynamicQuery();
actionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<Qux>() {
@Override
public void performAction(Qux qux) {
Assert.assertNotNull(qux);
count.increment();
}
});
actionableDynamicQuery.performActions();
Assert.assertEquals(count.getValue(), _persistence.countAll());
}
use of com.liferay.blade.workflow.asset.model.Qux in project liferay-blade-samples by liferay.
the class QuxPersistenceTest method testFetchByPrimaryKeyMissing.
@Test
public void testFetchByPrimaryKeyMissing() throws Exception {
long pk = RandomTestUtil.nextLong();
Qux missingQux = _persistence.fetchByPrimaryKey(pk);
Assert.assertNull(missingQux);
}
use of com.liferay.blade.workflow.asset.model.Qux in project liferay-blade-samples by liferay.
the class QuxPersistenceTest method testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereAllPrimaryKeysExist.
@Test
public void testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereAllPrimaryKeysExist() throws Exception {
Qux newQux1 = addQux();
Qux newQux2 = addQux();
Set<Serializable> primaryKeys = new HashSet<Serializable>();
primaryKeys.add(newQux1.getPrimaryKey());
primaryKeys.add(newQux2.getPrimaryKey());
Map<Serializable, Qux> quxs = _persistence.fetchByPrimaryKeys(primaryKeys);
Assert.assertEquals(2, quxs.size());
Assert.assertEquals(newQux1, quxs.get(newQux1.getPrimaryKey()));
Assert.assertEquals(newQux2, quxs.get(newQux2.getPrimaryKey()));
}
use of com.liferay.blade.workflow.asset.model.Qux in project liferay-blade-samples by liferay.
the class QuxPersistenceTest method testDynamicQueryByPrimaryKeyExisting.
@Test
public void testDynamicQueryByPrimaryKeyExisting() throws Exception {
Qux newQux = addQux();
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Qux.class, _dynamicQueryClassLoader);
dynamicQuery.add(RestrictionsFactoryUtil.eq("quxId", newQux.getQuxId()));
List<Qux> result = _persistence.findWithDynamicQuery(dynamicQuery);
Assert.assertEquals(1, result.size());
Qux existingQux = result.get(0);
Assert.assertEquals(existingQux, newQux);
}
use of com.liferay.blade.workflow.asset.model.Qux in project liferay-blade-samples by liferay.
the class QuxPersistenceTest method testCreate.
@Test
public void testCreate() throws Exception {
long pk = RandomTestUtil.nextLong();
Qux qux = _persistence.create(pk);
Assert.assertNotNull(qux);
Assert.assertEquals(qux.getPrimaryKey(), pk);
}
Aggregations