PageRenderTime 53ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/test/persistence-test/src/testIntegration/java/com/liferay/portlet/documentlibrary/service/persistence/test/DLFileShortcutPersistenceTest.java

http://github.com/liferay/liferay-portal
Java | 624 lines | 438 code | 170 blank | 16 comment | 1 complexity | 4c99c178c9c40055107f4ed4f4016a1f 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.portlet.documentlibrary.service.persistence.test;
  15. import com.liferay.arquillian.extension.junit.bridge.junit.Arquillian;
  16. import com.liferay.document.library.kernel.exception.NoSuchFileShortcutException;
  17. import com.liferay.document.library.kernel.model.DLFileShortcut;
  18. import com.liferay.document.library.kernel.service.DLFileShortcutLocalServiceUtil;
  19. import com.liferay.document.library.kernel.service.persistence.DLFileShortcutPersistence;
  20. import com.liferay.document.library.kernel.service.persistence.DLFileShortcutUtil;
  21. import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
  22. import com.liferay.portal.kernel.dao.orm.DynamicQuery;
  23. import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
  24. import com.liferay.portal.kernel.dao.orm.ProjectionFactoryUtil;
  25. import com.liferay.portal.kernel.dao.orm.QueryUtil;
  26. import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil;
  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.Objects;
  45. import java.util.Set;
  46. import org.junit.After;
  47. import org.junit.Assert;
  48. import org.junit.Before;
  49. import org.junit.ClassRule;
  50. import org.junit.Rule;
  51. import org.junit.Test;
  52. import org.junit.runner.RunWith;
  53. /**
  54. * @generated
  55. */
  56. @RunWith(Arquillian.class)
  57. public class DLFileShortcutPersistenceTest {
  58. @ClassRule
  59. @Rule
  60. public static final AggregateTestRule aggregateTestRule =
  61. new AggregateTestRule(
  62. new LiferayIntegrationTestRule(), PersistenceTestRule.INSTANCE,
  63. new TransactionalTestRule(Propagation.REQUIRED));
  64. @Before
  65. public void setUp() {
  66. _persistence = DLFileShortcutUtil.getPersistence();
  67. Class<?> clazz = _persistence.getClass();
  68. _dynamicQueryClassLoader = clazz.getClassLoader();
  69. }
  70. @After
  71. public void tearDown() throws Exception {
  72. Iterator<DLFileShortcut> iterator = _dlFileShortcuts.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. DLFileShortcut dlFileShortcut = _persistence.create(pk);
  82. Assert.assertNotNull(dlFileShortcut);
  83. Assert.assertEquals(dlFileShortcut.getPrimaryKey(), pk);
  84. }
  85. @Test
  86. public void testRemove() throws Exception {
  87. DLFileShortcut newDLFileShortcut = addDLFileShortcut();
  88. _persistence.remove(newDLFileShortcut);
  89. DLFileShortcut existingDLFileShortcut = _persistence.fetchByPrimaryKey(
  90. newDLFileShortcut.getPrimaryKey());
  91. Assert.assertNull(existingDLFileShortcut);
  92. }
  93. @Test
  94. public void testUpdateNew() throws Exception {
  95. addDLFileShortcut();
  96. }
  97. @Test
  98. public void testUpdateExisting() throws Exception {
  99. long pk = RandomTestUtil.nextLong();
  100. DLFileShortcut newDLFileShortcut = _persistence.create(pk);
  101. newDLFileShortcut.setMvccVersion(RandomTestUtil.nextLong());
  102. newDLFileShortcut.setCtCollectionId(RandomTestUtil.nextLong());
  103. newDLFileShortcut.setUuid(RandomTestUtil.randomString());
  104. newDLFileShortcut.setGroupId(RandomTestUtil.nextLong());
  105. newDLFileShortcut.setCompanyId(RandomTestUtil.nextLong());
  106. newDLFileShortcut.setUserId(RandomTestUtil.nextLong());
  107. newDLFileShortcut.setUserName(RandomTestUtil.randomString());
  108. newDLFileShortcut.setCreateDate(RandomTestUtil.nextDate());
  109. newDLFileShortcut.setModifiedDate(RandomTestUtil.nextDate());
  110. newDLFileShortcut.setRepositoryId(RandomTestUtil.nextLong());
  111. newDLFileShortcut.setFolderId(RandomTestUtil.nextLong());
  112. newDLFileShortcut.setToFileEntryId(RandomTestUtil.nextLong());
  113. newDLFileShortcut.setTreePath(RandomTestUtil.randomString());
  114. newDLFileShortcut.setActive(RandomTestUtil.randomBoolean());
  115. newDLFileShortcut.setLastPublishDate(RandomTestUtil.nextDate());
  116. newDLFileShortcut.setStatus(RandomTestUtil.nextInt());
  117. newDLFileShortcut.setStatusByUserId(RandomTestUtil.nextLong());
  118. newDLFileShortcut.setStatusByUserName(RandomTestUtil.randomString());
  119. newDLFileShortcut.setStatusDate(RandomTestUtil.nextDate());
  120. _dlFileShortcuts.add(_persistence.update(newDLFileShortcut));
  121. DLFileShortcut existingDLFileShortcut = _persistence.findByPrimaryKey(
  122. newDLFileShortcut.getPrimaryKey());
  123. Assert.assertEquals(
  124. existingDLFileShortcut.getMvccVersion(),
  125. newDLFileShortcut.getMvccVersion());
  126. Assert.assertEquals(
  127. existingDLFileShortcut.getCtCollectionId(),
  128. newDLFileShortcut.getCtCollectionId());
  129. Assert.assertEquals(
  130. existingDLFileShortcut.getUuid(), newDLFileShortcut.getUuid());
  131. Assert.assertEquals(
  132. existingDLFileShortcut.getFileShortcutId(),
  133. newDLFileShortcut.getFileShortcutId());
  134. Assert.assertEquals(
  135. existingDLFileShortcut.getGroupId(),
  136. newDLFileShortcut.getGroupId());
  137. Assert.assertEquals(
  138. existingDLFileShortcut.getCompanyId(),
  139. newDLFileShortcut.getCompanyId());
  140. Assert.assertEquals(
  141. existingDLFileShortcut.getUserId(), newDLFileShortcut.getUserId());
  142. Assert.assertEquals(
  143. existingDLFileShortcut.getUserName(),
  144. newDLFileShortcut.getUserName());
  145. Assert.assertEquals(
  146. Time.getShortTimestamp(existingDLFileShortcut.getCreateDate()),
  147. Time.getShortTimestamp(newDLFileShortcut.getCreateDate()));
  148. Assert.assertEquals(
  149. Time.getShortTimestamp(existingDLFileShortcut.getModifiedDate()),
  150. Time.getShortTimestamp(newDLFileShortcut.getModifiedDate()));
  151. Assert.assertEquals(
  152. existingDLFileShortcut.getRepositoryId(),
  153. newDLFileShortcut.getRepositoryId());
  154. Assert.assertEquals(
  155. existingDLFileShortcut.getFolderId(),
  156. newDLFileShortcut.getFolderId());
  157. Assert.assertEquals(
  158. existingDLFileShortcut.getToFileEntryId(),
  159. newDLFileShortcut.getToFileEntryId());
  160. Assert.assertEquals(
  161. existingDLFileShortcut.getTreePath(),
  162. newDLFileShortcut.getTreePath());
  163. Assert.assertEquals(
  164. existingDLFileShortcut.isActive(), newDLFileShortcut.isActive());
  165. Assert.assertEquals(
  166. Time.getShortTimestamp(existingDLFileShortcut.getLastPublishDate()),
  167. Time.getShortTimestamp(newDLFileShortcut.getLastPublishDate()));
  168. Assert.assertEquals(
  169. existingDLFileShortcut.getStatus(), newDLFileShortcut.getStatus());
  170. Assert.assertEquals(
  171. existingDLFileShortcut.getStatusByUserId(),
  172. newDLFileShortcut.getStatusByUserId());
  173. Assert.assertEquals(
  174. existingDLFileShortcut.getStatusByUserName(),
  175. newDLFileShortcut.getStatusByUserName());
  176. Assert.assertEquals(
  177. Time.getShortTimestamp(existingDLFileShortcut.getStatusDate()),
  178. Time.getShortTimestamp(newDLFileShortcut.getStatusDate()));
  179. }
  180. @Test
  181. public void testCountByUuid() throws Exception {
  182. _persistence.countByUuid("");
  183. _persistence.countByUuid("null");
  184. _persistence.countByUuid((String)null);
  185. }
  186. @Test
  187. public void testCountByUUID_G() throws Exception {
  188. _persistence.countByUUID_G("", RandomTestUtil.nextLong());
  189. _persistence.countByUUID_G("null", 0L);
  190. _persistence.countByUUID_G((String)null, 0L);
  191. }
  192. @Test
  193. public void testCountByUuid_C() throws Exception {
  194. _persistence.countByUuid_C("", RandomTestUtil.nextLong());
  195. _persistence.countByUuid_C("null", 0L);
  196. _persistence.countByUuid_C((String)null, 0L);
  197. }
  198. @Test
  199. public void testCountByCompanyId() throws Exception {
  200. _persistence.countByCompanyId(RandomTestUtil.nextLong());
  201. _persistence.countByCompanyId(0L);
  202. }
  203. @Test
  204. public void testCountByToFileEntryId() throws Exception {
  205. _persistence.countByToFileEntryId(RandomTestUtil.nextLong());
  206. _persistence.countByToFileEntryId(0L);
  207. }
  208. @Test
  209. public void testCountByG_F() throws Exception {
  210. _persistence.countByG_F(
  211. RandomTestUtil.nextLong(), RandomTestUtil.nextLong());
  212. _persistence.countByG_F(0L, 0L);
  213. }
  214. @Test
  215. public void testCountByC_NotS() throws Exception {
  216. _persistence.countByC_NotS(
  217. RandomTestUtil.nextLong(), RandomTestUtil.nextInt());
  218. _persistence.countByC_NotS(0L, 0);
  219. }
  220. @Test
  221. public void testCountByG_F_A() throws Exception {
  222. _persistence.countByG_F_A(
  223. RandomTestUtil.nextLong(), RandomTestUtil.nextLong(),
  224. RandomTestUtil.randomBoolean());
  225. _persistence.countByG_F_A(0L, 0L, RandomTestUtil.randomBoolean());
  226. }
  227. @Test
  228. public void testCountByG_F_A_S() throws Exception {
  229. _persistence.countByG_F_A_S(
  230. RandomTestUtil.nextLong(), RandomTestUtil.nextLong(),
  231. RandomTestUtil.randomBoolean(), RandomTestUtil.nextInt());
  232. _persistence.countByG_F_A_S(0L, 0L, RandomTestUtil.randomBoolean(), 0);
  233. }
  234. @Test
  235. public void testFindByPrimaryKeyExisting() throws Exception {
  236. DLFileShortcut newDLFileShortcut = addDLFileShortcut();
  237. DLFileShortcut existingDLFileShortcut = _persistence.findByPrimaryKey(
  238. newDLFileShortcut.getPrimaryKey());
  239. Assert.assertEquals(existingDLFileShortcut, newDLFileShortcut);
  240. }
  241. @Test(expected = NoSuchFileShortcutException.class)
  242. public void testFindByPrimaryKeyMissing() throws Exception {
  243. long pk = RandomTestUtil.nextLong();
  244. _persistence.findByPrimaryKey(pk);
  245. }
  246. @Test
  247. public void testFindAll() throws Exception {
  248. _persistence.findAll(
  249. QueryUtil.ALL_POS, QueryUtil.ALL_POS, getOrderByComparator());
  250. }
  251. protected OrderByComparator<DLFileShortcut> getOrderByComparator() {
  252. return OrderByComparatorFactoryUtil.create(
  253. "DLFileShortcut", "mvccVersion", true, "ctCollectionId", true,
  254. "uuid", true, "fileShortcutId", true, "groupId", true, "companyId",
  255. true, "userId", true, "userName", true, "createDate", true,
  256. "modifiedDate", true, "repositoryId", true, "folderId", true,
  257. "toFileEntryId", true, "treePath", true, "active", true,
  258. "lastPublishDate", true, "status", true, "statusByUserId", true,
  259. "statusByUserName", true, "statusDate", true);
  260. }
  261. @Test
  262. public void testFetchByPrimaryKeyExisting() throws Exception {
  263. DLFileShortcut newDLFileShortcut = addDLFileShortcut();
  264. DLFileShortcut existingDLFileShortcut = _persistence.fetchByPrimaryKey(
  265. newDLFileShortcut.getPrimaryKey());
  266. Assert.assertEquals(existingDLFileShortcut, newDLFileShortcut);
  267. }
  268. @Test
  269. public void testFetchByPrimaryKeyMissing() throws Exception {
  270. long pk = RandomTestUtil.nextLong();
  271. DLFileShortcut missingDLFileShortcut = _persistence.fetchByPrimaryKey(
  272. pk);
  273. Assert.assertNull(missingDLFileShortcut);
  274. }
  275. @Test
  276. public void testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereAllPrimaryKeysExist()
  277. throws Exception {
  278. DLFileShortcut newDLFileShortcut1 = addDLFileShortcut();
  279. DLFileShortcut newDLFileShortcut2 = addDLFileShortcut();
  280. Set<Serializable> primaryKeys = new HashSet<Serializable>();
  281. primaryKeys.add(newDLFileShortcut1.getPrimaryKey());
  282. primaryKeys.add(newDLFileShortcut2.getPrimaryKey());
  283. Map<Serializable, DLFileShortcut> dlFileShortcuts =
  284. _persistence.fetchByPrimaryKeys(primaryKeys);
  285. Assert.assertEquals(2, dlFileShortcuts.size());
  286. Assert.assertEquals(
  287. newDLFileShortcut1,
  288. dlFileShortcuts.get(newDLFileShortcut1.getPrimaryKey()));
  289. Assert.assertEquals(
  290. newDLFileShortcut2,
  291. dlFileShortcuts.get(newDLFileShortcut2.getPrimaryKey()));
  292. }
  293. @Test
  294. public void testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereNoPrimaryKeysExist()
  295. throws Exception {
  296. long pk1 = RandomTestUtil.nextLong();
  297. long pk2 = RandomTestUtil.nextLong();
  298. Set<Serializable> primaryKeys = new HashSet<Serializable>();
  299. primaryKeys.add(pk1);
  300. primaryKeys.add(pk2);
  301. Map<Serializable, DLFileShortcut> dlFileShortcuts =
  302. _persistence.fetchByPrimaryKeys(primaryKeys);
  303. Assert.assertTrue(dlFileShortcuts.isEmpty());
  304. }
  305. @Test
  306. public void testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereSomePrimaryKeysExist()
  307. throws Exception {
  308. DLFileShortcut newDLFileShortcut = addDLFileShortcut();
  309. long pk = RandomTestUtil.nextLong();
  310. Set<Serializable> primaryKeys = new HashSet<Serializable>();
  311. primaryKeys.add(newDLFileShortcut.getPrimaryKey());
  312. primaryKeys.add(pk);
  313. Map<Serializable, DLFileShortcut> dlFileShortcuts =
  314. _persistence.fetchByPrimaryKeys(primaryKeys);
  315. Assert.assertEquals(1, dlFileShortcuts.size());
  316. Assert.assertEquals(
  317. newDLFileShortcut,
  318. dlFileShortcuts.get(newDLFileShortcut.getPrimaryKey()));
  319. }
  320. @Test
  321. public void testFetchByPrimaryKeysWithNoPrimaryKeys() throws Exception {
  322. Set<Serializable> primaryKeys = new HashSet<Serializable>();
  323. Map<Serializable, DLFileShortcut> dlFileShortcuts =
  324. _persistence.fetchByPrimaryKeys(primaryKeys);
  325. Assert.assertTrue(dlFileShortcuts.isEmpty());
  326. }
  327. @Test
  328. public void testFetchByPrimaryKeysWithOnePrimaryKey() throws Exception {
  329. DLFileShortcut newDLFileShortcut = addDLFileShortcut();
  330. Set<Serializable> primaryKeys = new HashSet<Serializable>();
  331. primaryKeys.add(newDLFileShortcut.getPrimaryKey());
  332. Map<Serializable, DLFileShortcut> dlFileShortcuts =
  333. _persistence.fetchByPrimaryKeys(primaryKeys);
  334. Assert.assertEquals(1, dlFileShortcuts.size());
  335. Assert.assertEquals(
  336. newDLFileShortcut,
  337. dlFileShortcuts.get(newDLFileShortcut.getPrimaryKey()));
  338. }
  339. @Test
  340. public void testActionableDynamicQuery() throws Exception {
  341. final IntegerWrapper count = new IntegerWrapper();
  342. ActionableDynamicQuery actionableDynamicQuery =
  343. DLFileShortcutLocalServiceUtil.getActionableDynamicQuery();
  344. actionableDynamicQuery.setPerformActionMethod(
  345. new ActionableDynamicQuery.PerformActionMethod<DLFileShortcut>() {
  346. @Override
  347. public void performAction(DLFileShortcut dlFileShortcut) {
  348. Assert.assertNotNull(dlFileShortcut);
  349. count.increment();
  350. }
  351. });
  352. actionableDynamicQuery.performActions();
  353. Assert.assertEquals(count.getValue(), _persistence.countAll());
  354. }
  355. @Test
  356. public void testDynamicQueryByPrimaryKeyExisting() throws Exception {
  357. DLFileShortcut newDLFileShortcut = addDLFileShortcut();
  358. DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(
  359. DLFileShortcut.class, _dynamicQueryClassLoader);
  360. dynamicQuery.add(
  361. RestrictionsFactoryUtil.eq(
  362. "fileShortcutId", newDLFileShortcut.getFileShortcutId()));
  363. List<DLFileShortcut> result = _persistence.findWithDynamicQuery(
  364. dynamicQuery);
  365. Assert.assertEquals(1, result.size());
  366. DLFileShortcut existingDLFileShortcut = result.get(0);
  367. Assert.assertEquals(existingDLFileShortcut, newDLFileShortcut);
  368. }
  369. @Test
  370. public void testDynamicQueryByPrimaryKeyMissing() throws Exception {
  371. DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(
  372. DLFileShortcut.class, _dynamicQueryClassLoader);
  373. dynamicQuery.add(
  374. RestrictionsFactoryUtil.eq(
  375. "fileShortcutId", RandomTestUtil.nextLong()));
  376. List<DLFileShortcut> result = _persistence.findWithDynamicQuery(
  377. dynamicQuery);
  378. Assert.assertEquals(0, result.size());
  379. }
  380. @Test
  381. public void testDynamicQueryByProjectionExisting() throws Exception {
  382. DLFileShortcut newDLFileShortcut = addDLFileShortcut();
  383. DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(
  384. DLFileShortcut.class, _dynamicQueryClassLoader);
  385. dynamicQuery.setProjection(
  386. ProjectionFactoryUtil.property("fileShortcutId"));
  387. Object newFileShortcutId = newDLFileShortcut.getFileShortcutId();
  388. dynamicQuery.add(
  389. RestrictionsFactoryUtil.in(
  390. "fileShortcutId", new Object[] {newFileShortcutId}));
  391. List<Object> result = _persistence.findWithDynamicQuery(dynamicQuery);
  392. Assert.assertEquals(1, result.size());
  393. Object existingFileShortcutId = result.get(0);
  394. Assert.assertEquals(existingFileShortcutId, newFileShortcutId);
  395. }
  396. @Test
  397. public void testDynamicQueryByProjectionMissing() throws Exception {
  398. DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(
  399. DLFileShortcut.class, _dynamicQueryClassLoader);
  400. dynamicQuery.setProjection(
  401. ProjectionFactoryUtil.property("fileShortcutId"));
  402. dynamicQuery.add(
  403. RestrictionsFactoryUtil.in(
  404. "fileShortcutId", new Object[] {RandomTestUtil.nextLong()}));
  405. List<Object> result = _persistence.findWithDynamicQuery(dynamicQuery);
  406. Assert.assertEquals(0, result.size());
  407. }
  408. @Test
  409. public void testResetOriginalValues() throws Exception {
  410. DLFileShortcut newDLFileShortcut = addDLFileShortcut();
  411. _persistence.clearCache();
  412. DLFileShortcut existingDLFileShortcut = _persistence.findByPrimaryKey(
  413. newDLFileShortcut.getPrimaryKey());
  414. Assert.assertTrue(
  415. Objects.equals(
  416. existingDLFileShortcut.getUuid(),
  417. ReflectionTestUtil.invoke(
  418. existingDLFileShortcut, "getOriginalUuid",
  419. new Class<?>[0])));
  420. Assert.assertEquals(
  421. Long.valueOf(existingDLFileShortcut.getGroupId()),
  422. ReflectionTestUtil.<Long>invoke(
  423. existingDLFileShortcut, "getOriginalGroupId", new Class<?>[0]));
  424. }
  425. protected DLFileShortcut addDLFileShortcut() throws Exception {
  426. long pk = RandomTestUtil.nextLong();
  427. DLFileShortcut dlFileShortcut = _persistence.create(pk);
  428. dlFileShortcut.setMvccVersion(RandomTestUtil.nextLong());
  429. dlFileShortcut.setCtCollectionId(RandomTestUtil.nextLong());
  430. dlFileShortcut.setUuid(RandomTestUtil.randomString());
  431. dlFileShortcut.setGroupId(RandomTestUtil.nextLong());
  432. dlFileShortcut.setCompanyId(RandomTestUtil.nextLong());
  433. dlFileShortcut.setUserId(RandomTestUtil.nextLong());
  434. dlFileShortcut.setUserName(RandomTestUtil.randomString());
  435. dlFileShortcut.setCreateDate(RandomTestUtil.nextDate());
  436. dlFileShortcut.setModifiedDate(RandomTestUtil.nextDate());
  437. dlFileShortcut.setRepositoryId(RandomTestUtil.nextLong());
  438. dlFileShortcut.setFolderId(RandomTestUtil.nextLong());
  439. dlFileShortcut.setToFileEntryId(RandomTestUtil.nextLong());
  440. dlFileShortcut.setTreePath(RandomTestUtil.randomString());
  441. dlFileShortcut.setActive(RandomTestUtil.randomBoolean());
  442. dlFileShortcut.setLastPublishDate(RandomTestUtil.nextDate());
  443. dlFileShortcut.setStatus(RandomTestUtil.nextInt());
  444. dlFileShortcut.setStatusByUserId(RandomTestUtil.nextLong());
  445. dlFileShortcut.setStatusByUserName(RandomTestUtil.randomString());
  446. dlFileShortcut.setStatusDate(RandomTestUtil.nextDate());
  447. _dlFileShortcuts.add(_persistence.update(dlFileShortcut));
  448. return dlFileShortcut;
  449. }
  450. private List<DLFileShortcut> _dlFileShortcuts =
  451. new ArrayList<DLFileShortcut>();
  452. private DLFileShortcutPersistence _persistence;
  453. private ClassLoader _dynamicQueryClassLoader;
  454. }