org.alfresco.repo.forum
Class CommentsTest

java.lang.Object
  extended by org.alfresco.repo.forum.CommentsTest

public class CommentsTest
extends java.lang.Object

Test class for some forum model-related functionality, specifically comments. There is no "CommentService" or "DiscussionService" and the REST API simply creates the appropriate content structure as required by the forum model.

Since:
4.0

Constructor Summary
CommentsTest()
           
 
Method Summary
 void commentOnDocsCheckingCommentCountRollup()
          This test method comments on some nodes asserting that the commentCount rollup property responds correctly to the changing number of comments.
 void initIndividualTestContext()
          Create some content that can be commented on.
static void initTestsContext()
          Initialise various services required by the test.
 void testRollupOfPreSwiftNodes()
          This test method tests that commented nodes from before Swift have their comment counts correctly rolled up.
 void testTriggerCommentRecount()
          This test method tests that nodes whose commentCount is set to -1 have their commentCounts recalculated.
 void tidyUpTestNodes()
          This method deletes any nodes which were created during test execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommentsTest

public CommentsTest()
Method Detail

initTestsContext

public static void initTestsContext()
                             throws java.lang.Exception
Initialise various services required by the test.

Throws:
java.lang.Exception

initIndividualTestContext

public void initIndividualTestContext()
                               throws java.lang.Exception
Create some content that can be commented on.

Throws:
java.lang.Exception

tidyUpTestNodes

public void tidyUpTestNodes()
                     throws java.lang.Exception
This method deletes any nodes which were created during test execution.

Throws:
java.lang.Exception

commentOnDocsCheckingCommentCountRollup

public void commentOnDocsCheckingCommentCountRollup()
                                             throws java.lang.Exception
This test method comments on some nodes asserting that the commentCount rollup property responds correctly to the changing number of comments.

Throws:
java.lang.Exception

testRollupOfPreSwiftNodes

public void testRollupOfPreSwiftNodes()
                               throws java.lang.Exception
This test method tests that commented nodes from before Swift have their comment counts correctly rolled up. Nodes that were commented on in prior versions of Alfresco will not have commentCount rollups - neither the aspect nor the property defined within it. Alfresco lazily calculates commentCount rollups for these nodes. So they will appear to have a count of 0 (undefined, really) and will not be given the "(count)" UI decoration. Then when a comment is added (or removed), the comment count should be recalculated from scratch.

Throws:
java.lang.Exception

testTriggerCommentRecount

public void testTriggerCommentRecount()
                               throws java.lang.Exception
This test method tests that nodes whose commentCount is set to -1 have their commentCounts recalculated. This feature (see ALF-8498) is to allow customers to set their counts to -1 thus triggering a recount for that document.

Throws:
java.lang.Exception


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.