Examples of Forum


Examples of cn.edu.zju.acm.onlinejudge.bean.Forum

                // TODO(xuchuan): move all prepareStatement out of try-catch
                ps = conn.prepareStatement(ForumPersistenceImpl.GET_FORUM);
                ps.setLong(1, id);
                ResultSet rs = ps.executeQuery();
                if (rs.next()) {
                    Forum forum = new Forum();
                    forum.setId(rs.getLong(DatabaseConstants.FORUM_FORUM_ID));
                    forum.setName(rs.getString(DatabaseConstants.FORUM_NAME));
                    forum.setDescription(rs.getString(DatabaseConstants.FORUM_DESCRIPTION));
                    return forum;
                } else {
                    return null;
                }
            } finally {
View Full Code Here

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

       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNull("Unexpected error detected on page", json.getString("code"));
       
        Forum uforum = getForum(forum.getForumUuid());
        Assert.assertEquals(forum.getForumUuid(), json.getString("getForumUuid"));
        Assert.assertEquals(updatedTitle, uforum.getTitle());
        Assert.assertEquals(updatedContent, uforum.getContent());
    }
View Full Code Here

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

    @Test
    public void testGetForum() {
        addSnippetParam("ForumService.forumUuid", forum.getForumUuid());
       
        Forum aforum = getForum(forum.getForumUuid());
        Assert.assertNotNull(aforum);
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        assertForumValid(forum, (JsonJavaObject)json);
View Full Code Here

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

    WidgetResultPage resultPage = launchWidget(SNIPPET_ID);
   
    String name = createForumName();
    String forumUuid = resultPage.createForum(name, "tag1,tag2,tag3", name, true);
    Assert.assertNotNull("Error creating a forum: "+resultPage.getAlertText(), forumUuid);
    Forum forum = getForum(forumUuid);
    Assert.assertEquals("Forum title doesn't match", name, forum.getTitle());
    Assert.assertTrue("Forum tag1 not found", forum.getTags().contains("tag1"));
    Assert.assertTrue("Forum tag2 not found", forum.getTags().contains("tag2"));
    Assert.assertTrue("Forum tag3 not found", forum.getTags().contains("tag3"));
    Assert.assertEquals("Forum content doesn't match", name, forum.getContent());
   
    deleteForum(forumUuid);
    }
View Full Code Here

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

    WidgetResultPage resultPage = launchWidget(SNIPPET_ID);
   
    String name = createForumName();
    String forumUuid = resultPage.createForum(name, "tag1,tag2,tag3", name, false);
    Assert.assertNotNull("Error creating a forum: "+resultPage.getAlertText(), forumUuid);
    Forum forum = getForum(forumUuid);
    Assert.assertEquals("Forum title doesn't match", name, forum.getTitle());
    Assert.assertTrue("Forum tag1 not found", forum.getTags().contains("tag1"));
    Assert.assertTrue("Forum tag2 not found", forum.getTags().contains("tag2"));
    Assert.assertTrue("Forum tag3 not found", forum.getTags().contains("tag3"));
    Assert.assertEquals("Forum content doesn't match", name, forum.getContent());
   
    // TODO verify we are not following this forum
   
    deleteForum(forumUuid);
    }
View Full Code Here

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

      loginConnections();
    } catch (AuthenticationException e) {
      e.printStackTrace();
    }
    forumService = new ForumService();
    Forum forum = new Forum(forumService);
    forum.setTitle("Test forum 1ab" + System.currentTimeMillis());
    forum.setContent("Test forum created by Create Forum Java snippet");
    List<String> tags = new ArrayList<String>();
    tags.add("tag1");
    tags.add("tag2");
    forum.setTags(tags);
    try {
      forum = forum.save();
      testForumID = forum.getUid();
    } catch (ClientServicesException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
View Full Code Here

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

        }
        Assert.assertEquals(role, json.getString("getRole"));
    }
   
    protected Forum getLastCreatedForum() {
        Forum forum = null;
        try {
            loginConnections();
           
            ForumService forumService = getForumService();
            EntityList<Forum> forums = forumService.getMyForums();
            forum = (Forum)forums.iterator().next();
            Trace.log("Last created forum: "+forum.getForumUuid());
            Trace.log("Last created forum: "+forum.getPublished());
            Iterator<Forum> i = forums.iterator();
            while (i.hasNext()) {
              BaseForumEntity c= i.next();
              Trace.log("Last created forum: "+((Forum)c).getForumUuid());
              Trace.log("Last created forum: "+c.getTitle());
View Full Code Here

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

    protected Forum getForum(String forumUuid) {
        return getForum(forumUuid, true);
    }
   
    protected Forum getForum(String forumUuid, boolean failOnCse) {
        Forum forum = null;
        try {
            loginConnections();
           
            ForumService forumService = getForumService();
            forum = forumService.getForum(forumUuid);
            Trace.log("Got forum: "+forum.getForumUuid());
        } catch (AuthenticationException pe) {
          if (pe.getCause() != null) {
            pe.getCause().printStackTrace();
          }
            Assert.fail("Error authenicating: " + pe.getMessage());
View Full Code Here

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

    protected Forum createForum(String title, String type, String content, String tags) {
      return createForum(title, type, content, tags, true);
    }
   
    protected Forum createForum(String title, String type, String content, String tags, boolean retry) {
        Forum forum = null;
        try {
            loginConnections();
            ForumService forumService = getForumService();
           
          long start = System.currentTimeMillis();
            forum = new Forum(forumService, "");
            forum.setTitle(title);
            forum.setContent(content);
            forum.setTags(tags);
            forum = forumService.createForum(forum);
            forum = forumService.getForum(forum.getForumUuid());
           
            long duration = System.currentTimeMillis() - start;
            Trace.log("Created test forum: "+forum.getForumUuid() + " took "+duration+"(ms)");
        } catch (AuthenticationException pe) {
          if (pe.getCause() != null) {
            pe.getCause().printStackTrace();
          }
            Assert.fail("Error authenticating: " + pe.getMessage());
View Full Code Here

Examples of com.l2jfrozen.gameserver.communitybbs.BB.Forum

    if(_forum == null)
    {
      if(_level >= 2)
      {
        final ForumsBBSManager fbbsm = ForumsBBSManager.getInstance();
        final Forum clanRootForum = fbbsm.getForumByName("ClanRoot");
        if (clanRootForum != null)
        {
          _forum = clanRootForum.getChildByName(_name);
          if(_forum == null)
          {
            _forum = fbbsm.createNewForum(_name, clanRootForum, Forum.CLAN, Forum.CLANMEMBERONLY, getClanId());
          }
        }
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.