PageRenderTime 37ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/test/persistence-test/src/testIntegration/java/com/liferay/portal/service/persistence/test/WorkflowDefinitionLinkPersistenceTest.java

http://github.com/liferay/liferay-portal
Java | 605 lines | 441 code | 148 blank | 16 comment | 1 complexity | 6f8bb987e5e2a23e92a616c2cf89734b MD5 | raw file
Possible License(s): LGPL-2.0
  1. /**
  2. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or modify it under
  5. * the terms of the GNU Lesser General Public License as published by the Free
  6. * Software Foundation; either version 2.1 of the License, or (at your option)
  7. * any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12. * details.
  13. */
  14. package com.liferay.portal.service.persistence.test;
  15. import com.liferay.arquillian.extension.junit.bridge.junit.Arquillian;
  16. import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
  17. import com.liferay.portal.kernel.dao.orm.DynamicQuery;
  18. import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
  19. import com.liferay.portal.kernel.dao.orm.ProjectionFactoryUtil;
  20. import com.liferay.portal.kernel.dao.orm.QueryUtil;
  21. import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil;
  22. import com.liferay.portal.kernel.exception.NoSuchWorkflowDefinitionLinkException;
  23. import com.liferay.portal.kernel.model.WorkflowDefinitionLink;
  24. import com.liferay.portal.kernel.service.WorkflowDefinitionLinkLocalServiceUtil;
  25. import com.liferay.portal.kernel.service.persistence.WorkflowDefinitionLinkPersistence;
  26. import com.liferay.portal.kernel.service.persistence.WorkflowDefinitionLinkUtil;
  27. import com.liferay.portal.kernel.test.ReflectionTestUtil;
  28. import com.liferay.portal.kernel.test.rule.AggregateTestRule;
  29. import com.liferay.portal.kernel.test.util.RandomTestUtil;
  30. import com.liferay.portal.kernel.transaction.Propagation;
  31. import com.liferay.portal.kernel.util.IntegerWrapper;
  32. import com.liferay.portal.kernel.util.OrderByComparator;
  33. import com.liferay.portal.kernel.util.OrderByComparatorFactoryUtil;
  34. import com.liferay.portal.kernel.util.Time;
  35. import com.liferay.portal.test.rule.LiferayIntegrationTestRule;
  36. import com.liferay.portal.test.rule.PersistenceTestRule;
  37. import com.liferay.portal.test.rule.TransactionalTestRule;
  38. import java.io.Serializable;
  39. import java.util.ArrayList;
  40. import java.util.HashSet;
  41. import java.util.Iterator;
  42. import java.util.List;
  43. import java.util.Map;
  44. import java.util.Set;
  45. import org.junit.After;
  46. import org.junit.Assert;
  47. import org.junit.Before;
  48. import org.junit.ClassRule;
  49. import org.junit.Rule;
  50. import org.junit.Test;
  51. import org.junit.runner.RunWith;
  52. /**
  53. * @generated
  54. */
  55. @RunWith(Arquillian.class)
  56. public class WorkflowDefinitionLinkPersistenceTest {
  57. @ClassRule
  58. @Rule
  59. public static final AggregateTestRule aggregateTestRule =
  60. new AggregateTestRule(
  61. new LiferayIntegrationTestRule(), PersistenceTestRule.INSTANCE,
  62. new TransactionalTestRule(Propagation.REQUIRED));
  63. @Before
  64. public void setUp() {
  65. _persistence = WorkflowDefinitionLinkUtil.getPersistence();
  66. Class<?> clazz = _persistence.getClass();
  67. _dynamicQueryClassLoader = clazz.getClassLoader();
  68. }
  69. @After
  70. public void tearDown() throws Exception {
  71. Iterator<WorkflowDefinitionLink> iterator =
  72. _workflowDefinitionLinks.iterator();
  73. while (iterator.hasNext()) {
  74. _persistence.remove(iterator.next());
  75. iterator.remove();
  76. }
  77. }
  78. @Test
  79. public void testCreate() throws Exception {
  80. long pk = RandomTestUtil.nextLong();
  81. WorkflowDefinitionLink workflowDefinitionLink = _persistence.create(pk);
  82. Assert.assertNotNull(workflowDefinitionLink);
  83. Assert.assertEquals(workflowDefinitionLink.getPrimaryKey(), pk);
  84. }
  85. @Test
  86. public void testRemove() throws Exception {
  87. WorkflowDefinitionLink newWorkflowDefinitionLink =
  88. addWorkflowDefinitionLink();
  89. _persistence.remove(newWorkflowDefinitionLink);
  90. WorkflowDefinitionLink existingWorkflowDefinitionLink =
  91. _persistence.fetchByPrimaryKey(
  92. newWorkflowDefinitionLink.getPrimaryKey());
  93. Assert.assertNull(existingWorkflowDefinitionLink);
  94. }
  95. @Test
  96. public void testUpdateNew() throws Exception {
  97. addWorkflowDefinitionLink();
  98. }
  99. @Test
  100. public void testUpdateExisting() throws Exception {
  101. long pk = RandomTestUtil.nextLong();
  102. WorkflowDefinitionLink newWorkflowDefinitionLink = _persistence.create(
  103. pk);
  104. newWorkflowDefinitionLink.setMvccVersion(RandomTestUtil.nextLong());
  105. newWorkflowDefinitionLink.setGroupId(RandomTestUtil.nextLong());
  106. newWorkflowDefinitionLink.setCompanyId(RandomTestUtil.nextLong());
  107. newWorkflowDefinitionLink.setUserId(RandomTestUtil.nextLong());
  108. newWorkflowDefinitionLink.setUserName(RandomTestUtil.randomString());
  109. newWorkflowDefinitionLink.setCreateDate(RandomTestUtil.nextDate());
  110. newWorkflowDefinitionLink.setModifiedDate(RandomTestUtil.nextDate());
  111. newWorkflowDefinitionLink.setClassNameId(RandomTestUtil.nextLong());
  112. newWorkflowDefinitionLink.setClassPK(RandomTestUtil.nextLong());
  113. newWorkflowDefinitionLink.setTypePK(RandomTestUtil.nextLong());
  114. newWorkflowDefinitionLink.setWorkflowDefinitionName(
  115. RandomTestUtil.randomString());
  116. newWorkflowDefinitionLink.setWorkflowDefinitionVersion(
  117. RandomTestUtil.nextInt());
  118. _workflowDefinitionLinks.add(
  119. _persistence.update(newWorkflowDefinitionLink));
  120. WorkflowDefinitionLink existingWorkflowDefinitionLink =
  121. _persistence.findByPrimaryKey(
  122. newWorkflowDefinitionLink.getPrimaryKey());
  123. Assert.assertEquals(
  124. existingWorkflowDefinitionLink.getMvccVersion(),
  125. newWorkflowDefinitionLink.getMvccVersion());
  126. Assert.assertEquals(
  127. existingWorkflowDefinitionLink.getWorkflowDefinitionLinkId(),
  128. newWorkflowDefinitionLink.getWorkflowDefinitionLinkId());
  129. Assert.assertEquals(
  130. existingWorkflowDefinitionLink.getGroupId(),
  131. newWorkflowDefinitionLink.getGroupId());
  132. Assert.assertEquals(
  133. existingWorkflowDefinitionLink.getCompanyId(),
  134. newWorkflowDefinitionLink.getCompanyId());
  135. Assert.assertEquals(
  136. existingWorkflowDefinitionLink.getUserId(),
  137. newWorkflowDefinitionLink.getUserId());
  138. Assert.assertEquals(
  139. existingWorkflowDefinitionLink.getUserName(),
  140. newWorkflowDefinitionLink.getUserName());
  141. Assert.assertEquals(
  142. Time.getShortTimestamp(
  143. existingWorkflowDefinitionLink.getCreateDate()),
  144. Time.getShortTimestamp(newWorkflowDefinitionLink.getCreateDate()));
  145. Assert.assertEquals(
  146. Time.getShortTimestamp(
  147. existingWorkflowDefinitionLink.getModifiedDate()),
  148. Time.getShortTimestamp(
  149. newWorkflowDefinitionLink.getModifiedDate()));
  150. Assert.assertEquals(
  151. existingWorkflowDefinitionLink.getClassNameId(),
  152. newWorkflowDefinitionLink.getClassNameId());
  153. Assert.assertEquals(
  154. existingWorkflowDefinitionLink.getClassPK(),
  155. newWorkflowDefinitionLink.getClassPK());
  156. Assert.assertEquals(
  157. existingWorkflowDefinitionLink.getTypePK(),
  158. newWorkflowDefinitionLink.getTypePK());
  159. Assert.assertEquals(
  160. existingWorkflowDefinitionLink.getWorkflowDefinitionName(),
  161. newWorkflowDefinitionLink.getWorkflowDefinitionName());
  162. Assert.assertEquals(
  163. existingWorkflowDefinitionLink.getWorkflowDefinitionVersion(),
  164. newWorkflowDefinitionLink.getWorkflowDefinitionVersion());
  165. }
  166. @Test
  167. public void testCountByCompanyId() throws Exception {
  168. _persistence.countByCompanyId(RandomTestUtil.nextLong());
  169. _persistence.countByCompanyId(0L);
  170. }
  171. @Test
  172. public void testCountByG_C_C() throws Exception {
  173. _persistence.countByG_C_C(
  174. RandomTestUtil.nextLong(), RandomTestUtil.nextLong(),
  175. RandomTestUtil.nextLong());
  176. _persistence.countByG_C_C(0L, 0L, 0L);
  177. }
  178. @Test
  179. public void testCountByC_W_W() throws Exception {
  180. _persistence.countByC_W_W(
  181. RandomTestUtil.nextLong(), "", RandomTestUtil.nextInt());
  182. _persistence.countByC_W_W(0L, "null", 0);
  183. _persistence.countByC_W_W(0L, (String)null, 0);
  184. }
  185. @Test
  186. public void testCountByG_C_C_C() throws Exception {
  187. _persistence.countByG_C_C_C(
  188. RandomTestUtil.nextLong(), RandomTestUtil.nextLong(),
  189. RandomTestUtil.nextLong(), RandomTestUtil.nextLong());
  190. _persistence.countByG_C_C_C(0L, 0L, 0L, 0L);
  191. }
  192. @Test
  193. public void testCountByG_C_C_C_T() throws Exception {
  194. _persistence.countByG_C_C_C_T(
  195. RandomTestUtil.nextLong(), RandomTestUtil.nextLong(),
  196. RandomTestUtil.nextLong(), RandomTestUtil.nextLong(),
  197. RandomTestUtil.nextLong());
  198. _persistence.countByG_C_C_C_T(0L, 0L, 0L, 0L, 0L);
  199. }
  200. @Test
  201. public void testFindByPrimaryKeyExisting() throws Exception {
  202. WorkflowDefinitionLink newWorkflowDefinitionLink =
  203. addWorkflowDefinitionLink();
  204. WorkflowDefinitionLink existingWorkflowDefinitionLink =
  205. _persistence.findByPrimaryKey(
  206. newWorkflowDefinitionLink.getPrimaryKey());
  207. Assert.assertEquals(
  208. existingWorkflowDefinitionLink, newWorkflowDefinitionLink);
  209. }
  210. @Test(expected = NoSuchWorkflowDefinitionLinkException.class)
  211. public void testFindByPrimaryKeyMissing() throws Exception {
  212. long pk = RandomTestUtil.nextLong();
  213. _persistence.findByPrimaryKey(pk);
  214. }
  215. @Test
  216. public void testFindAll() throws Exception {
  217. _persistence.findAll(
  218. QueryUtil.ALL_POS, QueryUtil.ALL_POS, getOrderByComparator());
  219. }
  220. protected OrderByComparator<WorkflowDefinitionLink> getOrderByComparator() {
  221. return OrderByComparatorFactoryUtil.create(
  222. "WorkflowDefinitionLink", "mvccVersion", true,
  223. "workflowDefinitionLinkId", true, "groupId", true, "companyId",
  224. true, "userId", true, "userName", true, "createDate", true,
  225. "modifiedDate", true, "classNameId", true, "classPK", true,
  226. "typePK", true, "workflowDefinitionName", true,
  227. "workflowDefinitionVersion", true);
  228. }
  229. @Test
  230. public void testFetchByPrimaryKeyExisting() throws Exception {
  231. WorkflowDefinitionLink newWorkflowDefinitionLink =
  232. addWorkflowDefinitionLink();
  233. WorkflowDefinitionLink existingWorkflowDefinitionLink =
  234. _persistence.fetchByPrimaryKey(
  235. newWorkflowDefinitionLink.getPrimaryKey());
  236. Assert.assertEquals(
  237. existingWorkflowDefinitionLink, newWorkflowDefinitionLink);
  238. }
  239. @Test
  240. public void testFetchByPrimaryKeyMissing() throws Exception {
  241. long pk = RandomTestUtil.nextLong();
  242. WorkflowDefinitionLink missingWorkflowDefinitionLink =
  243. _persistence.fetchByPrimaryKey(pk);
  244. Assert.assertNull(missingWorkflowDefinitionLink);
  245. }
  246. @Test
  247. public void testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereAllPrimaryKeysExist()
  248. throws Exception {
  249. WorkflowDefinitionLink newWorkflowDefinitionLink1 =
  250. addWorkflowDefinitionLink();
  251. WorkflowDefinitionLink newWorkflowDefinitionLink2 =
  252. addWorkflowDefinitionLink();
  253. Set<Serializable> primaryKeys = new HashSet<Serializable>();
  254. primaryKeys.add(newWorkflowDefinitionLink1.getPrimaryKey());
  255. primaryKeys.add(newWorkflowDefinitionLink2.getPrimaryKey());
  256. Map<Serializable, WorkflowDefinitionLink> workflowDefinitionLinks =
  257. _persistence.fetchByPrimaryKeys(primaryKeys);
  258. Assert.assertEquals(2, workflowDefinitionLinks.size());
  259. Assert.assertEquals(
  260. newWorkflowDefinitionLink1,
  261. workflowDefinitionLinks.get(
  262. newWorkflowDefinitionLink1.getPrimaryKey()));
  263. Assert.assertEquals(
  264. newWorkflowDefinitionLink2,
  265. workflowDefinitionLinks.get(
  266. newWorkflowDefinitionLink2.getPrimaryKey()));
  267. }
  268. @Test
  269. public void testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereNoPrimaryKeysExist()
  270. throws Exception {
  271. long pk1 = RandomTestUtil.nextLong();
  272. long pk2 = RandomTestUtil.nextLong();
  273. Set<Serializable> primaryKeys = new HashSet<Serializable>();
  274. primaryKeys.add(pk1);
  275. primaryKeys.add(pk2);
  276. Map<Serializable, WorkflowDefinitionLink> workflowDefinitionLinks =
  277. _persistence.fetchByPrimaryKeys(primaryKeys);
  278. Assert.assertTrue(workflowDefinitionLinks.isEmpty());
  279. }
  280. @Test
  281. public void testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereSomePrimaryKeysExist()
  282. throws Exception {
  283. WorkflowDefinitionLink newWorkflowDefinitionLink =
  284. addWorkflowDefinitionLink();
  285. long pk = RandomTestUtil.nextLong();
  286. Set<Serializable> primaryKeys = new HashSet<Serializable>();
  287. primaryKeys.add(newWorkflowDefinitionLink.getPrimaryKey());
  288. primaryKeys.add(pk);
  289. Map<Serializable, WorkflowDefinitionLink> workflowDefinitionLinks =
  290. _persistence.fetchByPrimaryKeys(primaryKeys);
  291. Assert.assertEquals(1, workflowDefinitionLinks.size());
  292. Assert.assertEquals(
  293. newWorkflowDefinitionLink,
  294. workflowDefinitionLinks.get(
  295. newWorkflowDefinitionLink.getPrimaryKey()));
  296. }
  297. @Test
  298. public void testFetchByPrimaryKeysWithNoPrimaryKeys() throws Exception {
  299. Set<Serializable> primaryKeys = new HashSet<Serializable>();
  300. Map<Serializable, WorkflowDefinitionLink> workflowDefinitionLinks =
  301. _persistence.fetchByPrimaryKeys(primaryKeys);
  302. Assert.assertTrue(workflowDefinitionLinks.isEmpty());
  303. }
  304. @Test
  305. public void testFetchByPrimaryKeysWithOnePrimaryKey() throws Exception {
  306. WorkflowDefinitionLink newWorkflowDefinitionLink =
  307. addWorkflowDefinitionLink();
  308. Set<Serializable> primaryKeys = new HashSet<Serializable>();
  309. primaryKeys.add(newWorkflowDefinitionLink.getPrimaryKey());
  310. Map<Serializable, WorkflowDefinitionLink> workflowDefinitionLinks =
  311. _persistence.fetchByPrimaryKeys(primaryKeys);
  312. Assert.assertEquals(1, workflowDefinitionLinks.size());
  313. Assert.assertEquals(
  314. newWorkflowDefinitionLink,
  315. workflowDefinitionLinks.get(
  316. newWorkflowDefinitionLink.getPrimaryKey()));
  317. }
  318. @Test
  319. public void testActionableDynamicQuery() throws Exception {
  320. final IntegerWrapper count = new IntegerWrapper();
  321. ActionableDynamicQuery actionableDynamicQuery =
  322. WorkflowDefinitionLinkLocalServiceUtil.getActionableDynamicQuery();
  323. actionableDynamicQuery.setPerformActionMethod(
  324. new ActionableDynamicQuery.PerformActionMethod
  325. <WorkflowDefinitionLink>() {
  326. @Override
  327. public void performAction(
  328. WorkflowDefinitionLink workflowDefinitionLink) {
  329. Assert.assertNotNull(workflowDefinitionLink);
  330. count.increment();
  331. }
  332. });
  333. actionableDynamicQuery.performActions();
  334. Assert.assertEquals(count.getValue(), _persistence.countAll());
  335. }
  336. @Test
  337. public void testDynamicQueryByPrimaryKeyExisting() throws Exception {
  338. WorkflowDefinitionLink newWorkflowDefinitionLink =
  339. addWorkflowDefinitionLink();
  340. DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(
  341. WorkflowDefinitionLink.class, _dynamicQueryClassLoader);
  342. dynamicQuery.add(
  343. RestrictionsFactoryUtil.eq(
  344. "workflowDefinitionLinkId",
  345. newWorkflowDefinitionLink.getWorkflowDefinitionLinkId()));
  346. List<WorkflowDefinitionLink> result = _persistence.findWithDynamicQuery(
  347. dynamicQuery);
  348. Assert.assertEquals(1, result.size());
  349. WorkflowDefinitionLink existingWorkflowDefinitionLink = result.get(0);
  350. Assert.assertEquals(
  351. existingWorkflowDefinitionLink, newWorkflowDefinitionLink);
  352. }
  353. @Test
  354. public void testDynamicQueryByPrimaryKeyMissing() throws Exception {
  355. DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(
  356. WorkflowDefinitionLink.class, _dynamicQueryClassLoader);
  357. dynamicQuery.add(
  358. RestrictionsFactoryUtil.eq(
  359. "workflowDefinitionLinkId", RandomTestUtil.nextLong()));
  360. List<WorkflowDefinitionLink> result = _persistence.findWithDynamicQuery(
  361. dynamicQuery);
  362. Assert.assertEquals(0, result.size());
  363. }
  364. @Test
  365. public void testDynamicQueryByProjectionExisting() throws Exception {
  366. WorkflowDefinitionLink newWorkflowDefinitionLink =
  367. addWorkflowDefinitionLink();
  368. DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(
  369. WorkflowDefinitionLink.class, _dynamicQueryClassLoader);
  370. dynamicQuery.setProjection(
  371. ProjectionFactoryUtil.property("workflowDefinitionLinkId"));
  372. Object newWorkflowDefinitionLinkId =
  373. newWorkflowDefinitionLink.getWorkflowDefinitionLinkId();
  374. dynamicQuery.add(
  375. RestrictionsFactoryUtil.in(
  376. "workflowDefinitionLinkId",
  377. new Object[] {newWorkflowDefinitionLinkId}));
  378. List<Object> result = _persistence.findWithDynamicQuery(dynamicQuery);
  379. Assert.assertEquals(1, result.size());
  380. Object existingWorkflowDefinitionLinkId = result.get(0);
  381. Assert.assertEquals(
  382. existingWorkflowDefinitionLinkId, newWorkflowDefinitionLinkId);
  383. }
  384. @Test
  385. public void testDynamicQueryByProjectionMissing() throws Exception {
  386. DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(
  387. WorkflowDefinitionLink.class, _dynamicQueryClassLoader);
  388. dynamicQuery.setProjection(
  389. ProjectionFactoryUtil.property("workflowDefinitionLinkId"));
  390. dynamicQuery.add(
  391. RestrictionsFactoryUtil.in(
  392. "workflowDefinitionLinkId",
  393. new Object[] {RandomTestUtil.nextLong()}));
  394. List<Object> result = _persistence.findWithDynamicQuery(dynamicQuery);
  395. Assert.assertEquals(0, result.size());
  396. }
  397. @Test
  398. public void testResetOriginalValues() throws Exception {
  399. WorkflowDefinitionLink newWorkflowDefinitionLink =
  400. addWorkflowDefinitionLink();
  401. _persistence.clearCache();
  402. WorkflowDefinitionLink existingWorkflowDefinitionLink =
  403. _persistence.findByPrimaryKey(
  404. newWorkflowDefinitionLink.getPrimaryKey());
  405. Assert.assertEquals(
  406. Long.valueOf(existingWorkflowDefinitionLink.getGroupId()),
  407. ReflectionTestUtil.<Long>invoke(
  408. existingWorkflowDefinitionLink, "getOriginalGroupId",
  409. new Class<?>[0]));
  410. Assert.assertEquals(
  411. Long.valueOf(existingWorkflowDefinitionLink.getCompanyId()),
  412. ReflectionTestUtil.<Long>invoke(
  413. existingWorkflowDefinitionLink, "getOriginalCompanyId",
  414. new Class<?>[0]));
  415. Assert.assertEquals(
  416. Long.valueOf(existingWorkflowDefinitionLink.getClassNameId()),
  417. ReflectionTestUtil.<Long>invoke(
  418. existingWorkflowDefinitionLink, "getOriginalClassNameId",
  419. new Class<?>[0]));
  420. Assert.assertEquals(
  421. Long.valueOf(existingWorkflowDefinitionLink.getClassPK()),
  422. ReflectionTestUtil.<Long>invoke(
  423. existingWorkflowDefinitionLink, "getOriginalClassPK",
  424. new Class<?>[0]));
  425. Assert.assertEquals(
  426. Long.valueOf(existingWorkflowDefinitionLink.getTypePK()),
  427. ReflectionTestUtil.<Long>invoke(
  428. existingWorkflowDefinitionLink, "getOriginalTypePK",
  429. new Class<?>[0]));
  430. }
  431. protected WorkflowDefinitionLink addWorkflowDefinitionLink()
  432. throws Exception {
  433. long pk = RandomTestUtil.nextLong();
  434. WorkflowDefinitionLink workflowDefinitionLink = _persistence.create(pk);
  435. workflowDefinitionLink.setMvccVersion(RandomTestUtil.nextLong());
  436. workflowDefinitionLink.setGroupId(RandomTestUtil.nextLong());
  437. workflowDefinitionLink.setCompanyId(RandomTestUtil.nextLong());
  438. workflowDefinitionLink.setUserId(RandomTestUtil.nextLong());
  439. workflowDefinitionLink.setUserName(RandomTestUtil.randomString());
  440. workflowDefinitionLink.setCreateDate(RandomTestUtil.nextDate());
  441. workflowDefinitionLink.setModifiedDate(RandomTestUtil.nextDate());
  442. workflowDefinitionLink.setClassNameId(RandomTestUtil.nextLong());
  443. workflowDefinitionLink.setClassPK(RandomTestUtil.nextLong());
  444. workflowDefinitionLink.setTypePK(RandomTestUtil.nextLong());
  445. workflowDefinitionLink.setWorkflowDefinitionName(
  446. RandomTestUtil.randomString());
  447. workflowDefinitionLink.setWorkflowDefinitionVersion(
  448. RandomTestUtil.nextInt());
  449. _workflowDefinitionLinks.add(
  450. _persistence.update(workflowDefinitionLink));
  451. return workflowDefinitionLink;
  452. }
  453. private List<WorkflowDefinitionLink> _workflowDefinitionLinks =
  454. new ArrayList<WorkflowDefinitionLink>();
  455. private WorkflowDefinitionLinkPersistence _persistence;
  456. private ClassLoader _dynamicQueryClassLoader;
  457. }