Examples of GitHubService


Examples of org.eclipse.mylyn.github.internal.GitHubService

         
          String user = urlMatcher.group(1);
          String repo = urlMatcher.group(2);
          AuthenticationCredentials auth = repository.getCredentials(AuthenticationType.REPOSITORY);
         
          GitHubService service = new GitHubService();
 
          monitor.subTask("Contacting server...");
          try {
            // verify the repo
            service.searchIssues(user, repo, new String("open"),"");
            monitor.worked(400);
           
            // verify the credentials
            if (auth == null) {
              setStatus(GitHubUi.createErrorStatus("Credentials are required.  Please specify username and API Token."));
              return;
            }
            GitHubCredentials credentials = new GitHubCredentials(auth.getUserName(), auth.getPassword());
            if (!service.verifyCredentials(credentials)) {
              setStatus(GitHubUi.createErrorStatus("Invalid credentials.  Please check your GitHub User ID and API Token.\nYou can find your API Token on your GitHub account settings page."));
              return
            }
          } catch (GitHubServiceException e) {
            setStatus(GitHubUi.createErrorStatus("Repository Test failed:"+ e.getMessage()));
View Full Code Here

Examples of org.eclipse.mylyn.github.internal.GitHubService

   * Test the GitHubService issue searching implementation
   */
  @SuppressWarnings("restriction")
  @Test
  public void searchIssues() throws Exception {
    final GitHubService service = new GitHubService();
    final GitHubIssues issues = service.searchIssues(TEST_USER,
        TEST_PROJECT, "open", "test");
    assertEquals(0, issues.getIssues().length);
  }
View Full Code Here

Examples of org.eclipse.mylyn.github.internal.GitHubService

  /**
   * Test the GitHubService implementation for opening a new issue.
   */
  @Test
  public void openIssue() throws Exception {
    final GitHubService service = new GitHubService();
    final GitHubIssue issue = new GitHubIssue();
    issue.setUser(TEST_USER);
    issue.setBody("This is a test body");
    issue.setTitle("Issue Title");
    GitHubIssue newIssue = service.openIssue(TEST_USER, TEST_PROJECT, issue,
        new GitHubCredentials(TEST_USER,API_KEY));
    assertTrue(newIssue != null);
    assertEquals(issue.getUser(),newIssue.getUser());
    assertEquals(issue.getBody(),newIssue.getBody());
    assertEquals(issue.getTitle(),newIssue.getTitle());
View Full Code Here

Examples of org.eclipse.mylyn.github.internal.GitHubService

  /**
   * Test the GitHubService implementation for opening a new issue.
   */
  @Test
  public void editIssue() throws Exception {
    final GitHubService service = new GitHubService();
    final GitHubIssue issue = new GitHubIssue();
    issue.setUser(TEST_USER);
    issue.setBody("This is a test body");
    issue.setTitle("Issue Title");
    GitHubIssue newIssue = service.openIssue(TEST_USER, TEST_PROJECT, issue,
        new GitHubCredentials(TEST_USER,API_KEY));
    assertTrue(newIssue != null);
   
    newIssue.setTitle(newIssue.getTitle()+" - modified");
    newIssue.setBody(newIssue.getBody()+" - modified");
   
    service.editIssue(TEST_USER, TEST_PROJECT, issue, new GitHubCredentials(TEST_USER,API_KEY));
   
    GitHubIssue showIssue = service.showIssue(TEST_USER, TEST_PROJECT, issue.getNumber());
   
    assertTrue(showIssue != null);
    assertEquals(newIssue.getTitle(),showIssue.getTitle());
  }
View Full Code Here

Examples of org.eclipse.mylyn.github.internal.GitHubService

   * Test the GitHubService implementation for adding a label to an existing
   * issue.
   */
  @Test
  public void addLabel() throws Exception {
    final GitHubService service = new GitHubService();
    final boolean result = service.addLabel(TEST_USER, TEST_PROJECT,
        "lame", 1, new GitHubCredentials(TEST_USER,API_KEY));
    assertTrue(result);
  }
View Full Code Here

Examples of org.eclipse.mylyn.github.internal.GitHubService

   * Test the GitHubService implementation for removing an existing label from
   * any GitHub issue.
   */
  @Test
  public void removeLable() throws Exception {
    final GitHubService service = new GitHubService();
    final boolean result = service.removeLabel(TEST_USER, TEST_PROJECT,
        "lame", 1, new GitHubCredentials(TEST_USER,API_KEY));
    assertTrue(result);
  }
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.