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

Examples of com.ibm.sbt.services.client.connections.communities.Community


    public void testCreateCommunity8() {
      testCreateCommunity();
    }
   
    public void testCreateCommunity() {
      Community comm = getCommunity(community.getCommunityUuid(), false);
      Assert.assertNotNull("Create community failed", comm);
      deleteCommunity(comm);
      comm = getCommunity(comm.getCommunityUuid(), false);
      Assert.assertNull("Delete community failed", comm);
      community = null;
    }
View Full Code Here


        return;
      }
     
        String duplicateTitle = "Duplicate Title - " + System.currentTimeMillis();
        String updatedContent = "Updated Content - " + System.currentTimeMillis();
        Community community2 = createCommunity(duplicateTitle, "public", "Content for duplicate test", "duplicate");
       
        addSnippetParam("CommunityService.communityUuid", community.getCommunityUuid());
        addSnippetParam("sample.communityTitle", duplicateTitle);
        addSnippetParam("sample.communityContent", updatedContent);
View Full Code Here

          CommunityService communityService = app.getCommunityService();
            Collection<Community> communities = communityService.getPublicCommunities();
            HashMap<String, String> parameters = new HashMap<String, String>();
            parameters.put("ps", "100"); //100 members will be retrieved at a time. Max is 10,000.
            for (Iterator<Community> iter = communities.iterator(); iter.hasNext(); ) {
                Community community = iter.next();
                boolean moreMembers = true;
                int page = 1;
               
                System.out.println(community.getTitle());
                do{
                    parameters.put("page", Integer.toString(page));
                    EntityList<Member> members = communityService.getMembers(community.getCommunityUuid(), parameters);
                    for (int i=0; i<members.size(); i++) {
                        System.out.println("    " + members.get(i).getEmail());
                    }
                    if((members.getStartIndex() + members.getItemsPerPage()) <= members.getTotalResults()){
                        moreMembers = true;
View Full Code Here

    createCommunity();
  }

  public void createCommunity() throws ClientServicesException{
    CommunityService service = new CommunityService();
    community = new Community(service, "");
    community.setTitle("Test Followservice Community " + System.currentTimeMillis());
    community.setContent("Java Community Content");
    String type = "public";
    community.setCommunityType(type);
    community = community.save();
View Full Code Here

    parameters.put("ps", "100"); //100 members will be retrieved at a time. Max is 10,000.
      try {
        CommunityService communityService = app.getCommunityService();
            Collection<Community> communities = communityService.getPublicCommunities();
            for (Iterator<Community> iter = communities.iterator(); iter.hasNext(); ) {
                Community community = iter.next();
                boolean moreMembers = true;
                int page = 1;
               
                System.out.println(community.getTitle());
                do{
                    parameters.put("page", Integer.toString(page));
                    EntityList<Member> members = communityService.getMembers(community.getCommunityUuid(), parameters);
                    for (int i=0; i<members.size(); i++) {
                        System.out.println("    " + members.get(i).getEmail());
                    }
                    if((members.getStartIndex() + members.getItemsPerPage()) <= members.getTotalResults()){
                        moreMembers = true;
View Full Code Here

      CreateCommunitiesApp app = new CreateCommunitiesApp();
   
      try {
            for (int i=0; i<10; i++) {
              long start = System.currentTimeMillis();
              Community community = new Community(app.communityService, "");
              community.setTitle("CreateCommunity-"+System.currentTimeMillis()+"-"+i);
              community.setCommunityType("public");
              community.setContent("");
              app.createCommunity(community);
              long duration = System.currentTimeMillis() - start;
              System.out.println("Create community took "+duration+"(ms)");
            }
        } catch (ClientServicesException e) {
View Full Code Here

  public Community createTestCommunity() throws ClientServicesException {
    if (communityService==null){
      communityService = new CommunityService();
    }

    Community community = new Community(communityService, "");
    community.setTitle("JavaTestCommunity " + System.currentTimeMillis());
    community.setContent("Java Community Content");
    String type = "public";
    if (TestEnvironment.isSmartCloudEnvironment()) {
      type = "private";
    }
    community.setCommunityType(type);
    community = community.save();
    community = community.load();
    return community;
  }
View Full Code Here

  @Ignore
  @Test
  public final void testGetUpdatesFromCommunity() throws ActivityStreamServiceException, ClientServicesException{
    //Ignored because a method in ActivityStreamService to post to a Community is unimplemented
    Community community = createTestCommunity();
    ActivityStreamEntityList updates = service
        .getUpdatesFromCommunity(community.getCommunityUuid());

    System.err.println("number of updates from community : " + updates.size());

    for (ActivityStreamEntity asentry : updates) {
      if (null != asentry.getCommunity()) { // Updates can also come in from news service, ignore
View Full Code Here

   * @param tags
   * @param retry
   * @return
   */
  public Community createCommunity(String title, String type, String content, ArrayList<String> tags, boolean retry) {
        Community community = null;
        try {
        CommunityService communityService = new CommunityService();
        long start = System.currentTimeMillis();
         community =  new Community(communityService, "");
         community.setTitle("Test Community 1ab" + System.currentTimeMillis());
         community.setContent("");
        community.setCommunityType("public");
        community.setTags(tags);
         community = community.save();
         long duration = System.currentTimeMillis() - start;
         Trace.log("Created test community: "+community.getCommunityUuid() + " took "+duration+"(ms)");
         } catch (ClientServicesException e) {
           System.out.println("Grid Setup Error: cannot create community");

           fail("Error creating test community", e);
        }
View Full Code Here

        return;
      }
     
        String duplicateTitle = "Duplicate Title - " + System.currentTimeMillis();
        String updatedContent = "Updated Content - " + System.currentTimeMillis();
        Community community2 = createCommunity(duplicateTitle, "public", "Content for duplicate test", "duplicate");
       
        addSnippetParam("CommunityService.communityUuid", community.getCommunityUuid());
        addSnippetParam("sample.communityTitle", duplicateTitle);
        addSnippetParam("sample.communityContent", updatedContent);
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.client.connections.communities.Community

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.