PageRenderTime 27ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/apps/wiki/wiki-test/src/testIntegration/java/com/liferay/wiki/service/persistence/test/WikiNodePersistenceTest.java

http://github.com/liferay/liferay-portal
Java | 658 lines | 458 code | 184 blank | 16 comment | 2 complexity | 38b206d39cf87225c945e90cb89a9f64 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.wiki.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.dao.orm.Session;
  23. import com.liferay.portal.kernel.test.ReflectionTestUtil;
  24. import com.liferay.portal.kernel.test.rule.AggregateTestRule;
  25. import com.liferay.portal.kernel.test.util.RandomTestUtil;
  26. import com.liferay.portal.kernel.transaction.Propagation;
  27. import com.liferay.portal.kernel.util.IntegerWrapper;
  28. import com.liferay.portal.kernel.util.OrderByComparator;
  29. import com.liferay.portal.kernel.util.OrderByComparatorFactoryUtil;
  30. import com.liferay.portal.kernel.util.Time;
  31. import com.liferay.portal.test.rule.LiferayIntegrationTestRule;
  32. import com.liferay.portal.test.rule.PersistenceTestRule;
  33. import com.liferay.portal.test.rule.TransactionalTestRule;
  34. import com.liferay.wiki.exception.NoSuchNodeException;
  35. import com.liferay.wiki.model.WikiNode;
  36. import com.liferay.wiki.service.WikiNodeLocalServiceUtil;
  37. import com.liferay.wiki.service.persistence.WikiNodePersistence;
  38. import com.liferay.wiki.service.persistence.WikiNodeUtil;
  39. import java.io.Serializable;
  40. import java.util.ArrayList;
  41. import java.util.HashSet;
  42. import java.util.Iterator;
  43. import java.util.List;
  44. import java.util.Map;
  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 WikiNodePersistenceTest {
  58. @ClassRule
  59. @Rule
  60. public static final AggregateTestRule aggregateTestRule =
  61. new AggregateTestRule(
  62. new LiferayIntegrationTestRule(), PersistenceTestRule.INSTANCE,
  63. new TransactionalTestRule(
  64. Propagation.REQUIRED, "com.liferay.wiki.service"));
  65. @Before
  66. public void setUp() {
  67. _persistence = WikiNodeUtil.getPersistence();
  68. Class<?> clazz = _persistence.getClass();
  69. _dynamicQueryClassLoader = clazz.getClassLoader();
  70. }
  71. @After
  72. public void tearDown() throws Exception {
  73. Iterator<WikiNode> iterator = _wikiNodes.iterator();
  74. while (iterator.hasNext()) {
  75. _persistence.remove(iterator.next());
  76. iterator.remove();
  77. }
  78. }
  79. @Test
  80. public void testCreate() throws Exception {
  81. long pk = RandomTestUtil.nextLong();
  82. WikiNode wikiNode = _persistence.create(pk);
  83. Assert.assertNotNull(wikiNode);
  84. Assert.assertEquals(wikiNode.getPrimaryKey(), pk);
  85. }
  86. @Test
  87. public void testRemove() throws Exception {
  88. WikiNode newWikiNode = addWikiNode();
  89. _persistence.remove(newWikiNode);
  90. WikiNode existingWikiNode = _persistence.fetchByPrimaryKey(
  91. newWikiNode.getPrimaryKey());
  92. Assert.assertNull(existingWikiNode);
  93. }
  94. @Test
  95. public void testUpdateNew() throws Exception {
  96. addWikiNode();
  97. }
  98. @Test
  99. public void testUpdateExisting() throws Exception {
  100. long pk = RandomTestUtil.nextLong();
  101. WikiNode newWikiNode = _persistence.create(pk);
  102. newWikiNode.setMvccVersion(RandomTestUtil.nextLong());
  103. newWikiNode.setUuid(RandomTestUtil.randomString());
  104. newWikiNode.setExternalReferenceCode(RandomTestUtil.randomString());
  105. newWikiNode.setGroupId(RandomTestUtil.nextLong());
  106. newWikiNode.setCompanyId(RandomTestUtil.nextLong());
  107. newWikiNode.setUserId(RandomTestUtil.nextLong());
  108. newWikiNode.setUserName(RandomTestUtil.randomString());
  109. newWikiNode.setCreateDate(RandomTestUtil.nextDate());
  110. newWikiNode.setModifiedDate(RandomTestUtil.nextDate());
  111. newWikiNode.setName(RandomTestUtil.randomString());
  112. newWikiNode.setDescription(RandomTestUtil.randomString());
  113. newWikiNode.setLastPostDate(RandomTestUtil.nextDate());
  114. newWikiNode.setLastPublishDate(RandomTestUtil.nextDate());
  115. newWikiNode.setStatus(RandomTestUtil.nextInt());
  116. newWikiNode.setStatusByUserId(RandomTestUtil.nextLong());
  117. newWikiNode.setStatusByUserName(RandomTestUtil.randomString());
  118. newWikiNode.setStatusDate(RandomTestUtil.nextDate());
  119. _wikiNodes.add(_persistence.update(newWikiNode));
  120. WikiNode existingWikiNode = _persistence.findByPrimaryKey(
  121. newWikiNode.getPrimaryKey());
  122. Assert.assertEquals(
  123. existingWikiNode.getMvccVersion(), newWikiNode.getMvccVersion());
  124. Assert.assertEquals(existingWikiNode.getUuid(), newWikiNode.getUuid());
  125. Assert.assertEquals(
  126. existingWikiNode.getExternalReferenceCode(),
  127. newWikiNode.getExternalReferenceCode());
  128. Assert.assertEquals(
  129. existingWikiNode.getNodeId(), newWikiNode.getNodeId());
  130. Assert.assertEquals(
  131. existingWikiNode.getGroupId(), newWikiNode.getGroupId());
  132. Assert.assertEquals(
  133. existingWikiNode.getCompanyId(), newWikiNode.getCompanyId());
  134. Assert.assertEquals(
  135. existingWikiNode.getUserId(), newWikiNode.getUserId());
  136. Assert.assertEquals(
  137. existingWikiNode.getUserName(), newWikiNode.getUserName());
  138. Assert.assertEquals(
  139. Time.getShortTimestamp(existingWikiNode.getCreateDate()),
  140. Time.getShortTimestamp(newWikiNode.getCreateDate()));
  141. Assert.assertEquals(
  142. Time.getShortTimestamp(existingWikiNode.getModifiedDate()),
  143. Time.getShortTimestamp(newWikiNode.getModifiedDate()));
  144. Assert.assertEquals(existingWikiNode.getName(), newWikiNode.getName());
  145. Assert.assertEquals(
  146. existingWikiNode.getDescription(), newWikiNode.getDescription());
  147. Assert.assertEquals(
  148. Time.getShortTimestamp(existingWikiNode.getLastPostDate()),
  149. Time.getShortTimestamp(newWikiNode.getLastPostDate()));
  150. Assert.assertEquals(
  151. Time.getShortTimestamp(existingWikiNode.getLastPublishDate()),
  152. Time.getShortTimestamp(newWikiNode.getLastPublishDate()));
  153. Assert.assertEquals(
  154. existingWikiNode.getStatus(), newWikiNode.getStatus());
  155. Assert.assertEquals(
  156. existingWikiNode.getStatusByUserId(),
  157. newWikiNode.getStatusByUserId());
  158. Assert.assertEquals(
  159. existingWikiNode.getStatusByUserName(),
  160. newWikiNode.getStatusByUserName());
  161. Assert.assertEquals(
  162. Time.getShortTimestamp(existingWikiNode.getStatusDate()),
  163. Time.getShortTimestamp(newWikiNode.getStatusDate()));
  164. }
  165. @Test
  166. public void testCountByUuid() throws Exception {
  167. _persistence.countByUuid("");
  168. _persistence.countByUuid("null");
  169. _persistence.countByUuid((String)null);
  170. }
  171. @Test
  172. public void testCountByUUID_G() throws Exception {
  173. _persistence.countByUUID_G("", RandomTestUtil.nextLong());
  174. _persistence.countByUUID_G("null", 0L);
  175. _persistence.countByUUID_G((String)null, 0L);
  176. }
  177. @Test
  178. public void testCountByUuid_C() throws Exception {
  179. _persistence.countByUuid_C("", RandomTestUtil.nextLong());
  180. _persistence.countByUuid_C("null", 0L);
  181. _persistence.countByUuid_C((String)null, 0L);
  182. }
  183. @Test
  184. public void testCountByGroupId() throws Exception {
  185. _persistence.countByGroupId(RandomTestUtil.nextLong());
  186. _persistence.countByGroupId(0L);
  187. }
  188. @Test
  189. public void testCountByCompanyId() throws Exception {
  190. _persistence.countByCompanyId(RandomTestUtil.nextLong());
  191. _persistence.countByCompanyId(0L);
  192. }
  193. @Test
  194. public void testCountByG_N() throws Exception {
  195. _persistence.countByG_N(RandomTestUtil.nextLong(), "");
  196. _persistence.countByG_N(0L, "null");
  197. _persistence.countByG_N(0L, (String)null);
  198. }
  199. @Test
  200. public void testCountByG_S() throws Exception {
  201. _persistence.countByG_S(
  202. RandomTestUtil.nextLong(), RandomTestUtil.nextInt());
  203. _persistence.countByG_S(0L, 0);
  204. }
  205. @Test
  206. public void testCountByC_S() throws Exception {
  207. _persistence.countByC_S(
  208. RandomTestUtil.nextLong(), RandomTestUtil.nextInt());
  209. _persistence.countByC_S(0L, 0);
  210. }
  211. @Test
  212. public void testCountByG_ERC() throws Exception {
  213. _persistence.countByG_ERC(RandomTestUtil.nextLong(), "");
  214. _persistence.countByG_ERC(0L, "null");
  215. _persistence.countByG_ERC(0L, (String)null);
  216. }
  217. @Test
  218. public void testFindByPrimaryKeyExisting() throws Exception {
  219. WikiNode newWikiNode = addWikiNode();
  220. WikiNode existingWikiNode = _persistence.findByPrimaryKey(
  221. newWikiNode.getPrimaryKey());
  222. Assert.assertEquals(existingWikiNode, newWikiNode);
  223. }
  224. @Test(expected = NoSuchNodeException.class)
  225. public void testFindByPrimaryKeyMissing() throws Exception {
  226. long pk = RandomTestUtil.nextLong();
  227. _persistence.findByPrimaryKey(pk);
  228. }
  229. @Test
  230. public void testFindAll() throws Exception {
  231. _persistence.findAll(
  232. QueryUtil.ALL_POS, QueryUtil.ALL_POS, getOrderByComparator());
  233. }
  234. @Test
  235. public void testFilterFindByGroupId() throws Exception {
  236. _persistence.filterFindByGroupId(
  237. 0, QueryUtil.ALL_POS, QueryUtil.ALL_POS, getOrderByComparator());
  238. }
  239. protected OrderByComparator<WikiNode> getOrderByComparator() {
  240. return OrderByComparatorFactoryUtil.create(
  241. "WikiNode", "mvccVersion", true, "uuid", true,
  242. "externalReferenceCode", true, "nodeId", true, "groupId", true,
  243. "companyId", true, "userId", true, "userName", true, "createDate",
  244. true, "modifiedDate", true, "name", true, "description", true,
  245. "lastPostDate", true, "lastPublishDate", true, "status", true,
  246. "statusByUserId", true, "statusByUserName", true, "statusDate",
  247. true);
  248. }
  249. @Test
  250. public void testFetchByPrimaryKeyExisting() throws Exception {
  251. WikiNode newWikiNode = addWikiNode();
  252. WikiNode existingWikiNode = _persistence.fetchByPrimaryKey(
  253. newWikiNode.getPrimaryKey());
  254. Assert.assertEquals(existingWikiNode, newWikiNode);
  255. }
  256. @Test
  257. public void testFetchByPrimaryKeyMissing() throws Exception {
  258. long pk = RandomTestUtil.nextLong();
  259. WikiNode missingWikiNode = _persistence.fetchByPrimaryKey(pk);
  260. Assert.assertNull(missingWikiNode);
  261. }
  262. @Test
  263. public void testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereAllPrimaryKeysExist()
  264. throws Exception {
  265. WikiNode newWikiNode1 = addWikiNode();
  266. WikiNode newWikiNode2 = addWikiNode();
  267. Set<Serializable> primaryKeys = new HashSet<Serializable>();
  268. primaryKeys.add(newWikiNode1.getPrimaryKey());
  269. primaryKeys.add(newWikiNode2.getPrimaryKey());
  270. Map<Serializable, WikiNode> wikiNodes = _persistence.fetchByPrimaryKeys(
  271. primaryKeys);
  272. Assert.assertEquals(2, wikiNodes.size());
  273. Assert.assertEquals(
  274. newWikiNode1, wikiNodes.get(newWikiNode1.getPrimaryKey()));
  275. Assert.assertEquals(
  276. newWikiNode2, wikiNodes.get(newWikiNode2.getPrimaryKey()));
  277. }
  278. @Test
  279. public void testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereNoPrimaryKeysExist()
  280. throws Exception {
  281. long pk1 = RandomTestUtil.nextLong();
  282. long pk2 = RandomTestUtil.nextLong();
  283. Set<Serializable> primaryKeys = new HashSet<Serializable>();
  284. primaryKeys.add(pk1);
  285. primaryKeys.add(pk2);
  286. Map<Serializable, WikiNode> wikiNodes = _persistence.fetchByPrimaryKeys(
  287. primaryKeys);
  288. Assert.assertTrue(wikiNodes.isEmpty());
  289. }
  290. @Test
  291. public void testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereSomePrimaryKeysExist()
  292. throws Exception {
  293. WikiNode newWikiNode = addWikiNode();
  294. long pk = RandomTestUtil.nextLong();
  295. Set<Serializable> primaryKeys = new HashSet<Serializable>();
  296. primaryKeys.add(newWikiNode.getPrimaryKey());
  297. primaryKeys.add(pk);
  298. Map<Serializable, WikiNode> wikiNodes = _persistence.fetchByPrimaryKeys(
  299. primaryKeys);
  300. Assert.assertEquals(1, wikiNodes.size());
  301. Assert.assertEquals(
  302. newWikiNode, wikiNodes.get(newWikiNode.getPrimaryKey()));
  303. }
  304. @Test
  305. public void testFetchByPrimaryKeysWithNoPrimaryKeys() throws Exception {
  306. Set<Serializable> primaryKeys = new HashSet<Serializable>();
  307. Map<Serializable, WikiNode> wikiNodes = _persistence.fetchByPrimaryKeys(
  308. primaryKeys);
  309. Assert.assertTrue(wikiNodes.isEmpty());
  310. }
  311. @Test
  312. public void testFetchByPrimaryKeysWithOnePrimaryKey() throws Exception {
  313. WikiNode newWikiNode = addWikiNode();
  314. Set<Serializable> primaryKeys = new HashSet<Serializable>();
  315. primaryKeys.add(newWikiNode.getPrimaryKey());
  316. Map<Serializable, WikiNode> wikiNodes = _persistence.fetchByPrimaryKeys(
  317. primaryKeys);
  318. Assert.assertEquals(1, wikiNodes.size());
  319. Assert.assertEquals(
  320. newWikiNode, wikiNodes.get(newWikiNode.getPrimaryKey()));
  321. }
  322. @Test
  323. public void testActionableDynamicQuery() throws Exception {
  324. final IntegerWrapper count = new IntegerWrapper();
  325. ActionableDynamicQuery actionableDynamicQuery =
  326. WikiNodeLocalServiceUtil.getActionableDynamicQuery();
  327. actionableDynamicQuery.setPerformActionMethod(
  328. new ActionableDynamicQuery.PerformActionMethod<WikiNode>() {
  329. @Override
  330. public void performAction(WikiNode wikiNode) {
  331. Assert.assertNotNull(wikiNode);
  332. count.increment();
  333. }
  334. });
  335. actionableDynamicQuery.performActions();
  336. Assert.assertEquals(count.getValue(), _persistence.countAll());
  337. }
  338. @Test
  339. public void testDynamicQueryByPrimaryKeyExisting() throws Exception {
  340. WikiNode newWikiNode = addWikiNode();
  341. DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(
  342. WikiNode.class, _dynamicQueryClassLoader);
  343. dynamicQuery.add(
  344. RestrictionsFactoryUtil.eq("nodeId", newWikiNode.getNodeId()));
  345. List<WikiNode> result = _persistence.findWithDynamicQuery(dynamicQuery);
  346. Assert.assertEquals(1, result.size());
  347. WikiNode existingWikiNode = result.get(0);
  348. Assert.assertEquals(existingWikiNode, newWikiNode);
  349. }
  350. @Test
  351. public void testDynamicQueryByPrimaryKeyMissing() throws Exception {
  352. DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(
  353. WikiNode.class, _dynamicQueryClassLoader);
  354. dynamicQuery.add(
  355. RestrictionsFactoryUtil.eq("nodeId", RandomTestUtil.nextLong()));
  356. List<WikiNode> result = _persistence.findWithDynamicQuery(dynamicQuery);
  357. Assert.assertEquals(0, result.size());
  358. }
  359. @Test
  360. public void testDynamicQueryByProjectionExisting() throws Exception {
  361. WikiNode newWikiNode = addWikiNode();
  362. DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(
  363. WikiNode.class, _dynamicQueryClassLoader);
  364. dynamicQuery.setProjection(ProjectionFactoryUtil.property("nodeId"));
  365. Object newNodeId = newWikiNode.getNodeId();
  366. dynamicQuery.add(
  367. RestrictionsFactoryUtil.in("nodeId", new Object[] {newNodeId}));
  368. List<Object> result = _persistence.findWithDynamicQuery(dynamicQuery);
  369. Assert.assertEquals(1, result.size());
  370. Object existingNodeId = result.get(0);
  371. Assert.assertEquals(existingNodeId, newNodeId);
  372. }
  373. @Test
  374. public void testDynamicQueryByProjectionMissing() throws Exception {
  375. DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(
  376. WikiNode.class, _dynamicQueryClassLoader);
  377. dynamicQuery.setProjection(ProjectionFactoryUtil.property("nodeId"));
  378. dynamicQuery.add(
  379. RestrictionsFactoryUtil.in(
  380. "nodeId", new Object[] {RandomTestUtil.nextLong()}));
  381. List<Object> result = _persistence.findWithDynamicQuery(dynamicQuery);
  382. Assert.assertEquals(0, result.size());
  383. }
  384. @Test
  385. public void testResetOriginalValues() throws Exception {
  386. WikiNode newWikiNode = addWikiNode();
  387. _persistence.clearCache();
  388. _assertOriginalValues(
  389. _persistence.findByPrimaryKey(newWikiNode.getPrimaryKey()));
  390. }
  391. @Test
  392. public void testResetOriginalValuesWithDynamicQueryLoadFromDatabase()
  393. throws Exception {
  394. _testResetOriginalValuesWithDynamicQuery(true);
  395. }
  396. @Test
  397. public void testResetOriginalValuesWithDynamicQueryLoadFromSession()
  398. throws Exception {
  399. _testResetOriginalValuesWithDynamicQuery(false);
  400. }
  401. private void _testResetOriginalValuesWithDynamicQuery(boolean clearSession)
  402. throws Exception {
  403. WikiNode newWikiNode = addWikiNode();
  404. if (clearSession) {
  405. Session session = _persistence.openSession();
  406. session.flush();
  407. session.clear();
  408. }
  409. DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(
  410. WikiNode.class, _dynamicQueryClassLoader);
  411. dynamicQuery.add(
  412. RestrictionsFactoryUtil.eq("nodeId", newWikiNode.getNodeId()));
  413. List<WikiNode> result = _persistence.findWithDynamicQuery(dynamicQuery);
  414. _assertOriginalValues(result.get(0));
  415. }
  416. private void _assertOriginalValues(WikiNode wikiNode) {
  417. Assert.assertEquals(
  418. wikiNode.getUuid(),
  419. ReflectionTestUtil.invoke(
  420. wikiNode, "getColumnOriginalValue",
  421. new Class<?>[] {String.class}, "uuid_"));
  422. Assert.assertEquals(
  423. Long.valueOf(wikiNode.getGroupId()),
  424. ReflectionTestUtil.<Long>invoke(
  425. wikiNode, "getColumnOriginalValue",
  426. new Class<?>[] {String.class}, "groupId"));
  427. Assert.assertEquals(
  428. Long.valueOf(wikiNode.getGroupId()),
  429. ReflectionTestUtil.<Long>invoke(
  430. wikiNode, "getColumnOriginalValue",
  431. new Class<?>[] {String.class}, "groupId"));
  432. Assert.assertEquals(
  433. wikiNode.getName(),
  434. ReflectionTestUtil.invoke(
  435. wikiNode, "getColumnOriginalValue",
  436. new Class<?>[] {String.class}, "name"));
  437. Assert.assertEquals(
  438. Long.valueOf(wikiNode.getGroupId()),
  439. ReflectionTestUtil.<Long>invoke(
  440. wikiNode, "getColumnOriginalValue",
  441. new Class<?>[] {String.class}, "groupId"));
  442. Assert.assertEquals(
  443. wikiNode.getExternalReferenceCode(),
  444. ReflectionTestUtil.invoke(
  445. wikiNode, "getColumnOriginalValue",
  446. new Class<?>[] {String.class}, "externalReferenceCode"));
  447. }
  448. protected WikiNode addWikiNode() throws Exception {
  449. long pk = RandomTestUtil.nextLong();
  450. WikiNode wikiNode = _persistence.create(pk);
  451. wikiNode.setMvccVersion(RandomTestUtil.nextLong());
  452. wikiNode.setUuid(RandomTestUtil.randomString());
  453. wikiNode.setExternalReferenceCode(RandomTestUtil.randomString());
  454. wikiNode.setGroupId(RandomTestUtil.nextLong());
  455. wikiNode.setCompanyId(RandomTestUtil.nextLong());
  456. wikiNode.setUserId(RandomTestUtil.nextLong());
  457. wikiNode.setUserName(RandomTestUtil.randomString());
  458. wikiNode.setCreateDate(RandomTestUtil.nextDate());
  459. wikiNode.setModifiedDate(RandomTestUtil.nextDate());
  460. wikiNode.setName(RandomTestUtil.randomString());
  461. wikiNode.setDescription(RandomTestUtil.randomString());
  462. wikiNode.setLastPostDate(RandomTestUtil.nextDate());
  463. wikiNode.setLastPublishDate(RandomTestUtil.nextDate());
  464. wikiNode.setStatus(RandomTestUtil.nextInt());
  465. wikiNode.setStatusByUserId(RandomTestUtil.nextLong());
  466. wikiNode.setStatusByUserName(RandomTestUtil.randomString());
  467. wikiNode.setStatusDate(RandomTestUtil.nextDate());
  468. _wikiNodes.add(_persistence.update(wikiNode));
  469. return wikiNode;
  470. }
  471. private List<WikiNode> _wikiNodes = new ArrayList<WikiNode>();
  472. private WikiNodePersistence _persistence;
  473. private ClassLoader _dynamicQueryClassLoader;
  474. }