@Test
  public void testActionableDynamicQuery() throws Exception {
    final IntegerWrapper count = new IntegerWrapper();

    ActionableDynamicQuery actionableDynamicQuery =
        ExpandoRowLocalServiceUtil.getActionableDynamicQuery();

    actionableDynamicQuery.setPerformActionMethod(
        new ActionableDynamicQuery.PerformActionMethod() {
          @Override
          public void performAction(Object object) {
            ExpandoRow expandoRow = (ExpandoRow) object;

            Assert.assertNotNull(expandoRow);

            count.increment();
          }
        });

    actionableDynamicQuery.performActions();

    Assert.assertEquals(count.getValue(), _persistence.countAll());
  }
Пример #2
0
  public static int getTableRowsCount(long companyId, String tableName) throws SystemException {

    return ExpandoRowLocalServiceUtil.getRowsCount(
        companyId, WebFormUtil.class.getName(), tableName);
  }