Package com.ibm.sbt.services.client.connections.forums

Examples of com.ibm.sbt.services.client.connections.forums.ForumTopic


    public void testUpdateForumTopic() {
        String updatedTitle = "Updated Title - " + System.currentTimeMillis();
        String updatedContent = "Updated Content - " + System.currentTimeMillis();
       
      String title = createForumTopicName();
      ForumTopic forumTopic = createForumTopic(forum, title, title);
        addSnippetParam("ForumService.topicUuid", forumTopic.getTopicUuid());
        addSnippetParam("ForumService.topicTitle", updatedTitle);
        addSnippetParam("ForumService.topicContent", updatedContent);
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNull("Unexpected error detected on page", json.getString("code"));
       
        forumTopic = getForumTopic(forumTopic.getTopicUuid(), true);
        Assert.assertEquals(forumTopic.getTopicUuid(), json.getString("getTopicUuid"));
        Assert.assertEquals(updatedTitle, forumTopic.getTitle());
        Assert.assertEquals(updatedContent, StringUtil.trim(forumTopic.getContent()));
    }
View Full Code Here


    }

    @Test
    public void testGetForumReply() {
      String title = createForumTopicName();
      ForumTopic forumTopic = createForumTopic(forum, title, title);
      ForumReply forumReply = createForumReply(forumTopic, title, title);
        addSnippetParam("ForumService.replyUuid", forumReply.getReplyUuid());
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
View Full Code Here

    }

    @Test
    public void testCreateForumReply() {
      String title = createForumTopicName();
      ForumTopic forumTopic = createForumTopic(forum, title, title);
     
      addSnippetParam("ForumService.topicUuid", forumTopic.getTopicUuid());
     
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNull("Unexpected error detected on page", json.getString("code"));
        assertForumReplyProperties(json);
View Full Code Here

    static final String SNIPPET_ID = "Social_Forums_API_DeleteForumReply";

    @Test
    public void testDeleteForumReply() {
      String title = createForumTopicName();
      ForumTopic forumTopic = createForumTopic(forum, title, title);
      ForumReply forumReply = createForumReply(forumTopic, title, title);
        addSnippetParam("ForumService.replyUuid", forumReply.getReplyUuid());
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
View Full Code Here

    static final String SNIPPET_ID = "Social_Forums_API_DeleteForumTopic";

    @Test
    public void testDeleteForumTopic() {
      String title = createForumTopicName();
      ForumTopic forumTopic = createForumTopic(forum, title, title);
        addSnippetParam("ForumService.topicUuid", forumTopic.getTopicUuid());
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNull("Unexpected error detected on page", json.getString("code"));
        Assert.assertEquals(forumTopic.getTopicUuid(), json.getString("topicUuid"));
       
        forumTopic = getForumTopic(forumTopic.getTopicUuid(), false);
        Assert.assertNull("Deleted forum topic is still available", forumTopic);
    }
View Full Code Here

    public void testUpdateForumReply() {
        String updatedTitle = "Updated Title - " + System.currentTimeMillis();
        String updatedContent = "Updated Content - " + System.currentTimeMillis();
       
      String title = createForumTopicName();
      ForumTopic forumTopic = createForumTopic(forum, title, title);
      ForumReply forumReply = createForumReply(forumTopic, title, title);
        addSnippetParam("ForumService.replyUuid", forumReply.getReplyUuid());
        addSnippetParam("ForumService.replyTitle", updatedTitle);
        addSnippetParam("ForumService.replyContent", updatedContent);
       
View Full Code Here

    }

    @Test
    public void testGetForumTopic() {
      String title = createForumTopicName();
      ForumTopic forumTopic = createForumTopic(forum, title, title);
        addSnippetParam("ForumService.topicUuid", forumTopic.getTopicUuid());
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        assertForumTopicValid(forumTopic, (JsonJavaObject)json);
    }
View Full Code Here

  }
  protected Element answered() {
    if (!isForumTopic()) {
      return null;
    }
    ForumTopic topic = (ForumTopic) entity;
    return topic.isAnswered() ? element(CATEGORY,
        attribute(SCHEME, Namespace.FLAGS.getUrl()),
        attribute(TERM, ANSWERED)) : null;
  }
View Full Code Here

  protected Element locked() {
    if (!isForumTopic()) {
      return null;
    }
    ForumTopic topic = (ForumTopic) entity;
    return topic.isLocked() ? element(CATEGORY,
        attribute(SCHEME, Namespace.FLAGS.getUrl()),
        attribute(TERM, LOCKED)) : null;
  }
View Full Code Here

  protected Element pinned() {
    if (!isForumTopic()) {
      return null;
    }
    ForumTopic topic = (ForumTopic) entity;
    return topic.isPinned() ? element(CATEGORY,
        attribute(SCHEME, Namespace.FLAGS.getUrl()),
        attribute(TERM, PINNED)) : null;
  }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.client.connections.forums.ForumTopic

Copyright © 2018 www.massapicom. 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.