本文整理汇总了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;
}
};
}
示例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;
}
};
}
示例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);
}
示例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;
}
};
}
示例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());
}
示例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);
}
}
}