Package org.olat.core.commons.services.commentAndRating

Examples of org.olat.core.commons.services.commentAndRating.UserCommentsManager.createComment()


    // add comments
    UserCommentsManager ucm = service.getUserCommentsManager();
    UserCommentsManager ucm2 = serviceWithSubPath.getUserCommentsManager();
   
    UserComment comment1 = ucm.createComment(ident1, "Hello World");
    UserComment comment2 = ucm2.createComment(ident1, "Hello World with subpath");
    // count must be 1 now. count without subpath should not include the results with subpath
    assertEquals(Long.valueOf(1), service.getUserCommentsManager().countComments());
    assertEquals(Long.valueOf(1), serviceWithSubPath.getUserCommentsManager().countComments());
    //
    UserComment comment3 = ucm.createComment(ident2, "Hello World");
View Full Code Here


    // count must be 1 now. count without subpath should not include the results with subpath
    assertEquals(Long.valueOf(1), service.getUserCommentsManager().countComments());
    assertEquals(Long.valueOf(1), serviceWithSubPath.getUserCommentsManager().countComments());
    //
    UserComment comment3 = ucm.createComment(ident2, "Hello World");
    UserComment comment4 = ucm2.createComment(ident2, "Hello World with subpath");
    assertEquals(Long.valueOf(2), service.getUserCommentsManager().countComments());
    assertEquals(Long.valueOf(2), serviceWithSubPath.getUserCommentsManager().countComments());
    // Same with get method
    List<UserComment> commentList = ucm.getComments();
    assertEquals(2, commentList.size());
View Full Code Here

    // Create reply to a comment that does not exis anymore -> should not create anything
    assertNull(ucm.replyTo(comment1, ident2, "Reply 1"));
    assertNull(ucm.replyTo(comment2, ident2, "Reply 1 with subpath"));
    // Recreate first comment
    comment1 = ucm.createComment(ident1, "Hello World");
    comment2 = ucm2.createComment(ident1, "Hello World with subpath");
    // Recreate a reply to the first comments
    ucm.replyTo(comment1, ident2, "Reply 1");
    ucm.replyTo(comment2, ident2, "Reply 1 with subpath");
    assertEquals(Long.valueOf(3), service.getUserCommentsManager().countComments());
    assertEquals(Long.valueOf(3), serviceWithSubPath.getUserCommentsManager().countComments());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.