当前位置: 首页>>代码示例>>Java>>正文


Java IssueService.createIssue方法代码示例

本文整理汇总了Java中org.eclipse.egit.github.core.service.IssueService.createIssue方法的典型用法代码示例。如果您正苦于以下问题:Java IssueService.createIssue方法的具体用法?Java IssueService.createIssue怎么用?Java IssueService.createIssue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.egit.github.core.service.IssueService的用法示例。


在下文中一共展示了IssueService.createIssue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testExport_WithDBEntries_ExpectExport

import org.eclipse.egit.github.core.service.IssueService; //导入方法依赖的package包/类
@Test
public void testExport_WithDBEntries_ExpectExport(@Mocked Repository repoMock, @Mocked IssueService issueServiceMock)
    throws Exception {
  new Expectations() {
    {
      settingsMock.hasGithubProperties();
      result = true;
      _service.getRepository(anyString, anyString);
      result = repoMock;
    }
  };
  engine.withDB(db -> {
    createWorkItem(123);
    createWorkItem(324);
  });
  ExportManager exportManager = new ExportManager();
  exportManager.addExporters(exporter);
  exportManager.export(settingsMock, engine);

  new Verifications() {
    {
      issueServiceMock.createIssue(null, withInstanceOf(Issue.class));
      times = 2;
    }
  };
}
 
开发者ID:rtcTo,项目名称:rtc2jira,代码行数:27,代码来源:GitHubExporterTest.java

示例2: testExport_EmptyDB_ExpectNoExport

import org.eclipse.egit.github.core.service.IssueService; //导入方法依赖的package包/类
@Test
public void testExport_EmptyDB_ExpectNoExport(@Mocked IssueService issueServiceMock) throws Exception {
  new Expectations() {
    {
      exporter.isConfigured();
      result = true;
    }
  };
  ExportManager exportManager = new ExportManager();
  exportManager.addExporters(exporter);
  exportManager.export(settingsMock, engine);
  new Verifications() {
    {
      exporter.initialize(settingsMock, engine);
      times = 1;

      issueServiceMock.createIssue(withInstanceOf(IRepositoryIdProvider.class), withInstanceOf(Issue.class));
      times = 0;

      exporter.createOrUpdateItem(withInstanceOf(ODocument.class));
      times = 0;
    }
  };
}
 
开发者ID:rtcTo,项目名称:rtc2jira,代码行数:25,代码来源:ExportManagerTest.java

示例3: createReviewRequestIssue

import org.eclipse.egit.github.core.service.IssueService; //导入方法依赖的package包/类
private void createReviewRequestIssue(Label reviewRequestLabel, Review review, IssueService issueService, UserService userService) throws IOException {
    Issue issue = new Issue();
    issue.setTitle("Reviewer - " + review.reviewer.login);
    List<Label> labels = new ArrayList<>();
    labels.add(reviewRequestLabel);
    issue.setLabels(labels);
    issue.setAssignee(userService.getUser(review.reviewer.login));
    
    String downloadLink = "https://github.com/" + review.repo.repoOwner + '/' + review.repo.repoName + "/raw/master/" + review.pathToPaperInRepo;
    
    issue.setBody("@" + review.reviewer.login + " has been requested to review this paper by @"+review.requester.login+".\n" +
    			  "Click [here](" + downloadLink + ") to download the paper\n" +
    			  "Click [here](" + review.linkToReviewPaper + ") to upload your review.");
    
    issueService.createIssue(review.repo.repoOwner, review.repo.repoName, issue);
}
 
开发者ID:DeveloperLiberationFront,项目名称:Pdf-Reviewer,代码行数:17,代码来源:ReviewRequestServlet.java

示例4: testExport_WithoutEmptyDB_ExpectNoExport

import org.eclipse.egit.github.core.service.IssueService; //导入方法依赖的package包/类
@Test
public void testExport_WithoutEmptyDB_ExpectNoExport(@Mocked IssueService issueServiceMock) throws Exception {
  ExportManager exportManager = new ExportManager();
  exportManager.addExporters(exporter);
  exportManager.export(settingsMock, engine);
  new Verifications() {
    {
      issueServiceMock.createIssue(withInstanceOf(IRepositoryIdProvider.class), withInstanceOf(Issue.class));
      times = 0;
    }
  };
}
 
开发者ID:rtcTo,项目名称:rtc2jira,代码行数:13,代码来源:GitHubExporterTest.java

示例5: createIssue

import org.eclipse.egit.github.core.service.IssueService; //导入方法依赖的package包/类
private void createIssue(Repo repo, PdfComment comment, IssueService issueService, List<Label> customLabels) throws IOException {
    Issue issue = new Issue();
    issue.setTitle(comment.getTitle());
    
    String body = comment.getComment();
    try {
        String imageURL = ImageUtils.uploadPhoto(comment.getImage());
        body = String.format("![snippet](%s)%n%n%s", imageURL, body);
    } catch (IOException e) {
        e.printStackTrace();
        // could not upload image, but carry on anyway
    }
    
    issue.setBody(body); 
    List<Label> newLabels = new ArrayList<>(customLabels);
    //add tags to labels
    for(Tag tag : comment.getTags()) {
    	Label label = new Label();
    	label.setName(tag.name());     // these tags are, by default, the normal grey color.  
    	newLabels.add(label);             // User can change these to the severity whey want
    }
    
    issue.setLabels(newLabels);
    //creates an issue remotely
    issue = issueService.createIssue(repo.repoOwner, repo.repoName, issue);
    comment.setIssueNumber(issue.getNumber());
}
 
开发者ID:DeveloperLiberationFront,项目名称:Pdf-Reviewer,代码行数:28,代码来源:ReviewSubmitServlet.java

示例6: createIssuesStepB

import org.eclipse.egit.github.core.service.IssueService; //导入方法依赖的package包/类
@Test
public void createIssuesStepB() throws Exception {

    String accessToken = System.getenv("GitHubAccessToken");
    Assume.assumeNotNull("GitHubAccessToken not null", accessToken);

    GitHubClient client = new GitHubClient();
    client.setOAuth2Token(accessToken);

    String githubUser = "wildfly-extras";
    String githubRepo = "wildfly-camel";

    Milestone milestone = null;
    MilestoneService milestoneService = new MilestoneService(client);
    for (Milestone aux : milestoneService.getMilestones(githubUser, githubRepo, IssueService.STATE_OPEN)) {
        if  (aux.getTitle().equals(MILESTONE)) {
            milestone = aux;
            break;
        }
    }
    Assert.assertNotNull("Milestone not null", milestone);

    IssueService issueService = new IssueService(client);
    try (BufferedReader br = new BufferedReader(new FileReader(auxfile.toFile()))) {
        String line = br.readLine();
        while (line != null) {
            String title = "Add support for " + line;
            System.out.println(title);
            Issue issue = new Issue();
            issue.setTitle(title);
            issue.setLabels(Collections.singletonList(LABEL));
            issue.setMilestone(milestone);
            issueService.createIssue(githubUser, githubRepo, issue);
            line = br.readLine();
            Thread.sleep(3 * 1000);
        }
    }
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:39,代码来源:GenerateRoadmapIssuesTest.java


注:本文中的org.eclipse.egit.github.core.service.IssueService.createIssue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。