Package org.exoplatform.social.client.api.model

Examples of org.exoplatform.social.client.api.model.RestActivity


  public void shouldGet() throws SocialClientLibException {
    if (!canRunTest()) {
      return;
    }
    startSessionAs("root", "gtn");
    RestActivity restActivity = createActivities(1).get(0);
    String activityId = restActivity.getId();
    RestActivity resultActivity = activityService.get(activityId);

    assertThat("test 0", equalTo(resultActivity.getTitle()));
  }
View Full Code Here


    if (!canRunTest()) {
      return;
    }
    startSessionAs("root", "gtn");
    String activityId = createActivities(1).get(0).getId();
    RestActivity resultActivity = activityService.get(activityId);
    activityService.delete(resultActivity);
   
    tearDownActivityList.remove(0);
   
    try{
View Full Code Here

  */

  private List<RestActivity> createActivities(int numberOfActivity) throws SocialClientLibException {
    List<RestActivity> createdActivityList = new ArrayList<RestActivity>();
    for (int i = 0; i < numberOfActivity; i++) {
      RestActivity restActivityToCreate = new RestActivity();
      restActivityToCreate.setTitle("test " + i);
      RestActivity createdActivity = activityService.create(restActivityToCreate);
      createdActivityList.add(createdActivity);
      tearDownActivityList.add(createdActivity);
    }
    return createdActivityList;
  }
View Full Code Here

    } catch (SocialClientLibException se) {
      assert(se.getCause() instanceof NotFoundException);
    }


    RestActivity activity = new RestActivity();
    activity.setTitle("Hello There");
      activityService.create(activity);
    startSessionAs("mary", "gtn");
    try {
      activityService.update(activity);
      fail("Expecting ServiceException from ActivityService#update(RestActivity)");
    } catch (ServiceException se) {
    }

    //create a activity to demo's stream
    startSessionAs("root", "gtn");
    RestActivity demoActivity = createActivities(1).get(0);
    startSessionAs("mary", "gtn");

    RestComment comment = new RestComment();
    comment.setText("comment");
View Full Code Here

  */

  private List<RestActivity> createActivities(int numberOfActivity) throws SocialClientLibException {
    List<RestActivity> createdActivityList = new ArrayList<RestActivity>();
    for (int i = 0; i < numberOfActivity; i++) {
      RestActivity restActivityToCreate = new RestActivity();
      restActivityToCreate.setTitle("test " + i);
      RestActivity createdActivity = activityService.create(restActivityToCreate);
      createdActivityList.add(createdActivity);
      tearDownActivityList.add(createdActivity);
    }
    return createdActivityList;
  }
View Full Code Here

  }
 
  private List<RestActivity> createActivities(int numberOfActivity) throws SocialClientLibException {
    List<RestActivity> createdActivityList = new ArrayList<RestActivity>();
    for (int i = 0; i < numberOfActivity; i++) {
      RestActivity restActivityToCreate = new RestActivity();
      restActivityToCreate.setTitle("test " + i);
      RestActivity createdActivity = activityService.create(restActivityToCreate);
      createdActivityList.add(createdActivity);
      tearDownActivityList.add(createdActivity);
    }
    return createdActivityList;
  }
View Full Code Here

    final String POST_ACTIVITY_REQUEST_URL = BASE_URL+"activity.json";
      try{
        HttpResponse response = executePost(POST_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH, newInstance);
        String responseContent = getContent(response);
        handleError(response);
        RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
        return restActivity;
      } catch (SocialHttpClientException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha3.class,e.getMessage(), e);
      } catch (ParseException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha3.class,e.getMessage(), e);
View Full Code Here

    try{
      HttpResponse response = executePost(POST_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH, newActivity);
      String responseContent = getContent(response);
      handleError(response);
      RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
      return restActivity;
    } catch (SocialHttpClientException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha3.class,e.getMessage(), e);
    } catch (ParseException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha3.class,e.getMessage(), e);
View Full Code Here

    final String GET_ACTIVITY_REQUEST_URL = BASE_URL+"activity/"+uuid+".json";
      try{
        HttpResponse response = executeGet(GET_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH);
        String responseContent = getContent(response);
        handleError(response);
        RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
        return restActivity;
      } catch (SocialHttpClientException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha3.class,e.getMessage(), e);
      } catch (ParseException e) {
        throw new ServiceException(ActivityServiceImplV1Alpha3.class,e.getMessage(), e);
View Full Code Here

    final String DELETE_ACTIVITY_REQUEST_URL = BASE_URL+"activity/destroy/"+existingInstance.getId()+".json";
    try{
      HttpResponse response = executePost(DELETE_ACTIVITY_REQUEST_URL, POLICY.BASIC_AUTH);
      String responseContent = getContent(response);
      handleError(response);
      RestActivity restActivity = SocialJSONDecodingSupport.parser(RestActivity.class, responseContent);
      return restActivity;
    } catch (SocialHttpClientException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha3.class, e.getMessage(), e);
    } catch (ParseException e) {
      throw new ServiceException(ActivityServiceImplV1Alpha3.class, e.getMessage(), e);
View Full Code Here

TOP

Related Classes of org.exoplatform.social.client.api.model.RestActivity

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.