Package com.github.api.v2.schema

Examples of com.github.api.v2.schema.Feed


  @Override
  public Comment addIssueComment(String userName, String repositoryName,
      int issueNumber, String comment) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.IssueApiUrls.ADD_ISSUE_COMMENT_URL);
        String                apiUrl  = builder.withField(ParameterNames.USER_NAME, userName).withField(ParameterNames.REPOSITORY_NAME, repositoryName).withField(ParameterNames.ISSUE_NUMBER, String.valueOf(issueNumber)).buildUrl();
    Comment bean = new Comment();
    bean.setBody(comment);
        JsonObject json = unmarshall(callApiMethod(apiUrl, marshall(bean), ApplicationConstants.CONTENT_TYPE_JSON, HttpMethod.POST, 201));
        return unmarshall(new TypeToken<Comment>(){}, json);
  }
View Full Code Here


  @Override
  public Comment updateIssueComment(String userName, String repositoryName,
      String commentId, String comment) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.IssueApiUrls.UPDATE_ISSUE_COMMENT_URL);
    String apiUrl = builder.withField(ParameterNames.USER_NAME, userName).withField(ParameterNames.REPOSITORY_NAME, repositoryName).withField(ParameterNames.COMMENT_ID, commentId).buildUrl();
    Comment bean = new Comment();
    bean.setBody(comment);
        JsonObject json = unmarshall(callApiMethod(apiUrl, marshall(bean), ApplicationConstants.CONTENT_TYPE_JSON, HttpMethod.POST, 200));
        return unmarshall(new TypeToken<Comment>(){}, json);
  }
View Full Code Here

    List<Commit> commits = service.getCommits("facebook", "tornado", Repository.MASTER, "setup.py");
    System.out.println(commits.size());
    for (Commit commit : commits) {
      printResult(commit);
    }
    Commit commit = service.getCommit("facebook", "tornado", "7b80c2f4db226d6fa3a7");
    printResult(commit);
  }
View Full Code Here

   *            the arguments
   */
  public static void main(String[] args) {
    GitHubServiceFactory factory = GitHubServiceFactory.newInstance();
    FeedService service = factory.createFeedService();
    Feed feed = service.getPublicUserFeed("apache", 10);
    printResult(feed);
  }
View Full Code Here

   */
  @Test
  public void testGetCommitFeed() {
      assertNotNullOrEmpty(String.format(RESOURCE_MISSING_MESSAGE, "Test Username."), TestConstants.TEST_USER_NAME);
      assertNotNullOrEmpty(String.format(RESOURCE_MISSING_MESSAGE, "Test Repository."), TestConstants.TEST_REPOSITORY_NAME);
      Feed feed = service.getCommitFeed(TestConstants.TEST_USER_NAME, TestConstants.TEST_REPOSITORY_NAME, Repository.MASTER, 10);
      assertNotNull("Feed cannot be null.", feed);
      assertNotNullOrEmpty("Feed entries cannot be null or empty.", feed.getEntries());
  }
View Full Code Here

   */
  @Test
  public void testGetNetworkFeed() {
      assertNotNullOrEmpty(String.format(RESOURCE_MISSING_MESSAGE, "Test Username."), TestConstants.TEST_USER_NAME);
      assertNotNullOrEmpty(String.format(RESOURCE_MISSING_MESSAGE, "Test Repository."), TestConstants.TEST_REPOSITORY_NAME);
      Feed feed = service.getNetworkFeed(TestConstants.TEST_USER_NAME, TestConstants.TEST_REPOSITORY_NAME, 10);
      assertNotNull("Feed cannot be null.", feed);
      assertNotNullOrEmpty("Feed entries cannot be null or empty.", feed.getEntries());
  }
View Full Code Here

   * Test get private user feed.
   */
  @Test
  public void testGetPrivateUserFeed() {
      assertNotNullOrEmpty(String.format(RESOURCE_MISSING_MESSAGE, "Test Username."), TestConstants.TEST_USER_NAME);
      Feed feed = service.getPrivateUserFeed(TestConstants.TEST_USER_NAME, 10);
      assertNotNull("Feed cannot be null.", feed);
      assertNotNullOrEmpty("Feed entries cannot be null or empty.", feed.getEntries());
  }
View Full Code Here

  /**
   * Test get public timeline feed.
   */
  @Test
  public void testGetPublicTimelineFeed() {
      Feed feed = service.getPublicTimelineFeed(10);
      assertNotNull("Feed cannot be null.", feed);
      assertNotNullOrEmpty("Feed entries cannot be null or empty.", feed.getEntries());
  }
View Full Code Here

   * Test get public user feed.
   */
  @Test
  public void testGetPublicUserFeed() {
      assertNotNullOrEmpty(String.format(RESOURCE_MISSING_MESSAGE, "Test Username."), TestConstants.TEST_USER_NAME);
      Feed feed = service.getPublicUserFeed(TestConstants.TEST_USER_NAME, 10);
      assertNotNull("Feed cannot be null.", feed);
      assertNotNullOrEmpty("Feed entries cannot be null or empty.", feed.getEntries());
  }
View Full Code Here

   */
  @Test
  public void testGetWikiFeed() {
      assertNotNullOrEmpty(String.format(RESOURCE_MISSING_MESSAGE, "Test Username."), TestConstants.TEST_USER_NAME);
      assertNotNullOrEmpty(String.format(RESOURCE_MISSING_MESSAGE, "Test Repository."), TestConstants.TEST_REPOSITORY_NAME);
      Feed feed = service.getWikiFeed(TestConstants.TEST_USER_NAME, TestConstants.TEST_REPOSITORY_NAME, 10);
      assertNotNull("Feed cannot be null.", feed);
      assertNotNullOrEmpty("Feed entries cannot be null or empty.", feed.getEntries());
  }
View Full Code Here

TOP

Related Classes of com.github.api.v2.schema.Feed

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.