GitHub PullRequestReviewCommentEvent at 2014-10-13 20:52:01
Repository: wire
Actor: JakeWharton
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/square/wire/pulls/comments/18794149","id":18794149,"diff_hunk":"@@ -325,4 +331,52 @@ public void testBadEnum() throws IOException {\n     byte[] newData = result.toByteArray();\n     assertTrue(Arrays.equals(data, newData));\n   }\n+\n+  @Test\n+  public void testDelimited() throws IOException {\n+    BufferedSink sink = null;\n+    BufferedSource source = null;\n+    Wire wire = new Wire();\n+    Person person = new Person.Builder()\n+            .name(\"Omar\")\n+            .id(1234)\n+            .email(\"omar@wire.com\")\n+            .phone(Arrays.asList(new PhoneNumber.Builder()\n+                    .number(\"410-555-0909\")\n+                    .type(PhoneType.MOBILE)\n+                    .build()))\n+            .build();\n+    File tmpFile = File.createTempFile(\"test\", \"wire\");\n+    try {\n+      sink = Okio.buffer(Okio.sink(tmpFile));\n+      for (int i = 0; i < 100; i++) {\n+        person.writeDelimitedTo(sink);","path":"wire-runtime/src/test/java/com/squareup/wire/WireTest.java","position":41,"original_position":41,"commit_id":"608cd45fe47c8f753e17f0d1c6344b2cc364a093","original_commit_id":"608cd45fe47c8f753e17f0d1c6344b2cc364a093","user":{"login":"JakeWharton","id":66577,"avatar_url":"https://avatars.githubusercontent.com/u/66577?v=2","gravatar_id":"","url":"https://api.github.com/users/JakeWharton","html_url":"https://github.com/JakeWharton","followers_url":"https://api.github.com/users/JakeWharton/followers","following_url":"https://api.github.com/users/JakeWharton/following{/other_user}","gists_url":"https://api.github.com/users/JakeWharton/gists{/gist_id}","starred_url":"https://api.github.com/users/JakeWharton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakeWharton/subscriptions","organizations_url":"https://api.github.com/users/JakeWharton/orgs","repos_url":"https://api.github.com/users/JakeWharton/repos","events_url":"https://api.github.com/users/JakeWharton/events{/privacy}","received_events_url":"https://api.github.com/users/JakeWharton/received_events","type":"User","site_admin":false},"body":"We should be testing these separately to ensure the delimited bytes are what we expect. If we break compatibility in the on-disk byte format somehow in the future this test would still pass. ","created_at":"2014-10-13T20:52:01Z","updated_at":"2014-10-13T20:52:01Z","html_url":"https://github.com/square/wire/pull/155#discussion_r18794149","pull_request_url":"https://api.github.com/repos/square/wire/pulls/155","_links":{"self":{"href":"https://api.github.com/repos/square/wire/pulls/comments/18794149"},"html":{"href":"https://github.com/square/wire/pull/155#discussion_r18794149"},"pull_request":{"href":"https://api.github.com/repos/square/wire/pulls/155"}}},"pull_request":{"url":"https://api.github.com/repos/square/wire/pulls/155","id":20558577,"html_url":"https://github.com/square/wire/pull/155","diff_url":"https://github.com/square/wire/pull/155.diff","patch_url":"https://github.com/square/wire/pull/155.patch","issue_url":"https://api.github.com/repos/square/wire/issues/155","number":155,"state":"open","locked":false,"title":"Parse delimited from test","user":{"login":"drakelord","id":1067123,"avatar_url":"https://avatars.githubusercontent.com/u/1067123?v=2","gravatar_id":"","url":"https://api.github.com/users/drakelord","html_url":"https://github.com/drakelord","followers_url":"https://api.github.com/users/drakelord/followers","following_url":"https://api.github.com/users/drakelord/following{/other_user}","gists_url":"https://api.github.com/users/drakelord/gists{/gist_id}","starred_url":"https://api.github.com/users/drakelord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drakelord/subscriptions","organizations_url":"https://api.github.com/users/drakelord/orgs","repos_url":"https://api.github.com/users/drakelord/repos","events_url":"https://api.github.com/users/drakelord/events{/privacy}","received_events_url":"https://api.github.com/users/drakelord/received_events","type":"User","site_admin":false},"body":"Hi, I need to parse multiple messages from one file. In Google protocol buffers I used [parseDelimetedFrom](https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/AbstractParser#parseDelimitedFrom(java.io.InputStream)). This is my attempt to implement same method wire-way.","created_at":"2014-09-01T07:47:26Z","updated_at":"2014-10-13T20:52:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"52d814f479c9e8183fb6699658ce4de04d454e1a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/square/wire/pulls/155/commits","review_comments_url":"https://api.github.com/repos/square/wire/pulls/155/comments","review_comment_url":"https://api.github.com/repos/square/wire/pulls/comments/{number}","comments_url":"https://api.github.com/repos/square/wire/issues/155/comments","statuses_url":"https://api.github.com/repos/square/wire/statuses/608cd45fe47c8f753e17f0d1c6344b2cc364a093","head":{"label":"drakelord:parseDelimitedFrom_test","ref":"parseDelimitedFrom_test","sha":"608cd45fe47c8f753e17f0d1c6344b2cc364a093","user":{"login":"drakelord","id":1067123,"avatar_url":"https://avatars.githubusercontent.com/u/1067123?v=2","gravatar_id":"","url":"https://api.github.com/users/drakelord","html_url":"https://github.com/drakelord","followers_url":"https://api.github.com/users/drakelord/followers","following_url":"https://api.github.com/users/drakelord/following{/other_user}","gists_url":"https://api.github.com/users/drakelord/gists{/gist_id}","starred_url":"https://api.github.com/users/drakelord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drakelord/subscriptions","organizations_url":"https://api.github.com/users/drakelord/orgs","repos_url":"https://api.github.com/users/drakelord/repos","events_url":"https://api.github.com/users/drakelord/events{/privacy}","received_events_url":"https://api.github.com/users/drakelord/received_events","type":"User","site_admin":false},"repo":{"id":23489362,"name":"wire","full_name":"drakelord/wire","owner":{"login":"drakelord","id":1067123,"avatar_url":"https://avatars.githubusercontent.com/u/1067123?v=2","gravatar_id":"","url":"https://api.github.com/users/drakelord","html_url":"https://github.com/drakelord","followers_url":"https://api.github.com/users/drakelord/followers","following_url":"https://api.github.com/users/drakelord/following{/other_user}","gists_url":"https://api.github.com/users/drakelord/gists{/gist_id}","starred_url":"https://api.github.com/users/drakelord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drakelord/subscriptions","organizations_url":"https://api.github.com/users/drakelord/orgs","repos_url":"https://api.github.com/users/drakelord/repos","events_url":"https://api.github.com/users/drakelord/events{/privacy}","received_events_url":"https://api.github.com/users/drakelord/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/drakelord/wire","description":"Clean, lightweight protocol buffers for Android.","fork":true,"url":"https://api.github.com/repos/drakelord/wire","forks_url":"https://api.github.com/repos/drakelord/wire/forks","keys_url":"https://api.github.com/repos/drakelord/wire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drakelord/wire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drakelord/wire/teams","hooks_url":"https://api.github.com/repos/drakelord/wire/hooks","issue_events_url":"https://api.github.com/repos/drakelord/wire/issues/events{/number}","events_url":"https://api.github.com/repos/drakelord/wire/events","assignees_url":"https://api.github.com/repos/drakelord/wire/assignees{/user}","branches_url":"https://api.github.com/repos/drakelord/wire/branches{/branch}","tags_url":"https://api.github.com/repos/drakelord/wire/tags","blobs_url":"https://api.github.com/repos/drakelord/wire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drakelord/wire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drakelord/wire/git/refs{/sha}","trees_url":"https://api.github.com/repos/drakelord/wire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drakelord/wire/statuses/{sha}","languages_url":"https://api.github.com/repos/drakelord/wire/languages","stargazers_url":"https://api.github.com/repos/drakelord/wire/stargazers","contributors_url":"https://api.github.com/repos/drakelord/wire/contributors","subscribers_url":"https://api.github.com/repos/drakelord/wire/subscribers","subscription_url":"https://api.github.com/repos/drakelord/wire/subscription","commits_url":"https://api.github.com/repos/drakelord/wire/commits{/sha}","git_commits_url":"https://api.github.com/repos/drakelord/wire/git/commits{/sha}","comments_url":"https://api.github.com/repos/drakelord/wire/comments{/number}","issue_comment_url":"https://api.github.com/repos/drakelord/wire/issues/comments/{number}","contents_url":"https://api.github.com/repos/drakelord/wire/contents/{+path}","compare_url":"https://api.github.com/repos/drakelord/wire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drakelord/wire/merges","archive_url":"https://api.github.com/repos/drakelord/wire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drakelord/wire/downloads","issues_url":"https://api.github.com/repos/drakelord/wire/issues{/number}","pulls_url":"https://api.github.com/repos/drakelord/wire/pulls{/number}","milestones_url":"https://api.github.com/repos/drakelord/wire/milestones{/number}","notifications_url":"https://api.github.com/repos/drakelord/wire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drakelord/wire/labels{/name}","releases_url":"https://api.github.com/repos/drakelord/wire/releases{/id}","created_at":"2014-08-30T10:17:10Z","updated_at":"2014-08-28T05:36:40Z","pushed_at":"2014-09-15T23:47:16Z","git_url":"git://github.com/drakelord/wire.git","ssh_url":"git@github.com:drakelord/wire.git","clone_url":"https://github.com/drakelord/wire.git","svn_url":"https://github.com/drakelord/wire","homepage":"","size":1369,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"square:master","ref":"master","sha":"334c7909af63b58a3fcf86373d79d752661377d0","user":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=2","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":12274147,"name":"wire","full_name":"square/wire","owner":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=2","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/wire","description":"Clean, lightweight protocol buffers for Android.","fork":false,"url":"https://api.github.com/repos/square/wire","forks_url":"https://api.github.com/repos/square/wire/forks","keys_url":"https://api.github.com/repos/square/wire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/wire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/wire/teams","hooks_url":"https://api.github.com/repos/square/wire/hooks","issue_events_url":"https://api.github.com/repos/square/wire/issues/events{/number}","events_url":"https://api.github.com/repos/square/wire/events","assignees_url":"https://api.github.com/repos/square/wire/assignees{/user}","branches_url":"https://api.github.com/repos/square/wire/branches{/branch}","tags_url":"https://api.github.com/repos/square/wire/tags","blobs_url":"https://api.github.com/repos/square/wire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/wire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/wire/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/wire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/wire/statuses/{sha}","languages_url":"https://api.github.com/repos/square/wire/languages","stargazers_url":"https://api.github.com/repos/square/wire/stargazers","contributors_url":"https://api.github.com/repos/square/wire/contributors","subscribers_url":"https://api.github.com/repos/square/wire/subscribers","subscription_url":"https://api.github.com/repos/square/wire/subscription","commits_url":"https://api.github.com/repos/square/wire/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/wire/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/wire/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/wire/issues/comments/{number}","contents_url":"https://api.github.com/repos/square/wire/contents/{+path}","compare_url":"https://api.github.com/repos/square/wire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/wire/merges","archive_url":"https://api.github.com/repos/square/wire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/wire/downloads","issues_url":"https://api.github.com/repos/square/wire/issues{/number}","pulls_url":"https://api.github.com/repos/square/wire/pulls{/number}","milestones_url":"https://api.github.com/repos/square/wire/milestones{/number}","notifications_url":"https://api.github.com/repos/square/wire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/wire/labels{/name}","releases_url":"https://api.github.com/repos/square/wire/releases{/id}","created_at":"2013-08-21T15:45:47Z","updated_at":"2014-10-13T17:20:27Z","pushed_at":"2014-10-10T14:19:44Z","git_url":"git://github.com/square/wire.git","ssh_url":"git@github.com:square/wire.git","clone_url":"https://github.com/square/wire.git","svn_url":"https://github.com/square/wire","homepage":"","size":5863,"stargazers_count":456,"watchers_count":456,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":72,"mirror_url":null,"open_issues_count":12,"forks":72,"open_issues":12,"watchers":456,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/square/wire/pulls/155"},"html":{"href":"https://github.com/square/wire/pull/155"},"issue":{"href":"https://api.github.com/repos/square/wire/issues/155"},"comments":{"href":"https://api.github.com/repos/square/wire/issues/155/comments"},"review_comments":{"href":"https://api.github.com/repos/square/wire/pulls/155/comments"},"review_comment":{"href":"https://api.github.com/repos/square/wire/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/square/wire/pulls/155/commits"},"statuses":{"href":"https://api.github.com/repos/square/wire/statuses/608cd45fe47c8f753e17f0d1c6344b2cc364a093"}}}}