List of usage examples for com.liferay.portal.kernel.workflow WorkflowConstants STATUS_APPROVED
int STATUS_APPROVED
To view the source code for com.liferay.portal.kernel.workflow WorkflowConstants STATUS_APPROVED.
Click Source Link
From source file:com.liferay.dynamic.data.mapping.service.test.DDMStructureLocalServiceTest.java
License:Open Source License
@Test public void testSearchByKeywords1() throws Exception { DDMStructure structure = addStructure(_classNameId, "Events"); addStructure(_classNameId, "Event"); List<DDMStructure> structures = DDMStructureLocalServiceUtil.search(structure.getCompanyId(), new long[] { structure.getGroupId() }, structure.getClassNameId(), "Event", WorkflowConstants.STATUS_APPROVED, QueryUtil.ALL_POS, QueryUtil.ALL_POS, new StructureIdComparator(true)); Assert.assertEquals("Events", getStructureName(structures.get(0))); Assert.assertEquals("Event", getStructureName(structures.get(1))); }
From source file:com.liferay.dynamic.data.mapping.service.test.DDMStructureLocalServiceTest.java
License:Open Source License
@Test public void testSearchByKeywords2() throws Exception { DDMStructure structure = addStructure(_classNameId, "To Do"); addStructure(_classNameId, "To Doing"); List<DDMStructure> structures = DDMStructureLocalServiceUtil.search(structure.getCompanyId(), new long[] { structure.getGroupId() }, structure.getClassNameId(), "To Do", WorkflowConstants.STATUS_APPROVED, QueryUtil.ALL_POS, QueryUtil.ALL_POS, new StructureIdComparator(true)); Assert.assertEquals(structures.toString(), 2, structures.size()); Assert.assertEquals("To Do", getStructureName(structures.get(0))); Assert.assertEquals("To Doing", getStructureName(structures.get(1))); }
From source file:com.liferay.dynamic.data.mapping.service.test.DDMStructureLocalServiceTest.java
License:Open Source License
@Test public void testSearchByName() throws Exception { addStructure(_classNameId, "Contact"); addStructure(_classNameId, "Event"); List<DDMStructure> structures = DDMStructureLocalServiceUtil.search(TestPropsValues.getCompanyId(), new long[] { group.getGroupId() }, _classNameId, "Contact", null, null, DDMStructureConstants.TYPE_DEFAULT, WorkflowConstants.STATUS_APPROVED, true, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);/*from w ww . ja v a 2s. c om*/ Assert.assertEquals("Contact", getStructureName(structures.get(0))); }
From source file:com.liferay.dynamic.data.mapping.service.test.DDMStructureLocalServiceTest.java
License:Open Source License
@Test public void testSearchByNameAndDescription() throws Exception { addStructure(_classNameId, "Contact", "Contact"); addStructure(_classNameId, "Event", "Event"); List<DDMStructure> structures = DDMStructureLocalServiceUtil.search(TestPropsValues.getCompanyId(), new long[] { group.getGroupId() }, _classNameId, "Contact", "Event", null, DDMStructureConstants.TYPE_DEFAULT, WorkflowConstants.STATUS_APPROVED, true, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);/*from w w w .j a v a 2 s. c o m*/ Assert.assertEquals(structures.toString(), 0, structures.size()); }
From source file:com.liferay.dynamic.data.mapping.service.test.DDMStructureLocalServiceTest.java
License:Open Source License
@Test public void testSearchByNameOrDescription() throws Exception { addStructure(_classNameId, "Contact", "Contact"); addStructure(_classNameId, "Event", "Event"); List<DDMStructure> structures = DDMStructureLocalServiceUtil.search(TestPropsValues.getCompanyId(), new long[] { group.getGroupId() }, _classNameId, "Contact", "Event", null, DDMStructureConstants.TYPE_DEFAULT, WorkflowConstants.STATUS_APPROVED, false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, new StructureIdComparator(true)); Assert.assertEquals("Contact", getStructureName(structures.get(0))); Assert.assertEquals("Event", getStructureName(structures.get(1))); }
From source file:com.liferay.dynamic.data.mapping.service.test.DDMStructureLocalServiceTest.java
License:Open Source License
@Test public void testSearchByNonExistingStorageType() throws Exception { addStructure(_classNameId, StringUtil.randomString()); List<DDMStructure> structures = DDMStructureLocalServiceUtil.search(TestPropsValues.getCompanyId(), new long[] { group.getGroupId() }, _classNameId, null, null, "NonExistingStorageType", DDMStructureConstants.TYPE_DEFAULT, WorkflowConstants.STATUS_APPROVED, true, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);//from w ww . jav a 2s . com Assert.assertEquals(structures.toString(), 0, structures.size()); }
From source file:com.liferay.dynamic.data.mapping.service.test.DDMStructureLocalServiceTest.java
License:Open Source License
@Test public void testSearchByStorageType() throws Exception { addStructure(_classNameId, StringUtil.randomString()); List<DDMStructure> structures = DDMStructureLocalServiceUtil.search(TestPropsValues.getCompanyId(), new long[] { group.getGroupId() }, _classNameId, null, null, StorageType.JSON.toString(), DDMStructureConstants.TYPE_DEFAULT, WorkflowConstants.STATUS_APPROVED, true, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);/*from ww w.ja v a 2 s. com*/ Assert.assertEquals(structures.toString(), 1, structures.size()); }
From source file:com.liferay.dynamic.data.mapping.service.test.DDMStructureLocalServiceTest.java
License:Open Source License
@Test public void testSearchByType() throws Exception { addStructure(0, _classNameId, null, StringUtil.randomString(), StringPool.BLANK, read("test-structure.xsd"), StorageType.JSON.getValue(), DDMStructureConstants.TYPE_DEFAULT, WorkflowConstants.STATUS_APPROVED); addStructure(0, _classNameId, null, StringUtil.randomString(), StringPool.BLANK, read("test-structure.xsd"), StorageType.JSON.getValue(), DDMStructureConstants.TYPE_FRAGMENT, WorkflowConstants.STATUS_APPROVED); List<DDMStructure> structures = DDMStructureLocalServiceUtil.search(TestPropsValues.getCompanyId(), new long[] { group.getGroupId() }, _classNameId, null, null, null, DDMStructureConstants.TYPE_DEFAULT, WorkflowConstants.STATUS_APPROVED, true, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);/* w w w. ja va2 s. c o m*/ Assert.assertEquals(structures.toString(), 1, structures.size()); structures = DDMStructureLocalServiceUtil.search(TestPropsValues.getCompanyId(), new long[] { group.getGroupId() }, _classNameId, null, null, null, DDMStructureConstants.TYPE_FRAGMENT, WorkflowConstants.STATUS_APPROVED, true, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); Assert.assertEquals(structures.toString(), 1, structures.size()); }
From source file:com.liferay.dynamic.data.mapping.service.test.DDMStructureLocalServiceTest.java
License:Open Source License
@Test public void testSearchCount() throws Exception { int initialCount = DDMStructureLocalServiceUtil.searchCount(TestPropsValues.getCompanyId(), new long[] { group.getGroupId() }, _classNameId, "Test Structure", null, null, DDMStructureConstants.TYPE_DEFAULT, WorkflowConstants.STATUS_APPROVED, false); addStructure(_classNameId, "Test Structure"); int count = DDMStructureLocalServiceUtil.searchCount(TestPropsValues.getCompanyId(), new long[] { group.getGroupId() }, _classNameId, "Test Structure", null, null, DDMStructureConstants.TYPE_DEFAULT, WorkflowConstants.STATUS_APPROVED, false); Assert.assertEquals(initialCount + 1, count); }
From source file:com.liferay.dynamic.data.mapping.service.test.DDMStructureLocalServiceTest.java
License:Open Source License
@Test public void testSearchCountByKeywords() throws Exception { int initialCount = DDMStructureLocalServiceUtil.searchCount(TestPropsValues.getCompanyId(), new long[] { group.getGroupId() }, _classNameId, null, WorkflowConstants.STATUS_APPROVED); addStructure(_classNameId, "Test Structure"); int count = DDMStructureLocalServiceUtil.searchCount(TestPropsValues.getCompanyId(), new long[] { group.getGroupId() }, _classNameId, null, WorkflowConstants.STATUS_APPROVED); Assert.assertEquals(initialCount + 1, count); }