{"action":"created","comment":{"url":"https://api.github.com/repos/rharter/auto-parcel/pulls/comments/36922302","id":36922302,"diff_hunk":"@@ -1,21 +1,82 @@\n package com.ryanharter.autoparcel;\n \n+import android.os.Parcelable;\n+import autovalue.shaded.com.google.common.auto.common.MoreElements;\n+import com.google.auto.common.MoreTypes;\n+import com.google.auto.value.AutoValueExtension;\n+import com.google.common.collect.ImmutableList;\n+import com.google.common.collect.ImmutableSet;\n+import com.google.common.collect.LinkedHashMultimap;\n+import com.google.common.collect.SetMultimap;\n+import com.google.testing.compile.CompilationRule;\n+import com.ryanharter.autoparcel.util.TestMessager;\n+import com.ryanharter.autoparcel.util.TestProcessingEnvironment;\n import com.squareup.javapoet.ClassName;\n import com.squareup.javapoet.FieldSpec;\n import com.squareup.javapoet.MethodSpec;\n import com.squareup.javapoet.TypeName;\n-import java.util.HashMap;\n+\n+import java.util.Arrays;\n+import java.util.Iterator;\n import java.util.LinkedHashMap;\n+import java.util.LinkedHashSet;\n import java.util.Map;\n+import java.util.Set;\n+import javax.annotation.processing.Messager;\n+import javax.annotation.processing.ProcessingEnvironment;\n+import javax.lang.model.element.Element;\n+import javax.lang.model.element.ElementKind;\n+import javax.lang.model.element.ExecutableElement;\n import javax.lang.model.element.Modifier;\n+import javax.lang.model.element.PackageElement;\n+import javax.lang.model.element.TypeElement;\n+import javax.lang.model.type.TypeKind;\n+import javax.lang.model.type.TypeMirror;\n+import javax.lang.model.util.ElementFilter;\n+import javax.lang.model.util.Elements;\n+import javax.lang.model.util.Types;\n+\n+import org.junit.Before;\n+import org.junit.Rule;\n import org.junit.Test;\n \n import static com.google.common.truth.Truth.assertThat;\n+import static org.junit.Assert.fail;\n \n public class AutoParcelExtensionTest {\n \n+  public @Rule CompilationRule rule = new CompilationRule();\n+\n   AutoParcelExtension extension = new AutoParcelExtension();\n \n+  private Elements elements;\n+  private Types types;\n+  private ProcessingEnvironment processingEnvironment;\n+\n+  @Before public void setup() {\n+    Messager messager = new TestMessager();\n+    elements = rule.getElements();\n+    types = rule.getTypes();\n+    processingEnvironment = new TestProcessingEnvironment(messager, elements, types);\n+  }\n+\n+  @Test(expected = AutoParcelException.class)\n+  public void throwsForNonParcelableProperty() throws Exception {\n+    TypeElement type = elements.getTypeElement(SampleTypeWithNonSerializable.class.getCanonicalName());\n+    AutoValueExtension.Context context = createContext(type);\n+\n+    extension.generateClass(context, \"Test_AnnotatedType\", \"SampleTypeWithNonSerializable\", true);\n+    fail();","path":"src/test/java/com/ryanharter/autoparcel/AutoParcelExtensionTest.java","position":70,"original_position":70,"commit_id":"ba59c7a18ea8b5c90389112053991711b2aa1dad","original_commit_id":"ba59c7a18ea8b5c90389112053991711b2aa1dad","user":{"login":"JakeWharton","id":66577,"avatar_url":"https://avatars.githubusercontent.com/u/66577?v=3","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":"Also, FWIW, we tend to avoid both `expected=` and the `ExpectedException` JUnit rule in favor of try/catch because it lets you assert on the exception type (and potential causes) as well as the contents of its message. It also lets you do multiple try/catch assertions in a single test whereas both of the aforementioned approaches only allow one.\r\n\r\nThat said, I don't think this really needs changed unless there's going to be _a lot_ of exception-based testing in multiple tests.","created_at":"2015-08-12T22:28:25Z","updated_at":"2015-08-12T22:28:25Z","html_url":"https://github.com/rharter/auto-parcel/pull/3#discussion_r36922302","pull_request_url":"https://api.github.com/repos/rharter/auto-parcel/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/rharter/auto-parcel/pulls/comments/36922302"},"html":{"href":"https://github.com/rharter/auto-parcel/pull/3#discussion_r36922302"},"pull_request":{"href":"https://api.github.com/repos/rharter/auto-parcel/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/rharter/auto-parcel/pulls/3","id":42287952,"html_url":"https://github.com/rharter/auto-parcel/pull/3","diff_url":"https://github.com/rharter/auto-parcel/pull/3.diff","patch_url":"https://github.com/rharter/auto-parcel/pull/3.patch","issue_url":"https://api.github.com/repos/rharter/auto-parcel/issues/3","number":3,"state":"open","locked":false,"title":"Verifies all properties are either primitive, Serializable or Parcelable.","user":{"login":"rharter","id":1296750,"avatar_url":"https://avatars.githubusercontent.com/u/1296750?v=3","gravatar_id":"","url":"https://api.github.com/users/rharter","html_url":"https://github.com/rharter","followers_url":"https://api.github.com/users/rharter/followers","following_url":"https://api.github.com/users/rharter/following{/other_user}","gists_url":"https://api.github.com/users/rharter/gists{/gist_id}","starred_url":"https://api.github.com/users/rharter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rharter/subscriptions","organizations_url":"https://api.github.com/users/rharter/orgs","repos_url":"https://api.github.com/users/rharter/repos","events_url":"https://api.github.com/users/rharter/events{/privacy}","received_events_url":"https://api.github.com/users/rharter/received_events","type":"User","site_admin":false},"body":"Fixes #2 ","created_at":"2015-08-12T20:56:42Z","updated_at":"2015-08-12T22:28:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c448e055a9fc42ada4d362a4ed60b27e412d9ab8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rharter/auto-parcel/pulls/3/commits","review_comments_url":"https://api.github.com/repos/rharter/auto-parcel/pulls/3/comments","review_comment_url":"https://api.github.com/repos/rharter/auto-parcel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rharter/auto-parcel/issues/3/comments","statuses_url":"https://api.github.com/repos/rharter/auto-parcel/statuses/ba59c7a18ea8b5c90389112053991711b2aa1dad","head":{"label":"rharter:property_check","ref":"property_check","sha":"ba59c7a18ea8b5c90389112053991711b2aa1dad","user":{"login":"rharter","id":1296750,"avatar_url":"https://avatars.githubusercontent.com/u/1296750?v=3","gravatar_id":"","url":"https://api.github.com/users/rharter","html_url":"https://github.com/rharter","followers_url":"https://api.github.com/users/rharter/followers","following_url":"https://api.github.com/users/rharter/following{/other_user}","gists_url":"https://api.github.com/users/rharter/gists{/gist_id}","starred_url":"https://api.github.com/users/rharter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rharter/subscriptions","organizations_url":"https://api.github.com/users/rharter/orgs","repos_url":"https://api.github.com/users/rharter/repos","events_url":"https://api.github.com/users/rharter/events{/privacy}","received_events_url":"https://api.github.com/users/rharter/received_events","type":"User","site_admin":false},"repo":{"id":35555582,"name":"auto-parcel","full_name":"rharter/auto-parcel","owner":{"login":"rharter","id":1296750,"avatar_url":"https://avatars.githubusercontent.com/u/1296750?v=3","gravatar_id":"","url":"https://api.github.com/users/rharter","html_url":"https://github.com/rharter","followers_url":"https://api.github.com/users/rharter/followers","following_url":"https://api.github.com/users/rharter/following{/other_user}","gists_url":"https://api.github.com/users/rharter/gists{/gist_id}","starred_url":"https://api.github.com/users/rharter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rharter/subscriptions","organizations_url":"https://api.github.com/users/rharter/orgs","repos_url":"https://api.github.com/users/rharter/repos","events_url":"https://api.github.com/users/rharter/events{/privacy}","received_events_url":"https://api.github.com/users/rharter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rharter/auto-parcel","description":"An Android Parcelable extension for Google's AutoValue.","fork":false,"url":"https://api.github.com/repos/rharter/auto-parcel","forks_url":"https://api.github.com/repos/rharter/auto-parcel/forks","keys_url":"https://api.github.com/repos/rharter/auto-parcel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rharter/auto-parcel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rharter/auto-parcel/teams","hooks_url":"https://api.github.com/repos/rharter/auto-parcel/hooks","issue_events_url":"https://api.github.com/repos/rharter/auto-parcel/issues/events{/number}","events_url":"https://api.github.com/repos/rharter/auto-parcel/events","assignees_url":"https://api.github.com/repos/rharter/auto-parcel/assignees{/user}","branches_url":"https://api.github.com/repos/rharter/auto-parcel/branches{/branch}","tags_url":"https://api.github.com/repos/rharter/auto-parcel/tags","blobs_url":"https://api.github.com/repos/rharter/auto-parcel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rharter/auto-parcel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rharter/auto-parcel/git/refs{/sha}","trees_url":"https://api.github.com/repos/rharter/auto-parcel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rharter/auto-parcel/statuses/{sha}","languages_url":"https://api.github.com/repos/rharter/auto-parcel/languages","stargazers_url":"https://api.github.com/repos/rharter/auto-parcel/stargazers","contributors_url":"https://api.github.com/repos/rharter/auto-parcel/contributors","subscribers_url":"https://api.github.com/repos/rharter/auto-parcel/subscribers","subscription_url":"https://api.github.com/repos/rharter/auto-parcel/subscription","commits_url":"https://api.github.com/repos/rharter/auto-parcel/commits{/sha}","git_commits_url":"https://api.github.com/repos/rharter/auto-parcel/git/commits{/sha}","comments_url":"https://api.github.com/repos/rharter/auto-parcel/comments{/number}","issue_comment_url":"https://api.github.com/repos/rharter/auto-parcel/issues/comments{/number}","contents_url":"https://api.github.com/repos/rharter/auto-parcel/contents/{+path}","compare_url":"https://api.github.com/repos/rharter/auto-parcel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rharter/auto-parcel/merges","archive_url":"https://api.github.com/repos/rharter/auto-parcel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rharter/auto-parcel/downloads","issues_url":"https://api.github.com/repos/rharter/auto-parcel/issues{/number}","pulls_url":"https://api.github.com/repos/rharter/auto-parcel/pulls{/number}","milestones_url":"https://api.github.com/repos/rharter/auto-parcel/milestones{/number}","notifications_url":"https://api.github.com/repos/rharter/auto-parcel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rharter/auto-parcel/labels{/name}","releases_url":"https://api.github.com/repos/rharter/auto-parcel/releases{/id}","created_at":"2015-05-13T14:58:57Z","updated_at":"2015-08-12T08:49:31Z","pushed_at":"2015-08-12T21:15:48Z","git_url":"git://github.com/rharter/auto-parcel.git","ssh_url":"git@github.com:rharter/auto-parcel.git","clone_url":"https://github.com/rharter/auto-parcel.git","svn_url":"https://github.com/rharter/auto-parcel","homepage":null,"size":202,"stargazers_count":76,"watchers_count":76,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":76,"default_branch":"master"}},"base":{"label":"rharter:master","ref":"master","sha":"622b263189c08e4cd1381777b5d2f30b6c271835","user":{"login":"rharter","id":1296750,"avatar_url":"https://avatars.githubusercontent.com/u/1296750?v=3","gravatar_id":"","url":"https://api.github.com/users/rharter","html_url":"https://github.com/rharter","followers_url":"https://api.github.com/users/rharter/followers","following_url":"https://api.github.com/users/rharter/following{/other_user}","gists_url":"https://api.github.com/users/rharter/gists{/gist_id}","starred_url":"https://api.github.com/users/rharter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rharter/subscriptions","organizations_url":"https://api.github.com/users/rharter/orgs","repos_url":"https://api.github.com/users/rharter/repos","events_url":"https://api.github.com/users/rharter/events{/privacy}","received_events_url":"https://api.github.com/users/rharter/received_events","type":"User","site_admin":false},"repo":{"id":35555582,"name":"auto-parcel","full_name":"rharter/auto-parcel","owner":{"login":"rharter","id":1296750,"avatar_url":"https://avatars.githubusercontent.com/u/1296750?v=3","gravatar_id":"","url":"https://api.github.com/users/rharter","html_url":"https://github.com/rharter","followers_url":"https://api.github.com/users/rharter/followers","following_url":"https://api.github.com/users/rharter/following{/other_user}","gists_url":"https://api.github.com/users/rharter/gists{/gist_id}","starred_url":"https://api.github.com/users/rharter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rharter/subscriptions","organizations_url":"https://api.github.com/users/rharter/orgs","repos_url":"https://api.github.com/users/rharter/repos","events_url":"https://api.github.com/users/rharter/events{/privacy}","received_events_url":"https://api.github.com/users/rharter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rharter/auto-parcel","description":"An Android Parcelable extension for Google's AutoValue.","fork":false,"url":"https://api.github.com/repos/rharter/auto-parcel","forks_url":"https://api.github.com/repos/rharter/auto-parcel/forks","keys_url":"https://api.github.com/repos/rharter/auto-parcel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rharter/auto-parcel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rharter/auto-parcel/teams","hooks_url":"https://api.github.com/repos/rharter/auto-parcel/hooks","issue_events_url":"https://api.github.com/repos/rharter/auto-parcel/issues/events{/number}","events_url":"https://api.github.com/repos/rharter/auto-parcel/events","assignees_url":"https://api.github.com/repos/rharter/auto-parcel/assignees{/user}","branches_url":"https://api.github.com/repos/rharter/auto-parcel/branches{/branch}","tags_url":"https://api.github.com/repos/rharter/auto-parcel/tags","blobs_url":"https://api.github.com/repos/rharter/auto-parcel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rharter/auto-parcel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rharter/auto-parcel/git/refs{/sha}","trees_url":"https://api.github.com/repos/rharter/auto-parcel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rharter/auto-parcel/statuses/{sha}","languages_url":"https://api.github.com/repos/rharter/auto-parcel/languages","stargazers_url":"https://api.github.com/repos/rharter/auto-parcel/stargazers","contributors_url":"https://api.github.com/repos/rharter/auto-parcel/contributors","subscribers_url":"https://api.github.com/repos/rharter/auto-parcel/subscribers","subscription_url":"https://api.github.com/repos/rharter/auto-parcel/subscription","commits_url":"https://api.github.com/repos/rharter/auto-parcel/commits{/sha}","git_commits_url":"https://api.github.com/repos/rharter/auto-parcel/git/commits{/sha}","comments_url":"https://api.github.com/repos/rharter/auto-parcel/comments{/number}","issue_comment_url":"https://api.github.com/repos/rharter/auto-parcel/issues/comments{/number}","contents_url":"https://api.github.com/repos/rharter/auto-parcel/contents/{+path}","compare_url":"https://api.github.com/repos/rharter/auto-parcel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rharter/auto-parcel/merges","archive_url":"https://api.github.com/repos/rharter/auto-parcel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rharter/auto-parcel/downloads","issues_url":"https://api.github.com/repos/rharter/auto-parcel/issues{/number}","pulls_url":"https://api.github.com/repos/rharter/auto-parcel/pulls{/number}","milestones_url":"https://api.github.com/repos/rharter/auto-parcel/milestones{/number}","notifications_url":"https://api.github.com/repos/rharter/auto-parcel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rharter/auto-parcel/labels{/name}","releases_url":"https://api.github.com/repos/rharter/auto-parcel/releases{/id}","created_at":"2015-05-13T14:58:57Z","updated_at":"2015-08-12T08:49:31Z","pushed_at":"2015-08-12T21:15:48Z","git_url":"git://github.com/rharter/auto-parcel.git","ssh_url":"git@github.com:rharter/auto-parcel.git","clone_url":"https://github.com/rharter/auto-parcel.git","svn_url":"https://github.com/rharter/auto-parcel","homepage":null,"size":202,"stargazers_count":76,"watchers_count":76,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":76,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rharter/auto-parcel/pulls/3"},"html":{"href":"https://github.com/rharter/auto-parcel/pull/3"},"issue":{"href":"https://api.github.com/repos/rharter/auto-parcel/issues/3"},"comments":{"href":"https://api.github.com/repos/rharter/auto-parcel/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/rharter/auto-parcel/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/rharter/auto-parcel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rharter/auto-parcel/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/rharter/auto-parcel/statuses/ba59c7a18ea8b5c90389112053991711b2aa1dad"}}}}