{"action":"created","comment":{"url":"https://api.github.com/repos/se-edu/addressbook-level2/pulls/comments/93842553","pull_request_review_id":14376478,"id":93842553,"diff_hunk":"@@ -0,0 +1,102 @@\n+package seedu.addressbook.storage;\n+\n+import static org.junit.Assert.assertTrue;\n+import java.nio.file.Paths;\n+import java.util.Collections;\n+import org.junit.Rule;\n+import org.junit.Test;\n+import org.junit.rules.ExpectedException;\n+\n+import seedu.addressbook.data.AddressBook;\n+import seedu.addressbook.data.exception.IllegalValueException;\n+import seedu.addressbook.data.person.Address;\n+import seedu.addressbook.data.person.Email;\n+import seedu.addressbook.data.person.Name;\n+import seedu.addressbook.data.person.Person;\n+import seedu.addressbook.data.person.Phone;\n+import seedu.addressbook.data.person.UniquePersonList;\n+import seedu.addressbook.data.tag.Tag;\n+import seedu.addressbook.data.tag.UniqueTagList;\n+import seedu.addressbook.storage.StorageFile.StorageOperationException;\n+import seedu.addressbook.util.TestUtil;\n+\n+public class StorageFileTest {\n+    private static final String TEST_DATA_FOLDER = \"test/data/StorageFileTest\";\n+\n+    @Rule\n+    public ExpectedException thrown = ExpectedException.none();\n+\n+    @Test\n+    public void constructor_nullFilePath_exceptionThrown() throws Exception {\n+        thrown.expect(NullPointerException.class);\n+        new StorageFile(null);\n+    }\n+\n+    @Test\n+    public void constructor_noTxtExtension_exceptionThrown() throws Exception {\n+        thrown.expect(IllegalValueException.class);\n+        new StorageFile(TEST_DATA_FOLDER + \"/InvalidFileName\");\n+    }\n+\n+    @Test\n+    public void load_invalidFormat_exceptionThrown() throws Exception {\n+        // The file contains valid xml data, but does not match the AddressBook class\n+        StorageFile storage = getStorage(\"/InvalidData.txt\");\n+        thrown.expect(StorageOperationException.class);\n+        storage.load();\n+    }\n+\n+    @Test\n+    public void load_validFormat() throws Exception {\n+        AddressBook ab = getStorage(\"/ValidData.txt\").load();\n+        UniquePersonList list = new UniquePersonList(getTestPerson());\n+\n+        // ensure loaded AddressBook Object is properly constructed with test data\n+        assertTrue(ab.getAllPersons().equals(list));","path":"test/java/seedu/addressbook/storage/StorageFileTest.java","position":55,"original_position":55,"commit_id":"ecd16b799d434ff38e3c86bced59e4a2f9cf072b","original_commit_id":"ecd16b799d434ff38e3c86bced59e4a2f9cf072b","user":{"login":"damithc","id":1673303,"avatar_url":"https://avatars.githubusercontent.com/u/1673303?v=3","gravatar_id":"","url":"https://api.github.com/users/damithc","html_url":"https://github.com/damithc","followers_url":"https://api.github.com/users/damithc/followers","following_url":"https://api.github.com/users/damithc/following{/other_user}","gists_url":"https://api.github.com/users/damithc/gists{/gist_id}","starred_url":"https://api.github.com/users/damithc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damithc/subscriptions","organizations_url":"https://api.github.com/users/damithc/orgs","repos_url":"https://api.github.com/users/damithc/repos","events_url":"https://api.github.com/users/damithc/events{/privacy}","received_events_url":"https://api.github.com/users/damithc/received_events","type":"User","site_admin":false},"body":"Using equals can be done separately. Just add a `//TODO:` comment.","created_at":"2016-12-26T05:14:14Z","updated_at":"2016-12-26T05:14:14Z","html_url":"https://github.com/se-edu/addressbook-level2/pull/128#discussion_r93842553","pull_request_url":"https://api.github.com/repos/se-edu/addressbook-level2/pulls/128","_links":{"self":{"href":"https://api.github.com/repos/se-edu/addressbook-level2/pulls/comments/93842553"},"html":{"href":"https://github.com/se-edu/addressbook-level2/pull/128#discussion_r93842553"},"pull_request":{"href":"https://api.github.com/repos/se-edu/addressbook-level2/pulls/128"}}},"pull_request":{"url":"https://api.github.com/repos/se-edu/addressbook-level2/pulls/128","id":99053824,"html_url":"https://github.com/se-edu/addressbook-level2/pull/128","diff_url":"https://github.com/se-edu/addressbook-level2/pull/128.diff","patch_url":"https://github.com/se-edu/addressbook-level2/pull/128.patch","issue_url":"https://api.github.com/repos/se-edu/addressbook-level2/issues/128","number":128,"state":"open","locked":false,"title":"Add unit tests for StorageFile class #104","user":{"login":"zzzzwen","id":21164781,"avatar_url":"https://avatars.githubusercontent.com/u/21164781?v=3","gravatar_id":"","url":"https://api.github.com/users/zzzzwen","html_url":"https://github.com/zzzzwen","followers_url":"https://api.github.com/users/zzzzwen/followers","following_url":"https://api.github.com/users/zzzzwen/following{/other_user}","gists_url":"https://api.github.com/users/zzzzwen/gists{/gist_id}","starred_url":"https://api.github.com/users/zzzzwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zzzzwen/subscriptions","organizations_url":"https://api.github.com/users/zzzzwen/orgs","repos_url":"https://api.github.com/users/zzzzwen/repos","events_url":"https://api.github.com/users/zzzzwen/events{/privacy}","received_events_url":"https://api.github.com/users/zzzzwen/received_events","type":"User","site_admin":false},"body":"Fix #104 \r\n\r\nSome format issues still.\r\nI wonder if unit test on `StorageFile` can depend on `AddressBook` class or it is necessary to create another 'AddressBook' stub for this test though I only uses empty `AddressBook.`","created_at":"2016-12-22T06:20:04Z","updated_at":"2016-12-26T05:14:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60410e3c3f8825094df5085a9bae0e064d7875fa","assignee":{"login":"pyokagan","id":109479,"avatar_url":"https://avatars.githubusercontent.com/u/109479?v=3","gravatar_id":"","url":"https://api.github.com/users/pyokagan","html_url":"https://github.com/pyokagan","followers_url":"https://api.github.com/users/pyokagan/followers","following_url":"https://api.github.com/users/pyokagan/following{/other_user}","gists_url":"https://api.github.com/users/pyokagan/gists{/gist_id}","starred_url":"https://api.github.com/users/pyokagan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyokagan/subscriptions","organizations_url":"https://api.github.com/users/pyokagan/orgs","repos_url":"https://api.github.com/users/pyokagan/repos","events_url":"https://api.github.com/users/pyokagan/events{/privacy}","received_events_url":"https://api.github.com/users/pyokagan/received_events","type":"User","site_admin":false},"assignees":[{"login":"pyokagan","id":109479,"avatar_url":"https://avatars.githubusercontent.com/u/109479?v=3","gravatar_id":"","url":"https://api.github.com/users/pyokagan","html_url":"https://github.com/pyokagan","followers_url":"https://api.github.com/users/pyokagan/followers","following_url":"https://api.github.com/users/pyokagan/following{/other_user}","gists_url":"https://api.github.com/users/pyokagan/gists{/gist_id}","starred_url":"https://api.github.com/users/pyokagan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyokagan/subscriptions","organizations_url":"https://api.github.com/users/pyokagan/orgs","repos_url":"https://api.github.com/users/pyokagan/repos","events_url":"https://api.github.com/users/pyokagan/events{/privacy}","received_events_url":"https://api.github.com/users/pyokagan/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/se-edu/addressbook-level2/pulls/128/commits","review_comments_url":"https://api.github.com/repos/se-edu/addressbook-level2/pulls/128/comments","review_comment_url":"https://api.github.com/repos/se-edu/addressbook-level2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/se-edu/addressbook-level2/issues/128/comments","statuses_url":"https://api.github.com/repos/se-edu/addressbook-level2/statuses/ecd16b799d434ff38e3c86bced59e4a2f9cf072b","head":{"label":"zzzzwen:StorageFile_Tests","ref":"StorageFile_Tests","sha":"ecd16b799d434ff38e3c86bced59e4a2f9cf072b","user":{"login":"zzzzwen","id":21164781,"avatar_url":"https://avatars.githubusercontent.com/u/21164781?v=3","gravatar_id":"","url":"https://api.github.com/users/zzzzwen","html_url":"https://github.com/zzzzwen","followers_url":"https://api.github.com/users/zzzzwen/followers","following_url":"https://api.github.com/users/zzzzwen/following{/other_user}","gists_url":"https://api.github.com/users/zzzzwen/gists{/gist_id}","starred_url":"https://api.github.com/users/zzzzwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zzzzwen/subscriptions","organizations_url":"https://api.github.com/users/zzzzwen/orgs","repos_url":"https://api.github.com/users/zzzzwen/repos","events_url":"https://api.github.com/users/zzzzwen/events{/privacy}","received_events_url":"https://api.github.com/users/zzzzwen/received_events","type":"User","site_admin":false},"repo":{"id":76709601,"name":"addressbook-level2","full_name":"zzzzwen/addressbook-level2","owner":{"login":"zzzzwen","id":21164781,"avatar_url":"https://avatars.githubusercontent.com/u/21164781?v=3","gravatar_id":"","url":"https://api.github.com/users/zzzzwen","html_url":"https://github.com/zzzzwen","followers_url":"https://api.github.com/users/zzzzwen/followers","following_url":"https://api.github.com/users/zzzzwen/following{/other_user}","gists_url":"https://api.github.com/users/zzzzwen/gists{/gist_id}","starred_url":"https://api.github.com/users/zzzzwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zzzzwen/subscriptions","organizations_url":"https://api.github.com/users/zzzzwen/orgs","repos_url":"https://api.github.com/users/zzzzwen/repos","events_url":"https://api.github.com/users/zzzzwen/events{/privacy}","received_events_url":"https://api.github.com/users/zzzzwen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zzzzwen/addressbook-level2","description":"A Java sample application for students. An AddressBook application that uses OOP basics.","fork":true,"url":"https://api.github.com/repos/zzzzwen/addressbook-level2","forks_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/forks","keys_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/teams","hooks_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/hooks","issue_events_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/issues/events{/number}","events_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/events","assignees_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/assignees{/user}","branches_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/branches{/branch}","tags_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/tags","blobs_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/git/refs{/sha}","trees_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/statuses/{sha}","languages_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/languages","stargazers_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/stargazers","contributors_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/contributors","subscribers_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/subscribers","subscription_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/subscription","commits_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/commits{/sha}","git_commits_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/git/commits{/sha}","comments_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/comments{/number}","issue_comment_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/issues/comments{/number}","contents_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/contents/{+path}","compare_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/merges","archive_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/downloads","issues_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/issues{/number}","pulls_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/pulls{/number}","milestones_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/milestones{/number}","notifications_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/labels{/name}","releases_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/releases{/id}","deployments_url":"https://api.github.com/repos/zzzzwen/addressbook-level2/deployments","created_at":"2016-12-17T07:10:07Z","updated_at":"2016-12-17T07:10:08Z","pushed_at":"2016-12-26T03:31:26Z","git_url":"git://github.com/zzzzwen/addressbook-level2.git","ssh_url":"git@github.com:zzzzwen/addressbook-level2.git","clone_url":"https://github.com/zzzzwen/addressbook-level2.git","svn_url":"https://github.com/zzzzwen/addressbook-level2","homepage":null,"size":3117,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"se-edu:master","ref":"master","sha":"7d1de69dc5ab25b32e14e7bf49f89e8038eb4b67","user":{"login":"se-edu","id":20763652,"avatar_url":"https://avatars.githubusercontent.com/u/20763652?v=3","gravatar_id":"","url":"https://api.github.com/users/se-edu","html_url":"https://github.com/se-edu","followers_url":"https://api.github.com/users/se-edu/followers","following_url":"https://api.github.com/users/se-edu/following{/other_user}","gists_url":"https://api.github.com/users/se-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/se-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/se-edu/subscriptions","organizations_url":"https://api.github.com/users/se-edu/orgs","repos_url":"https://api.github.com/users/se-edu/repos","events_url":"https://api.github.com/users/se-edu/events{/privacy}","received_events_url":"https://api.github.com/users/se-edu/received_events","type":"Organization","site_admin":false},"repo":{"id":63947541,"name":"addressbook-level2","full_name":"se-edu/addressbook-level2","owner":{"login":"se-edu","id":20763652,"avatar_url":"https://avatars.githubusercontent.com/u/20763652?v=3","gravatar_id":"","url":"https://api.github.com/users/se-edu","html_url":"https://github.com/se-edu","followers_url":"https://api.github.com/users/se-edu/followers","following_url":"https://api.github.com/users/se-edu/following{/other_user}","gists_url":"https://api.github.com/users/se-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/se-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/se-edu/subscriptions","organizations_url":"https://api.github.com/users/se-edu/orgs","repos_url":"https://api.github.com/users/se-edu/repos","events_url":"https://api.github.com/users/se-edu/events{/privacy}","received_events_url":"https://api.github.com/users/se-edu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/se-edu/addressbook-level2","description":"A Java sample application for students. An AddressBook application that uses OOP basics.","fork":false,"url":"https://api.github.com/repos/se-edu/addressbook-level2","forks_url":"https://api.github.com/repos/se-edu/addressbook-level2/forks","keys_url":"https://api.github.com/repos/se-edu/addressbook-level2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/se-edu/addressbook-level2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/se-edu/addressbook-level2/teams","hooks_url":"https://api.github.com/repos/se-edu/addressbook-level2/hooks","issue_events_url":"https://api.github.com/repos/se-edu/addressbook-level2/issues/events{/number}","events_url":"https://api.github.com/repos/se-edu/addressbook-level2/events","assignees_url":"https://api.github.com/repos/se-edu/addressbook-level2/assignees{/user}","branches_url":"https://api.github.com/repos/se-edu/addressbook-level2/branches{/branch}","tags_url":"https://api.github.com/repos/se-edu/addressbook-level2/tags","blobs_url":"https://api.github.com/repos/se-edu/addressbook-level2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/se-edu/addressbook-level2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/se-edu/addressbook-level2/git/refs{/sha}","trees_url":"https://api.github.com/repos/se-edu/addressbook-level2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/se-edu/addressbook-level2/statuses/{sha}","languages_url":"https://api.github.com/repos/se-edu/addressbook-level2/languages","stargazers_url":"https://api.github.com/repos/se-edu/addressbook-level2/stargazers","contributors_url":"https://api.github.com/repos/se-edu/addressbook-level2/contributors","subscribers_url":"https://api.github.com/repos/se-edu/addressbook-level2/subscribers","subscription_url":"https://api.github.com/repos/se-edu/addressbook-level2/subscription","commits_url":"https://api.github.com/repos/se-edu/addressbook-level2/commits{/sha}","git_commits_url":"https://api.github.com/repos/se-edu/addressbook-level2/git/commits{/sha}","comments_url":"https://api.github.com/repos/se-edu/addressbook-level2/comments{/number}","issue_comment_url":"https://api.github.com/repos/se-edu/addressbook-level2/issues/comments{/number}","contents_url":"https://api.github.com/repos/se-edu/addressbook-level2/contents/{+path}","compare_url":"https://api.github.com/repos/se-edu/addressbook-level2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/se-edu/addressbook-level2/merges","archive_url":"https://api.github.com/repos/se-edu/addressbook-level2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/se-edu/addressbook-level2/downloads","issues_url":"https://api.github.com/repos/se-edu/addressbook-level2/issues{/number}","pulls_url":"https://api.github.com/repos/se-edu/addressbook-level2/pulls{/number}","milestones_url":"https://api.github.com/repos/se-edu/addressbook-level2/milestones{/number}","notifications_url":"https://api.github.com/repos/se-edu/addressbook-level2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/se-edu/addressbook-level2/labels{/name}","releases_url":"https://api.github.com/repos/se-edu/addressbook-level2/releases{/id}","deployments_url":"https://api.github.com/repos/se-edu/addressbook-level2/deployments","created_at":"2016-07-22T11:11:54Z","updated_at":"2016-12-22T16:28:24Z","pushed_at":"2016-12-26T03:31:28Z","git_url":"git://github.com/se-edu/addressbook-level2.git","ssh_url":"git@github.com:se-edu/addressbook-level2.git","clone_url":"https://github.com/se-edu/addressbook-level2.git","svn_url":"https://github.com/se-edu/addressbook-level2","homepage":null,"size":3084,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":252,"mirror_url":null,"open_issues_count":25,"forks":252,"open_issues":25,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/se-edu/addressbook-level2/pulls/128"},"html":{"href":"https://github.com/se-edu/addressbook-level2/pull/128"},"issue":{"href":"https://api.github.com/repos/se-edu/addressbook-level2/issues/128"},"comments":{"href":"https://api.github.com/repos/se-edu/addressbook-level2/issues/128/comments"},"review_comments":{"href":"https://api.github.com/repos/se-edu/addressbook-level2/pulls/128/comments"},"review_comment":{"href":"https://api.github.com/repos/se-edu/addressbook-level2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/se-edu/addressbook-level2/pulls/128/commits"},"statuses":{"href":"https://api.github.com/repos/se-edu/addressbook-level2/statuses/ecd16b799d434ff38e3c86bced59e4a2f9cf072b"}}}}
{"actor":{"display_login":"damithc"}}