{"action":"created","comment":{"url":"https://api.github.com/repos/JabRef/jabref/pulls/comments/45329992","id":45329992,"diff_hunk":"@@ -0,0 +1,144 @@\n+package net.sf.jabref.importer.fileformat;\n+\n+import static org.junit.Assert.*;\n+\n+import java.io.IOException;\n+import java.io.InputStream;\n+import java.util.List;\n+\n+import net.sf.jabref.importer.OutputPrinterToNull;\n+import net.sf.jabref.model.entry.BibtexEntry;\n+import net.sf.jabref.model.entry.BibtexEntryTypes;\n+import org.junit.Assert;\n+\n+import net.sf.jabref.Globals;\n+import net.sf.jabref.JabRefPreferences;\n+import org.junit.Before;\n+import org.junit.Test;\n+\n+public class InspecImportTest {\n+\n+    InspecImporter inspecImp;\n+\n+    @Before\n+    public void setUp() throws Exception {\n+\n+        if (Globals.prefs == null) {\n+            Globals.prefs = JabRefPreferences.getInstance();\n+        }\n+        this.inspecImp = new InspecImporter();\n+\n+    }\n+\n+    @Test\n+    public void testIsRecognizedFormat() throws IOException {\n+\n+\n+        try (InputStream stream1 = InspecImportTest.class\n+                .getResourceAsStream(\"CopacImporterTest1.txt\"); InputStream stream2 = InspecImportTest.class\n+                .getResourceAsStream(\"CopacImporterTest2.txt\"); InputStream stream3 = InspecImportTest.class\n+                .getResourceAsStream(\"IsiImporterTest1.isi\"); InputStream stream4 = InspecImportTest.class\n+                .getResourceAsStream(\"IsiImporterTestInspec.isi\"); InputStream stream5 = InspecImportTest.class\n+                .getResourceAsStream(\"IsiImporterTestWOS.isi\"); InputStream stream6 = InspecImportTest.class\n+                .getResourceAsStream(\"IsiImporterTestMedline.isi\"); InputStream stream7 = InspecImportTest.class\n+                .getResourceAsStream(\"InspecImportTest.txt\"); InputStream stream8 = InspecImportTest.class\n+                .getResourceAsStream(\"InspecImportTest2.txt\"); InputStream stream9 = InspecImportTest.class\n+                .getResourceAsStream(\"InspecImportTest3.txt\"); InputStream stream10 = InspecImportTest.class\n+                .getResourceAsStream(\"InspecImportTest4.txt\"); InputStream stream11 = InspecImportTest.class\n+                .getResourceAsStream(\"InspecImportTestFalse.txt\")){\n+\n+            assertFalse(inspecImp.isRecognizedFormat(stream1));\n+\n+            assertFalse(inspecImp.isRecognizedFormat(stream2));\n+\n+            assertFalse(inspecImp.isRecognizedFormat(stream3));\n+\n+            assertFalse(inspecImp.isRecognizedFormat(stream4));\n+\n+            assertFalse(inspecImp.isRecognizedFormat(stream5));\n+\n+            assertFalse(inspecImp.isRecognizedFormat(stream6));\n+\n+            assertTrue(inspecImp.isRecognizedFormat(stream7));\n+\n+            assertTrue(inspecImp.isRecognizedFormat(stream8));\n+\n+            assertTrue(inspecImp.isRecognizedFormat(stream9));\n+\n+            assertTrue(inspecImp.isRecognizedFormat(stream10));\n+\n+            assertFalse(inspecImp.isRecognizedFormat(stream11));\n+        }\n+\n+        InputStream inStream = InspecImportTest.class.getResourceAsStream(\"InspecImportTest.txt\");\n+        InputStream inStreamFalse = InspecImportTest.class.getResourceAsStream(\"InspecImportTestFalse.txt\");\n+\n+        Assert.assertTrue(\"InspecImporter isRecognizedFormaTrue test failed\",\n+                inspecImp.isRecognizedFormat(inStream));\n+        Assert.assertFalse(\"InspecImporter isRecognizedFormatFalse test failed\",\n+                inspecImp.isRecognizedFormat(inStream));\n+\n+    }\n+\n+    @Test\n+    public void testImportEntries1() throws IOException{\n+\n+\n+        try(InputStream inStream = InspecImportTest.class.getResourceAsStream(\"InspecImportTest2.txt\")) {\n+            List<BibtexEntry> entries = inspecImp.importEntries(inStream, new OutputPrinterToNull());\n+            assertEquals(1, entries.size());\n+            BibtexEntry entry = entries.get(0);\n+\n+            assertEquals(\"The SIS project : software reuse with a natural language approach\", entry.getField(\"title\"));\n+            assertEquals(\"Prechelt, Lutz\", entry.getField(\"author\"));\n+            assertEquals(\" 1992\", entry.getField(\"year\"));","path":"src/test/java/net/sf/jabref/importer/fileformat/InspecImportTest.java","position":94,"original_position":94,"commit_id":"86e515f1317d9f320290ccd39f47ba49ce5112e3","original_commit_id":"86e515f1317d9f320290ccd39f47ba49ce5112e3","user":{"login":"mairdl","id":15333533,"avatar_url":"https://avatars.githubusercontent.com/u/15333533?v=3","gravatar_id":"","url":"https://api.github.com/users/mairdl","html_url":"https://github.com/mairdl","followers_url":"https://api.github.com/users/mairdl/followers","following_url":"https://api.github.com/users/mairdl/following{/other_user}","gists_url":"https://api.github.com/users/mairdl/gists{/gist_id}","starred_url":"https://api.github.com/users/mairdl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mairdl/subscriptions","organizations_url":"https://api.github.com/users/mairdl/orgs","repos_url":"https://api.github.com/users/mairdl/repos","events_url":"https://api.github.com/users/mairdl/events{/privacy}","received_events_url":"https://api.github.com/users/mairdl/received_events","type":"User","site_admin":false},"body":"Have a look at the test files (line 8), there are spaces between the \". ; :\". If there was no space it would return \".1992\". ","created_at":"2015-11-19T11:39:50Z","updated_at":"2015-11-19T11:39:50Z","html_url":"https://github.com/JabRef/jabref/pull/356#discussion_r45329992","pull_request_url":"https://api.github.com/repos/JabRef/jabref/pulls/356","_links":{"self":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/comments/45329992"},"html":{"href":"https://github.com/JabRef/jabref/pull/356#discussion_r45329992"},"pull_request":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/356"}}},"pull_request":{"url":"https://api.github.com/repos/JabRef/jabref/pulls/356","id":50940803,"html_url":"https://github.com/JabRef/jabref/pull/356","diff_url":"https://github.com/JabRef/jabref/pull/356.diff","patch_url":"https://github.com/JabRef/jabref/pull/356.patch","issue_url":"https://api.github.com/repos/JabRef/jabref/issues/356","number":356,"state":"open","locked":false,"title":"Test for InspecImporter","user":{"login":"mairdl","id":15333533,"avatar_url":"https://avatars.githubusercontent.com/u/15333533?v=3","gravatar_id":"","url":"https://api.github.com/users/mairdl","html_url":"https://github.com/mairdl","followers_url":"https://api.github.com/users/mairdl/followers","following_url":"https://api.github.com/users/mairdl/following{/other_user}","gists_url":"https://api.github.com/users/mairdl/gists{/gist_id}","starred_url":"https://api.github.com/users/mairdl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mairdl/subscriptions","organizations_url":"https://api.github.com/users/mairdl/orgs","repos_url":"https://api.github.com/users/mairdl/repos","events_url":"https://api.github.com/users/mairdl/events{/privacy}","received_events_url":"https://api.github.com/users/mairdl/received_events","type":"User","site_admin":false},"body":"Completed code coverage and discovered a bug in BibtexEntryType (BibtetEntryType.getType() ALL_TYPES.get() returns null)","created_at":"2015-11-17T12:30:59Z","updated_at":"2015-11-19T11:39:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"36f7897474a5d478f93d4718e2f832922ca52ab0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JabRef/jabref/pulls/356/commits","review_comments_url":"https://api.github.com/repos/JabRef/jabref/pulls/356/comments","review_comment_url":"https://api.github.com/repos/JabRef/jabref/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JabRef/jabref/issues/356/comments","statuses_url":"https://api.github.com/repos/JabRef/jabref/statuses/86e515f1317d9f320290ccd39f47ba49ce5112e3","head":{"label":"Braunch:InspecImportTest","ref":"InspecImportTest","sha":"86e515f1317d9f320290ccd39f47ba49ce5112e3","user":{"login":"Braunch","id":15339195,"avatar_url":"https://avatars.githubusercontent.com/u/15339195?v=3","gravatar_id":"","url":"https://api.github.com/users/Braunch","html_url":"https://github.com/Braunch","followers_url":"https://api.github.com/users/Braunch/followers","following_url":"https://api.github.com/users/Braunch/following{/other_user}","gists_url":"https://api.github.com/users/Braunch/gists{/gist_id}","starred_url":"https://api.github.com/users/Braunch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Braunch/subscriptions","organizations_url":"https://api.github.com/users/Braunch/orgs","repos_url":"https://api.github.com/users/Braunch/repos","events_url":"https://api.github.com/users/Braunch/events{/privacy}","received_events_url":"https://api.github.com/users/Braunch/received_events","type":"User","site_admin":false},"repo":{"id":45831498,"name":"jabref","full_name":"Braunch/jabref","owner":{"login":"Braunch","id":15339195,"avatar_url":"https://avatars.githubusercontent.com/u/15339195?v=3","gravatar_id":"","url":"https://api.github.com/users/Braunch","html_url":"https://github.com/Braunch","followers_url":"https://api.github.com/users/Braunch/followers","following_url":"https://api.github.com/users/Braunch/following{/other_user}","gists_url":"https://api.github.com/users/Braunch/gists{/gist_id}","starred_url":"https://api.github.com/users/Braunch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Braunch/subscriptions","organizations_url":"https://api.github.com/users/Braunch/orgs","repos_url":"https://api.github.com/users/Braunch/repos","events_url":"https://api.github.com/users/Braunch/events{/privacy}","received_events_url":"https://api.github.com/users/Braunch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Braunch/jabref","description":"Graphical Java application for managing bibtex (.bib) databases","fork":true,"url":"https://api.github.com/repos/Braunch/jabref","forks_url":"https://api.github.com/repos/Braunch/jabref/forks","keys_url":"https://api.github.com/repos/Braunch/jabref/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Braunch/jabref/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Braunch/jabref/teams","hooks_url":"https://api.github.com/repos/Braunch/jabref/hooks","issue_events_url":"https://api.github.com/repos/Braunch/jabref/issues/events{/number}","events_url":"https://api.github.com/repos/Braunch/jabref/events","assignees_url":"https://api.github.com/repos/Braunch/jabref/assignees{/user}","branches_url":"https://api.github.com/repos/Braunch/jabref/branches{/branch}","tags_url":"https://api.github.com/repos/Braunch/jabref/tags","blobs_url":"https://api.github.com/repos/Braunch/jabref/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Braunch/jabref/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Braunch/jabref/git/refs{/sha}","trees_url":"https://api.github.com/repos/Braunch/jabref/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Braunch/jabref/statuses/{sha}","languages_url":"https://api.github.com/repos/Braunch/jabref/languages","stargazers_url":"https://api.github.com/repos/Braunch/jabref/stargazers","contributors_url":"https://api.github.com/repos/Braunch/jabref/contributors","subscribers_url":"https://api.github.com/repos/Braunch/jabref/subscribers","subscription_url":"https://api.github.com/repos/Braunch/jabref/subscription","commits_url":"https://api.github.com/repos/Braunch/jabref/commits{/sha}","git_commits_url":"https://api.github.com/repos/Braunch/jabref/git/commits{/sha}","comments_url":"https://api.github.com/repos/Braunch/jabref/comments{/number}","issue_comment_url":"https://api.github.com/repos/Braunch/jabref/issues/comments{/number}","contents_url":"https://api.github.com/repos/Braunch/jabref/contents/{+path}","compare_url":"https://api.github.com/repos/Braunch/jabref/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Braunch/jabref/merges","archive_url":"https://api.github.com/repos/Braunch/jabref/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Braunch/jabref/downloads","issues_url":"https://api.github.com/repos/Braunch/jabref/issues{/number}","pulls_url":"https://api.github.com/repos/Braunch/jabref/pulls{/number}","milestones_url":"https://api.github.com/repos/Braunch/jabref/milestones{/number}","notifications_url":"https://api.github.com/repos/Braunch/jabref/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Braunch/jabref/labels{/name}","releases_url":"https://api.github.com/repos/Braunch/jabref/releases{/id}","created_at":"2015-11-09T10:35:39Z","updated_at":"2015-11-09T10:35:47Z","pushed_at":"2015-11-18T15:33:33Z","git_url":"git://github.com/Braunch/jabref.git","ssh_url":"git@github.com:Braunch/jabref.git","clone_url":"https://github.com/Braunch/jabref.git","svn_url":"https://github.com/Braunch/jabref","homepage":"http://jabref.sourceforge.net/","size":64256,"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":"JabRef:master","ref":"master","sha":"cca67a91b98ef6910bf2e134901117996f60aa1d","user":{"login":"JabRef","id":3914421,"avatar_url":"https://avatars.githubusercontent.com/u/3914421?v=3","gravatar_id":"","url":"https://api.github.com/users/JabRef","html_url":"https://github.com/JabRef","followers_url":"https://api.github.com/users/JabRef/followers","following_url":"https://api.github.com/users/JabRef/following{/other_user}","gists_url":"https://api.github.com/users/JabRef/gists{/gist_id}","starred_url":"https://api.github.com/users/JabRef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JabRef/subscriptions","organizations_url":"https://api.github.com/users/JabRef/orgs","repos_url":"https://api.github.com/users/JabRef/repos","events_url":"https://api.github.com/users/JabRef/events{/privacy}","received_events_url":"https://api.github.com/users/JabRef/received_events","type":"Organization","site_admin":false},"repo":{"id":17634071,"name":"jabref","full_name":"JabRef/jabref","owner":{"login":"JabRef","id":3914421,"avatar_url":"https://avatars.githubusercontent.com/u/3914421?v=3","gravatar_id":"","url":"https://api.github.com/users/JabRef","html_url":"https://github.com/JabRef","followers_url":"https://api.github.com/users/JabRef/followers","following_url":"https://api.github.com/users/JabRef/following{/other_user}","gists_url":"https://api.github.com/users/JabRef/gists{/gist_id}","starred_url":"https://api.github.com/users/JabRef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JabRef/subscriptions","organizations_url":"https://api.github.com/users/JabRef/orgs","repos_url":"https://api.github.com/users/JabRef/repos","events_url":"https://api.github.com/users/JabRef/events{/privacy}","received_events_url":"https://api.github.com/users/JabRef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JabRef/jabref","description":"Graphical Java application for managing bibtex (.bib) databases","fork":false,"url":"https://api.github.com/repos/JabRef/jabref","forks_url":"https://api.github.com/repos/JabRef/jabref/forks","keys_url":"https://api.github.com/repos/JabRef/jabref/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JabRef/jabref/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JabRef/jabref/teams","hooks_url":"https://api.github.com/repos/JabRef/jabref/hooks","issue_events_url":"https://api.github.com/repos/JabRef/jabref/issues/events{/number}","events_url":"https://api.github.com/repos/JabRef/jabref/events","assignees_url":"https://api.github.com/repos/JabRef/jabref/assignees{/user}","branches_url":"https://api.github.com/repos/JabRef/jabref/branches{/branch}","tags_url":"https://api.github.com/repos/JabRef/jabref/tags","blobs_url":"https://api.github.com/repos/JabRef/jabref/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JabRef/jabref/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JabRef/jabref/git/refs{/sha}","trees_url":"https://api.github.com/repos/JabRef/jabref/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JabRef/jabref/statuses/{sha}","languages_url":"https://api.github.com/repos/JabRef/jabref/languages","stargazers_url":"https://api.github.com/repos/JabRef/jabref/stargazers","contributors_url":"https://api.github.com/repos/JabRef/jabref/contributors","subscribers_url":"https://api.github.com/repos/JabRef/jabref/subscribers","subscription_url":"https://api.github.com/repos/JabRef/jabref/subscription","commits_url":"https://api.github.com/repos/JabRef/jabref/commits{/sha}","git_commits_url":"https://api.github.com/repos/JabRef/jabref/git/commits{/sha}","comments_url":"https://api.github.com/repos/JabRef/jabref/comments{/number}","issue_comment_url":"https://api.github.com/repos/JabRef/jabref/issues/comments{/number}","contents_url":"https://api.github.com/repos/JabRef/jabref/contents/{+path}","compare_url":"https://api.github.com/repos/JabRef/jabref/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JabRef/jabref/merges","archive_url":"https://api.github.com/repos/JabRef/jabref/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JabRef/jabref/downloads","issues_url":"https://api.github.com/repos/JabRef/jabref/issues{/number}","pulls_url":"https://api.github.com/repos/JabRef/jabref/pulls{/number}","milestones_url":"https://api.github.com/repos/JabRef/jabref/milestones{/number}","notifications_url":"https://api.github.com/repos/JabRef/jabref/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JabRef/jabref/labels{/name}","releases_url":"https://api.github.com/repos/JabRef/jabref/releases{/id}","created_at":"2014-03-11T14:48:42Z","updated_at":"2015-11-17T00:04:41Z","pushed_at":"2015-11-19T11:27:16Z","git_url":"git://github.com/JabRef/jabref.git","ssh_url":"git@github.com:JabRef/jabref.git","clone_url":"https://github.com/JabRef/jabref.git","svn_url":"https://github.com/JabRef/jabref","homepage":"http://jabref.sourceforge.net/","size":71239,"stargazers_count":134,"watchers_count":134,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":125,"mirror_url":null,"open_issues_count":81,"forks":125,"open_issues":81,"watchers":134,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/356"},"html":{"href":"https://github.com/JabRef/jabref/pull/356"},"issue":{"href":"https://api.github.com/repos/JabRef/jabref/issues/356"},"comments":{"href":"https://api.github.com/repos/JabRef/jabref/issues/356/comments"},"review_comments":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/356/comments"},"review_comment":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JabRef/jabref/pulls/356/commits"},"statuses":{"href":"https://api.github.com/repos/JabRef/jabref/statuses/86e515f1317d9f320290ccd39f47ba49ce5112e3"}}}}