ALF-9153 Start on the lucene-free Discussions Webscripts

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29729 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2011-08-12 17:35:19 +00:00
parent 3317a6a263
commit 45901f3ce3
3 changed files with 92 additions and 24 deletions

View File

@@ -49,10 +49,10 @@ import org.alfresco.service.cmr.site.SiteInfo;
import org.alfresco.service.cmr.site.SiteService;
import org.alfresco.service.cmr.site.SiteVisibility;
import org.alfresco.service.cmr.tagging.TaggingService;
import org.alfresco.service.cmr.wiki.WikiPageInfo;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.ApplicationContextHelper;
import org.alfresco.util.Pair;
import org.alfresco.util.PropertyMap;
import org.junit.After;
import org.junit.AfterClass;
@@ -214,6 +214,7 @@ public class DiscussionServiceImplTest
PostInfo post;
PostInfo reply1;
PostInfo reply2;
Pair<TopicInfo,PostInfo> objects;
// Nothing to start with
PagingResults<TopicInfo> results =
@@ -336,6 +337,26 @@ public class DiscussionServiceImplTest
assertEquals(TEST_USER, reply2.getCreator());
// Ensure that by noderef, we get the correct things
objects = DISCUSSION_SERVICE.getForNodeRef(FORUM_NODE);
assertEquals(null, objects);
objects = DISCUSSION_SERVICE.getForNodeRef(topic.getNodeRef());
assertNotNull(objects);
assertEquals(topic.getNodeRef(), objects.getFirst().getNodeRef());
assertEquals(null, objects.getSecond());
objects = DISCUSSION_SERVICE.getForNodeRef(post.getNodeRef());
assertNotNull(objects);
assertEquals(topic.getNodeRef(), objects.getFirst().getNodeRef());
assertEquals(post.getNodeRef(), objects.getSecond().getNodeRef());
objects = DISCUSSION_SERVICE.getForNodeRef(reply1.getNodeRef());
assertNotNull(objects);
assertEquals(topic.getNodeRef(), objects.getFirst().getNodeRef());
assertEquals(reply1.getNodeRef(), objects.getSecond().getNodeRef());
// Check the overall count now
posts = DISCUSSION_SERVICE.listPosts(topic, new PagingRequest(10));
assertEquals(3, posts.getPage().size());