Skip to content

Commit 061e8bb

Browse files
committed
Stop printing to System
1 parent a4f42b2 commit 061e8bb

11 files changed

Lines changed: 58 additions & 58 deletions

src/test/java/org/kohsuke/HookApp.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public static void main(String[] args) throws Exception {
2525

2626
public void doIndex(StaplerRequest req) throws IOException {
2727
String str = req.getParameter("payload");
28-
System.out.println(str);
28+
// System.out.println(str);
2929
GHEventPayload.PullRequest o = GitHub.connect().parseEventPayload(new StringReader(str), GHEventPayload.PullRequest.class);
30-
System.out.println(o);
30+
// System.out.println(o);
3131
}
3232
}

src/test/java/org/kohsuke/github/AppTest.java

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public void testGetTeamsForRepo() throws Exception {
324324
@Test
325325
public void testMembership() throws Exception {
326326
Set<String> members = gitHub.getOrganization(GITHUB_API_TEST_ORG).getRepository("jenkins").getCollaboratorNames();
327-
System.out.println(members.contains("kohsuke"));
327+
// System.out.println(members.contains("kohsuke"));
328328
}
329329

330330
@Test
@@ -391,7 +391,7 @@ public void testQueryCommits() throws Exception {
391391
List<String> sha1 = new ArrayList<String>();
392392
for (GHCommit c : gitHub.getUser("jenkinsci").getRepository("jenkins").queryCommits()
393393
.since(new Date(1199174400000L)).until(1201852800000L).path("pom.xml").list()) {
394-
System.out.println(c.getSHA1());
394+
// System.out.println(c.getSHA1());
395395
sha1.add(c.getSHA1());
396396
}
397397
assertEquals("1cccddb22e305397151b2b7b87b4b47d74ca337b", sha1.get(0));
@@ -403,7 +403,7 @@ public void testQueryCommits() throws Exception {
403403
public void testBranches() throws Exception {
404404
Map<String, GHBranch> b =
405405
gitHub.getUser("jenkinsci").getRepository("jenkins").getBranches();
406-
System.out.println(b);
406+
// System.out.println(b);
407407
}
408408

409409
@Test
@@ -412,7 +412,7 @@ public void testCommitComment() throws Exception {
412412
PagedIterable<GHCommitComment> comments = r.listCommitComments();
413413
List<GHCommitComment> batch = comments.iterator().nextPage();
414414
for (GHCommitComment comment : batch) {
415-
System.out.println(comment.getBody());
415+
// System.out.println(comment.getBody());
416416
assertSame(comment.getOwner(), r);
417417
}
418418
}
@@ -421,9 +421,9 @@ public void testCommitComment() throws Exception {
421421
public void testCreateCommitComment() throws Exception {
422422
GHCommit commit = gitHub.getUser("kohsuke").getRepository("sandbox-ant").getCommit("8ae38db0ea5837313ab5f39d43a6f73de3bd9000");
423423
GHCommitComment c = commit.createComment("[testing](http://kohsuse.org/)");
424-
System.out.println(c);
424+
// System.out.println(c);
425425
c.update("updated text");
426-
System.out.println(c);
426+
// System.out.println(c);
427427
c.delete();
428428
}
429429

@@ -432,7 +432,7 @@ public void tryHook() throws Exception {
432432
kohsuke();
433433
GHRepository r = gitHub.getOrganization(GITHUB_API_TEST_ORG).getRepository("github-api");
434434
GHHook hook = r.createWebHook(new URL("http://www.google.com/"));
435-
System.out.println(hook);
435+
// System.out.println(hook);
436436

437437
if (mockGitHub.isUseProxy()) {
438438
r = gitHubBeforeAfter.getOrganization(GITHUB_API_TEST_ORG).getRepository("github-api");
@@ -455,7 +455,7 @@ public void testEventApi() throws Exception {
455455
@Ignore("Needs mocking check")
456456
@Test
457457
public void testApp() throws IOException {
458-
System.out.println(gitHub.getMyself().getEmails());
458+
// System.out.println(gitHub.getMyself().getEmails());
459459

460460
// GHRepository r = gitHub.getOrganization("jenkinsci").createRepository("kktest4", "Kohsuke's test", "http://kohsuke.org/", "Everyone", true);
461461
// r.fork();
@@ -466,8 +466,8 @@ public void testApp() throws IOException {
466466

467467
// GHPullRequest i = gitHub.getOrganization("jenkinsci").getRepository("sandbox").getPullRequest(1);
468468
// for (GHIssueComment c : i.getComments())
469-
// System.out.println(c);
470-
// System.out.println(i);
469+
// // System.out.println(c);
470+
// // System.out.println(i);
471471

472472
// gitHub.getMyself().getRepository("perforce-plugin").setEmailServiceHook("kk@kohsuke.org");
473473

@@ -480,9 +480,9 @@ public void testApp() throws IOException {
480480
// tryTeamCreation(gitHub);
481481

482482
// t.add(gitHub.getMyself());
483-
// System.out.println(t.getMembers());
483+
// // System.out.println(t.getMembers());
484484
// t.remove(gitHub.getMyself());
485-
// System.out.println(t.getMembers());
485+
// // System.out.println(t.getMembers());
486486

487487
// GHRepository r = gitHub.getOrganization("HudsonLabs").createRepository("auto-test", "some description", "http://kohsuke.org/", "Plugin Developers", true);
488488

@@ -491,17 +491,17 @@ public void testApp() throws IOException {
491491
//// hub.createRepository("test","test repository",null,true);
492492
//// hub.getUserTest("kohsuke").getRepository("test").delete();
493493
//
494-
// System.out.println(hub.getUserTest("kohsuke").getRepository("hudson").getCollaborators());
494+
// // System.out.println(hub.getUserTest("kohsuke").getRepository("hudson").getCollaborators());
495495
}
496496

497497
private void tryDisablingIssueTrackers(GitHub gitHub) throws IOException {
498498
for (GHRepository r : gitHub.getOrganization("jenkinsci").getRepositories().values()) {
499499
if (r.hasIssues()) {
500500
if (r.getOpenIssueCount() == 0) {
501-
System.out.println("DISABLED " + r.getName());
501+
// System.out.println("DISABLED " + r.getName());
502502
r.enableIssueTracker(false);
503503
} else {
504-
System.out.println("UNTOUCHED " + r.getName());
504+
// System.out.println("UNTOUCHED " + r.getName());
505505
}
506506
}
507507
}
@@ -510,16 +510,16 @@ private void tryDisablingIssueTrackers(GitHub gitHub) throws IOException {
510510
private void tryDisablingWiki(GitHub gitHub) throws IOException {
511511
for (GHRepository r : gitHub.getOrganization("jenkinsci").getRepositories().values()) {
512512
if (r.hasWiki()) {
513-
System.out.println("DISABLED " + r.getName());
513+
// System.out.println("DISABLED " + r.getName());
514514
r.enableWiki(false);
515515
}
516516
}
517517
}
518518

519519
private void tryUpdatingIssueTracker(GitHub gitHub) throws IOException {
520520
GHRepository r = gitHub.getOrganization("jenkinsci").getRepository("lib-task-reactor");
521-
System.out.println(r.hasIssues());
522-
System.out.println(r.getOpenIssueCount());
521+
// System.out.println(r.hasIssues());
522+
// System.out.println(r.getOpenIssueCount());
523523
r.enableIssueTracker(false);
524524
}
525525

@@ -537,9 +537,9 @@ private void testPostCommitHook(GitHub gitHub) throws IOException {
537537
GHRepository r = gitHub.getMyself().getRepository("foo");
538538
Set<URL> hooks = r.getPostCommitHooks();
539539
hooks.add(new URL("http://kohsuke.org/test"));
540-
System.out.println(hooks);
540+
// System.out.println(hooks);
541541
hooks.remove(new URL("http://kohsuke.org/test"));
542-
System.out.println(hooks);
542+
// System.out.println(hooks);
543543
}
544544

545545
@Test
@@ -549,7 +549,7 @@ public void testOrgRepositories() throws IOException {
549549
long start = System.currentTimeMillis();
550550
Map<String, GHRepository> repos = j.getRepositories();
551551
long end = System.currentTimeMillis();
552-
System.out.printf("%d repositories in %dms\n", repos.size(), end - start);
552+
// System.out.printf("%d repositories in %dms\n", repos.size(), end - start);
553553
}
554554

555555
@Test
@@ -573,7 +573,7 @@ public void testCommitStatus() throws Exception {
573573

574574
List<GHCommitStatus> lst = r.listCommitStatuses("ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396").asList();
575575
state = lst.get(0);
576-
System.out.println(state);
576+
// System.out.println(state);
577577
assertEquals("testing!", state.getDescription());
578578
assertEquals("http://kohsuke.org/", state.getTargetUrl());
579579
}
@@ -635,7 +635,7 @@ public void testCreateRelease() throws Exception {
635635
assertEquals(ref.getRef(), "refs/heads/" + releaseName);
636636

637637
for (Map.Entry<String, GHBranch> entry : r.getBranches().entrySet()) {
638-
System.out.println(entry.getKey() + "/" + entry.getValue());
638+
// System.out.println(entry.getKey() + "/" + entry.getValue());
639639
if (releaseName.equals(entry.getValue().getName())) {
640640
return;
641641
}
@@ -659,10 +659,10 @@ public void testRef() throws IOException {
659659
public void directoryListing() throws IOException {
660660
List<GHContent> children = gitHub.getRepository("jenkinsci/jenkins").getDirectoryContent("core");
661661
for (GHContent c : children) {
662-
System.out.println(c.getName());
662+
// System.out.println(c.getName());
663663
if (c.isDirectory()) {
664664
for (GHContent d : c.listDirectoryContent()) {
665-
System.out.println(" " + d.getName());
665+
// System.out.println(" " + d.getName());
666666
}
667667
}
668668
}
@@ -702,7 +702,7 @@ public void testCommitStatusContext() throws IOException {
702702
public void testMemberPagenation() throws IOException {
703703
Set<GHUser> all = new HashSet<GHUser>();
704704
for (GHUser u : gitHub.getOrganization(GITHUB_API_TEST_ORG).getTeamByName("Core Developers").listMembers()) {
705-
System.out.println(u.getLogin());
705+
// System.out.println(u.getLogin());
706706
all.add(u);
707707
}
708708
assertFalse(all.isEmpty());
@@ -723,7 +723,7 @@ public void testCommitSearch() throws IOException {
723723
public void testIssueSearch() throws IOException {
724724
PagedSearchIterable<GHIssue> r = gitHub.searchIssues().mentions("kohsuke").isOpen().list();
725725
for (GHIssue i : r) {
726-
System.out.println(i.getTitle());
726+
// System.out.println(i.getTitle());
727727
}
728728
}
729729

@@ -771,7 +771,7 @@ public void testRepoLabel() throws IOException {
771771
GHRepository r = gitHub.getRepository("github-api-test-org/test-labels");
772772
List<GHLabel> lst = r.listLabels().asList();
773773
for (GHLabel l : lst) {
774-
System.out.println(l.getName());
774+
// System.out.println(l.getName());
775775
}
776776
assertTrue(lst.size() > 5);
777777
GHLabel e = r.getLabel("enhancement");
@@ -868,10 +868,10 @@ public void notifications() throws Exception {
868868
@Test
869869
public void checkToString() throws Exception {
870870
GHUser u = gitHub.getUser("rails");
871-
System.out.println(u);
871+
// System.out.println(u);
872872
GHRepository r = u.getRepository("rails");
873-
System.out.println(r);
874-
System.out.println(r.getIssue(1));
873+
// System.out.println(r);
874+
// System.out.println(r.getIssue(1));
875875
}
876876

877877
@Test

src/test/java/org/kohsuke/github/GHPullRequestTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public void createPullRequestComment() throws Exception {
8181
public void closePullRequest() throws Exception {
8282
String name = "closePullRequest";
8383
GHPullRequest p = getRepository().createPullRequest(name, "test/stable", "master", "## test");
84-
System.out.println(p.getUrl());
84+
// System.out.println(p.getUrl());
8585
assertEquals(name, p.getTitle());
8686
assertEquals(GHIssueState.OPEN, getRepository().getPullRequest(p.getNumber()).getState());
8787
p.close();
@@ -122,7 +122,7 @@ public void pullRequestReviews() throws Exception {
122122
public void pullRequestReviewComments() throws Exception {
123123
String name = "pullRequestReviewComments";
124124
GHPullRequest p = getRepository().createPullRequest(name, "test/stable", "master", "## test");
125-
System.out.println(p.getUrl());
125+
// System.out.println(p.getUrl());
126126
assertTrue(p.listReviewComments().asList().isEmpty());
127127
p.createReviewComment("Sample review comment", p.getHead().getSha(), "README.md", 1);
128128
List<GHPullRequestReviewComment> comments = p.listReviewComments().asList();
@@ -145,7 +145,7 @@ public void pullRequestReviewComments() throws Exception {
145145
public void testPullRequestReviewRequests() throws Exception {
146146
String name = "testPullRequestReviewRequests";
147147
GHPullRequest p = getRepository().createPullRequest(name, "test/stable", "master", "## test");
148-
System.out.println(p.getUrl());
148+
// System.out.println(p.getUrl());
149149
assertTrue(p.getRequestedReviewers().isEmpty());
150150

151151
GHUser kohsuke2 = gitHub.getUser("kohsuke2");
@@ -158,7 +158,7 @@ public void testPullRequestReviewRequests() throws Exception {
158158
public void testPullRequestTeamReviewRequests() throws Exception {
159159
String name = "testPullRequestTeamReviewRequests";
160160
GHPullRequest p = getRepository().createPullRequest(name, "test/stable", "master", "## test");
161-
System.out.println(p.getUrl());
161+
// System.out.println(p.getUrl());
162162
assertTrue(p.getRequestedReviewers().isEmpty());
163163

164164
GHOrganization testOrg = gitHub.getOrganization("github-api-test-org");

src/test/java/org/kohsuke/github/GHRepositoryTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public void listLanguages() throws IOException {
190190
@Test // Issue #261
191191
public void listEmptyContributors() throws IOException {
192192
for (GHRepository.Contributor c : gitHub.getRepository(GITHUB_API_TEST_ORG + "/empty").listContributors()) {
193-
System.out.println(c);
193+
// System.out.println(c);
194194
fail("This list should be empty, but should return a valid empty iterable.");
195195
}
196196
}
@@ -199,7 +199,7 @@ public void listEmptyContributors() throws IOException {
199199
public void searchRepositories() throws Exception {
200200
PagedSearchIterable<GHRepository> r = gitHub.searchRepositories().q("tetris").language("assembly").sort(GHRepositorySearchBuilder.Sort.STARS).list();
201201
GHRepository u = r.iterator().next();
202-
System.out.println(u.getName());
202+
// System.out.println(u.getName());
203203
assertNotNull(u.getId());
204204
assertEquals("Assembly", u.getLanguage());
205205
assertTrue(r.getTotalCount() > 0);
@@ -214,7 +214,7 @@ public void testIssue162() throws Exception {
214214
if (content.isFile()) {
215215
String content1 = content.getContent();
216216
String content2 = r.getFileContent(content.getPath(), "gh-pages").getContent();
217-
System.out.println(content.getPath());
217+
// System.out.println(content.getPath());
218218
assertEquals(content1, content2);
219219
}
220220
}
@@ -225,7 +225,7 @@ public void markDown() throws Exception {
225225
assertEquals("<p><strong>Test日本語</strong></p>", IOUtils.toString(gitHub.renderMarkdown("**Test日本語**")).trim());
226226

227227
String actual = IOUtils.toString(gitHub.getRepository("github-api/github-api").renderMarkdown("@kohsuke to fix issue #1", MarkdownMode.GFM));
228-
System.out.println(actual);
228+
// System.out.println(actual);
229229
assertTrue(actual.contains("href=\"https://github.com/kohsuke\""));
230230
assertTrue(actual.contains("href=\"https://github.com/github-api/github-api/pull/1\""));
231231
assertTrue(actual.contains("class=\"user-mention\""));

src/test/java/org/kohsuke/github/GHUserTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void listPublicRepositories() throws IOException {
5858
for (; i < 115; i++) {
5959
assertTrue(itr.hasNext());
6060
GHRepository r = itr.next();
61-
System.out.println(r.getFullName());
61+
// System.out.println(r.getFullName());
6262
assertNotNull(r.getUrl());
6363
assertNotEquals(0L, r.getId());
6464
}
@@ -74,7 +74,7 @@ public void listPublicRepositoriesPageSize62() throws IOException {
7474
for (; i < 115; i++) {
7575
assertTrue(itr.hasNext());
7676
GHRepository r = itr.next();
77-
System.out.println(r.getFullName());
77+
// System.out.println(r.getFullName());
7878
assertNotNull(r.getUrl());
7979
assertNotEquals(0L, r.getId());
8080
}

src/test/java/org/kohsuke/github/GitHubTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class GitHubTest extends AbstractGitHubWireMockTest {
2323
public void listUsers() throws IOException {
2424
for (GHUser u : Iterables.limit(gitHub.listUsers(), 10)) {
2525
assert u.getName() != null;
26-
System.out.println(u.getName());
26+
// System.out.println(u.getName());
2727
}
2828
}
2929

@@ -33,7 +33,7 @@ public void getOrgs() throws IOException {
3333
Set<Long> orgIds = new HashSet<Long>();
3434
for (GHOrganization org : Iterables.limit(gitHub.listOrganizations().withPageSize(2), iterations)) {
3535
orgIds.add(org.getId());
36-
System.out.println(org.getName());
36+
// System.out.println(org.getName());
3737
}
3838
assertThat(orgIds.size(), equalTo(iterations));
3939
}
@@ -42,7 +42,7 @@ public void getOrgs() throws IOException {
4242
public void searchUsers() throws Exception {
4343
PagedSearchIterable<GHUser> r = gitHub.searchUsers().q("tom").repos(">42").followers(">1000").list();
4444
GHUser u = r.iterator().next();
45-
System.out.println(u.getName());
45+
// System.out.println(u.getName());
4646
assertNotNull(u.getId());
4747
assertTrue(r.getTotalCount() > 0);
4848
}
@@ -53,7 +53,7 @@ public void testListAllRepositories() throws Exception {
5353
for (int i = 0; i < 115; i++) {
5454
assertTrue(itr.hasNext());
5555
GHRepository r = itr.next();
56-
System.out.println(r.getFullName());
56+
// System.out.println(r.getFullName());
5757
assertNotNull(r.getUrl());
5858
assertNotEquals(0L, r.getId());
5959
}
@@ -63,7 +63,7 @@ public void testListAllRepositories() throws Exception {
6363
public void searchContent() throws Exception {
6464
PagedSearchIterable<GHContent> r = gitHub.searchContent().q("addClass").in("file").language("js").repo("jquery/jquery").list();
6565
GHContent c = r.iterator().next();
66-
System.out.println(c.getName());
66+
// System.out.println(c.getName());
6767
assertNotNull(c.getDownloadUrl());
6868
assertNotNull(c.getOwner());
6969
assertEquals("jquery/jquery", c.getOwner().getFullName());

src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ public void user_whenProxying_AuthCorrectlyConfigured() throws Exception {
3636
GHUser user = gitHub.getMyself();
3737
assertThat(user.getLogin(), notNullValue());
3838

39-
System.out.println();
40-
System.out.println("WireMockStatusReporterTest: GitHub proxying and user auth correctly configured for user login: " + user.getLogin());
41-
System.out.println();
39+
// System.out.println();
40+
// System.out.println("WireMockStatusReporterTest: GitHub proxying and user auth correctly configured for user login: " + user.getLogin());
41+
// System.out.println();
4242
}
4343

4444
@Test
@@ -56,7 +56,7 @@ public void user_whenNotProxying_Stubbed() throws Exception {
5656
assertThat(user.getLogin(), not(equalTo(STUBBED_USER_LOGIN)));
5757
assertThat(user.getLogin(), equalTo("stubbed-user-login"));
5858

59-
System.out.println("GitHub proxying and user auth correctly configured for user login: " + user.getLogin());
59+
// System.out.println("GitHub proxying and user auth correctly configured for user login: " + user.getLogin());
6060
}
6161

6262
@Ignore("Can't run this as WireMock will report failure after the test method completes.")

0 commit comments

Comments
 (0)