diff --git a/.github/workflows/deployment-arm64.yml b/.github/workflows/deployment-arm64.yml index c0a6d1406b4..819256e75b8 100644 --- a/.github/workflows/deployment-arm64.yml +++ b/.github/workflows/deployment-arm64.yml @@ -66,12 +66,12 @@ jobs: submodules: 'true' show-progress: 'false' - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v1.2.0 + uses: gittools/actions/gitversion/setup@v2.0.0 with: versionSpec: "5.x" - name: Run GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v1.2.0 + uses: gittools/actions/gitversion/execute@v2.0.0 - name: Setup JDK uses: actions/setup-java@v4 with: diff --git a/.github/workflows/deployment-jdk-ea.yml b/.github/workflows/deployment-jdk-ea.yml index b60489da7c5..0426e0cb56c 100644 --- a/.github/workflows/deployment-jdk-ea.yml +++ b/.github/workflows/deployment-jdk-ea.yml @@ -84,12 +84,12 @@ jobs: packages: pigz version: 1.0 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v1.2.0 + uses: gittools/actions/gitversion/setup@v2.0.0 with: versionSpec: "5.x" - name: Run GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v1.2.0 + uses: gittools/actions/gitversion/execute@v2.0.0 # JDK - name: 'Set up JDK ${{ matrix.jdk }}' diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index cdfa8d54960..c178c7552e4 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -79,12 +79,12 @@ jobs: packages: pigz version: 1.0 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v1.2.0 + uses: gittools/actions/gitversion/setup@v2.0.0 with: versionSpec: "5.x" - name: Run GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v1.2.0 + uses: gittools/actions/gitversion/execute@v2.0.0 - name: Setup JDK uses: actions/setup-java@v4 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index b37788b3b76..a222f215bfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,13 +17,15 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv ### Changed +- The Pubmed/Medline Plain importer now imports the PMID field as well [#11488](https://github.com/JabRef/jabref/issues/11488) - The 'Check for updates' menu bar button is now always enabled. [#11485](https://github.com/JabRef/jabref/pull/11485) - JabRef respects the [configuration for storing files relative to the .bib file](https://docs.jabref.org/finding-sorting-and-cleaning-entries/filelinks#directories-for-files) in more cases. [#11492](https://github.com/JabRef/jabref/pull/11492) ### Fixed - We fixed an issue where the 'Check for updates' preference was not saved. [#11485](https://github.com/JabRef/jabref/pull/11485) -- We fixed an issue where an exception was thrown after changing "show preview as a tab" in the preferences. [#11509](https://github.com/JabRef/jabref/pull/11509) +- We fixed an issue where an exception was thrown after changing "show preview as a tab" in the preferences. [#11515](https://github.com/JabRef/jabref/pull/11515) +- We fixed an issue where a new unsaved library was not marked with an asterisk [#11519](https://github.com/JabRef/jabref/pull/11519) ### Removed diff --git a/PRIVACY.md b/PRIVACY.md index 08b8c34b138..9a7e6b0390f 100644 --- a/PRIVACY.md +++ b/PRIVACY.md @@ -38,41 +38,42 @@ These third parties may log additional information besides your IP address and t These third-party services are the following: -| Service | Privacy Policy | -|-----------------------------------------------------------------------------------------------------------------|----------------| -| [ACM](https://www.acm.org/) | | -| [ACS Publications](https://pubs.acs.org/) | | -| [APS Advancing Physics](https://harvest.aps.org/) | | -| [arXiv.org](https://arxiv.org/) | | -| [Bibliotheksverbund Bayern](https://www.bib-bvb.de/) | | -| [Biodiversity Heritage Library](https://www.biodiversitylibrary.org/) | | -| [Collection of Computer Science Bibliographies](https://en.wikipedia.org/wiki/Collection_of_Computer_Science_Bibliographies) | **currently unavailable**, offline | -| [CrossRef](https://www.crossref.org/) | | -| [dblp](https://dblp.uni-trier.de/) | | -| [Directory of Open Access Books](https://www.doabooks.org/) | | -| [Digitala Vetenskapliga Arkivet](https://www.diva-portal.org/) | | -| [DOI Foundation](https://www.doi.org/) | | -| [Elsevier](https://www.elsevier.com/) | | -| [Google Scholar](https://scholar.google.com/) | | -| [Gemeinsamer Verbundkatalog](https://www.gbv.de/) | | -| [IACR](https://www.iacr.org/) | | -| [IEEEXplore](https://ieeexplore.ieee.org/Xplore/home.jsp) | | -| [INSPIRE](https://inspirehep.net/) | | -| [JSTOR](https://www.jstor.org/) | | -| [Library of Congress](https://lccn.loc.gov/) | | -| [National Library of Medicine](https://www.ncbi.nlm.nih.gov/) | | -| [MathSciNet](http://www.ams.org/mathscinet) | | -| [mEDRA](https://www.medra.org/) | | -| [Mr. DLib](https://mr-dlib.org/) [1] | | -| [Openlibrary](https://openlibrary.org) | | -| [ResearchGate](https://www.researchgate.net/) | | -| [IETF Datatracker](https://datatracker.ietf.org/) | | -| [Semantic Scholar](https://www.semanticscholar.org/), powered by [Allen Institute for AI](https://allenai.org/) | | -| [Springer Nature](https://dev.springernature.com/) | | -| [The SAO/NASA Astrophysics Data System](https://ui.adsabs.harvard.edu/) | | -| [Unpaywall](https://unpaywall.org/) | | -| [zbMATH Open](https://www.zbmath.org) | | -| [ISIDORE](https://isidore.science/) | | +| Service | Privacy Policy | +|------------------------------------------------------------------------------------------------------------------------------|----------------| +| [ACM](https://www.acm.org/) | | +| [ACS Publications](https://pubs.acs.org/) | | +| [APS Advancing Physics](https://harvest.aps.org/) | | +| [arXiv.org](https://arxiv.org/) | | +| [Bibliotheksverbund Bayern](https://www.bib-bvb.de/) | | +| [Biodiversity Heritage Library](https://www.biodiversitylibrary.org/) | | +| [Collection of Computer Science Bibliographies](https://en.wikipedia.org/wiki/Collection_of_Computer_Science_Bibliographies) | **currently unavailable**, offline | +| [CrossRef](https://www.crossref.org/) | | +| [dblp](https://dblp.uni-trier.de/) | | +| [Directory of Open Access Books](https://www.doabooks.org/) | | +| [Digitala Vetenskapliga Arkivet](https://www.diva-portal.org/) | | +| [DOI Foundation](https://www.doi.org/) | | +| [Elsevier](https://www.elsevier.com/) | | +| [Google Scholar](https://scholar.google.com/) | | +| [Gemeinsamer Verbundkatalog](https://www.gbv.de/) | | +| [IACR](https://www.iacr.org/) | | +| [IEEEXplore](https://ieeexplore.ieee.org/Xplore/home.jsp) | | +| [INSPIRE](https://inspirehep.net/) | | +| [JSTOR](https://www.jstor.org/) | | +| [Library of Congress](https://lccn.loc.gov/) | | +| [National Library of Medicine](https://www.ncbi.nlm.nih.gov/) | | +| [MathSciNet](http://www.ams.org/mathscinet) | | +| [mEDRA](https://www.medra.org/) | | +| [Mr. DLib](https://mr-dlib.org/) [1] | | +| [OpenAI](https://openai.com/) | | +| [Openlibrary](https://openlibrary.org) | | +| [ResearchGate](https://www.researchgate.net/) | | +| [IETF Datatracker](https://datatracker.ietf.org/) | | +| [Semantic Scholar](https://www.semanticscholar.org/), powered by [Allen Institute for AI](https://allenai.org/) | | +| [Springer Nature](https://dev.springernature.com/) | | +| [The SAO/NASA Astrophysics Data System](https://ui.adsabs.harvard.edu/) | | +| [Unpaywall](https://unpaywall.org/) | | +| [zbMATH Open](https://www.zbmath.org) | | +| [ISIDORE](https://isidore.science/) | | [1]: *Note: The Mr. DLib service is used for the related articles tab in the entry editor and collects also your language, your browser and operating system (by default*disabled*).* diff --git a/build.gradle b/build.gradle index 1f1cb0ccfd9..7b393a2c869 100644 --- a/build.gradle +++ b/build.gradle @@ -6,12 +6,12 @@ import org.jabref.build.xjc.XjcTask plugins { id 'application' - id 'com.github.andygoossens.modernizer' version '1.9.2' + id 'com.github.andygoossens.modernizer' version '1.9.3' id 'me.champeau.jmh' version '0.7.2' // This is https://github.com/java9-modularity/gradle-modules-plugin/pull/282 - id 'com.github.koppor.gradle-modules-plugin' version 'jitpack-SNAPSHOT' + id 'com.github.koppor.gradle-modules-plugin' version 'v1.8.15-cmd-1' id 'org.openjfx.javafxplugin' version '0.1.0' @@ -29,7 +29,7 @@ plugins { id 'idea' - id 'org.openrewrite.rewrite' version '6.16.3' + id 'org.openrewrite.rewrite' version '6.16.4' } // Enable following for debugging @@ -134,7 +134,7 @@ dependencyLocking { } javafx { - version = "22.0.1" + version = "22.0.2" modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.web', 'javafx.swing' ] } @@ -166,7 +166,7 @@ dependencies { implementation "org.apache.lucene:lucene-highlighter:$luceneVersion" implementation group: 'org.apache.commons', name: 'commons-csv', version: '1.11.0' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.14.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.15.0' implementation group: 'org.apache.commons', name: 'commons-text', version: '1.12.0' implementation 'commons-logging:commons-logging:1.3.3' implementation 'com.h2database:h2-mvstore:2.2.224' @@ -297,7 +297,7 @@ dependencies { // implementation 'org.glassfish.jersey.media:jersey-media-json-gson:3.1.1' // Because of GraalVM quirks, we need to ship that. See https://github.com/jspecify/jspecify/issues/389#issuecomment-1661130973 for details - implementation 'org.jspecify:jspecify:0.3.0' + implementation 'org.jspecify:jspecify:1.0.0' // parse plist files implementation 'com.googlecode.plist:dd-plist:1.28' diff --git a/src/main/java/org/jabref/gui/LibraryTab.java b/src/main/java/org/jabref/gui/LibraryTab.java index f3eb5d52d03..bd16389dd9c 100644 --- a/src/main/java/org/jabref/gui/LibraryTab.java +++ b/src/main/java/org/jabref/gui/LibraryTab.java @@ -415,13 +415,8 @@ public void updateTabTitle(boolean isChanged) { uniquePathPart.ifPresent(part -> tabTitle.append(" \u2013 ").append(part)); } else { if (databaseLocation == DatabaseLocation.LOCAL) { + tabTitle.append('*'); tabTitle.append(Localization.lang("untitled")); - if (bibDatabaseContext.getDatabase().hasEntries()) { - // if the database is not empty and no file is assigned, - // the database came from an import and has to be treated somehow - // -> mark as changed - tabTitle.append('*'); - } } else { addSharedDbInformation(tabTitle, bibDatabaseContext); addSharedDbInformation(toolTipText, bibDatabaseContext); diff --git a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java index 5d39ab56ffe..5d758895069 100644 --- a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java +++ b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java @@ -147,6 +147,12 @@ public EntryEditor(LibraryTab libraryTab, UndoAction undoAction, RedoAction redo activeTab.notifyAboutFocus(currentlyEditedEntry); } }); + EasyBind.listen(preferencesService.getPreviewPreferences().showPreviewAsExtraTabProperty(), + (obs, oldValue, newValue) -> { + if (currentlyEditedEntry != null) { + adaptVisibleTabs(); + } + }); } private void setupDragAndDrop(LibraryTab libraryTab) { @@ -384,9 +390,6 @@ public void setCurrentlyEditedEntry(BibEntry currentlyEditedEntry) { getSelectedTab().notifyAboutFocus(currentlyEditedEntry); }); - EasyBind.listen(preferencesService.getPreviewPreferences().showPreviewAsExtraTabProperty(), - (obs, oldValue, newValue) -> adaptVisibleTabs()); - adaptVisibleTabs(); setupToolBar(); diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java index c66aef80d45..d383377bd12 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java @@ -149,6 +149,7 @@ public ParserResult importDatabase(BufferedReader reader) throws IOException { // store the fields in a map Map hashMap = new HashMap<>(); + hashMap.put("PMID", StandardField.PMID); hashMap.put("PG", StandardField.PAGES); hashMap.put("PL", StandardField.ADDRESS); hashMap.put("PHST", new UnknownField("history")); diff --git a/src/main/resources/csl-styles b/src/main/resources/csl-styles index fd6cb3e8176..bf2926b71a9 160000 --- a/src/main/resources/csl-styles +++ b/src/main/resources/csl-styles @@ -1 +1 @@ -Subproject commit fd6cb3e81762055d107839c3c288c359985f81c8 +Subproject commit bf2926b71a969644ce735760977d1246aed1f2e2 diff --git a/src/main/resources/l10n/JabRef_de.properties b/src/main/resources/l10n/JabRef_de.properties index 207c81d4115..682888da361 100644 --- a/src/main/resources/l10n/JabRef_de.properties +++ b/src/main/resources/l10n/JabRef_de.properties @@ -503,7 +503,6 @@ Docs\ (This\ Year)=Dokumente (Dieses Jahr) Incorrect\ ISSN\ format=Ungültiges ISSN-Format Error\ accessing\ catalog=Fehler beim Katalogzugriff -Check\ for\ latest\ version\ online=Prüfe online auf die neueste Version If\ you\ encounter\ an\ issue\ or\ a\ bug,\ please\ check\ the\ latest\ version,\ whether\ the\ issue\ is\ still\ present.=Wenn Sie auf ein Problem oder einen Fehler stoßen, testen Sie bitte die neueste Version und prüfen, ob das Problem noch vorhanden ist. Keep\ both=Beide behalten diff --git a/src/main/resources/l10n/JabRef_es.properties b/src/main/resources/l10n/JabRef_es.properties index 168f2b2431b..01e29a5d80d 100644 --- a/src/main/resources/l10n/JabRef_es.properties +++ b/src/main/resources/l10n/JabRef_es.properties @@ -486,7 +486,6 @@ Docs\ (This\ Year)=Documentos (Este Año) Incorrect\ ISSN\ format=Formato ISSN incorrecto Error\ accessing\ catalog=Error al acceder al catálogo -Check\ for\ latest\ version\ online=Busque la última versión en línea Keep\ both=Mantener ambos diff --git a/src/main/resources/l10n/JabRef_fr.properties b/src/main/resources/l10n/JabRef_fr.properties index 2e289c7066f..c3c2a190bff 100644 --- a/src/main/resources/l10n/JabRef_fr.properties +++ b/src/main/resources/l10n/JabRef_fr.properties @@ -503,7 +503,7 @@ Docs\ (This\ Year)=Documents (cette année) Incorrect\ ISSN\ format=Format ISSN incorrect Error\ accessing\ catalog=Erreur d'accès au catalogue -Check\ for\ latest\ version\ online=Vérifier en ligne la dernière version +Check\ for\ updates\ on\ startup=Vérifier les mises à jour au démarrage If\ you\ encounter\ an\ issue\ or\ a\ bug,\ please\ check\ the\ latest\ version,\ whether\ the\ issue\ is\ still\ present.=Si vous rencontrez un problème ou un bug, veuillez vérifier que le problème est toujours présent avec la dernière version. Keep\ both=Conserver les deux diff --git a/src/main/resources/l10n/JabRef_it.properties b/src/main/resources/l10n/JabRef_it.properties index 9f4756feb2b..4bbe5813aa3 100644 --- a/src/main/resources/l10n/JabRef_it.properties +++ b/src/main/resources/l10n/JabRef_it.properties @@ -503,7 +503,7 @@ Docs\ (This\ Year)=Documenti (questo anno) Incorrect\ ISSN\ format=Formato ISSN non corretto Error\ accessing\ catalog=Errore nell'accedere al catalogo -Check\ for\ latest\ version\ online=Controlla l'ultima versione online +Check\ for\ updates\ on\ startup=Controlla gli aggiornamenti all'avvio If\ you\ encounter\ an\ issue\ or\ a\ bug,\ please\ check\ the\ latest\ version,\ whether\ the\ issue\ is\ still\ present.=Se si verifica un problema o un bug, si prega di controllare l'ultima versione, se il problema è ancora presente. Keep\ both=Mantieni entrambi diff --git a/src/main/resources/l10n/JabRef_nl.properties b/src/main/resources/l10n/JabRef_nl.properties index 34f2db234a4..bdaca802774 100644 --- a/src/main/resources/l10n/JabRef_nl.properties +++ b/src/main/resources/l10n/JabRef_nl.properties @@ -473,7 +473,6 @@ Docs\ (This\ Year)=Documentatie (Dit Jaar) Incorrect\ ISSN\ format=Onjuist ISSN-formaat Error\ accessing\ catalog=Fout bij toegang tot catalogus -Check\ for\ latest\ version\ online=Controleer op de nieuwste online versie Keep\ both=Beide behouden diff --git a/src/main/resources/l10n/JabRef_pl.properties b/src/main/resources/l10n/JabRef_pl.properties index e0c424977aa..307d0aab53e 100644 --- a/src/main/resources/l10n/JabRef_pl.properties +++ b/src/main/resources/l10n/JabRef_pl.properties @@ -472,7 +472,7 @@ Docs\ (This\ Year)=Dokumenty (bieżący rok) Incorrect\ ISSN\ format=Nieprawidłowy format ISSN Error\ accessing\ catalog=Błąd dostępu do katalogu -Check\ for\ latest\ version\ online=Sprawdź najnowszą wersję online +Check\ for\ updates\ on\ startup=Sprawdź aktualizacje przy starcie If\ you\ encounter\ an\ issue\ or\ a\ bug,\ please\ check\ the\ latest\ version,\ whether\ the\ issue\ is\ still\ present.=Jeśli napotkasz problem lub błąd, sprawdź w najnowszej wersję, czy problem nadal występuje. Keep\ both=Zachowaj oba diff --git a/src/main/resources/l10n/JabRef_pt_BR.properties b/src/main/resources/l10n/JabRef_pt_BR.properties index 079f57ad291..d68182b4de5 100644 --- a/src/main/resources/l10n/JabRef_pt_BR.properties +++ b/src/main/resources/l10n/JabRef_pt_BR.properties @@ -503,7 +503,7 @@ Docs\ (This\ Year)=Documentos (Neste Ano) Incorrect\ ISSN\ format=Formato de ISSN incorreto Error\ accessing\ catalog=Erro ao acessar catálogo -Check\ for\ latest\ version\ online=Verificar a versão mais recente on-line +Check\ for\ updates\ on\ startup=Verificar se há atualizações na inicialização If\ you\ encounter\ an\ issue\ or\ a\ bug,\ please\ check\ the\ latest\ version,\ whether\ the\ issue\ is\ still\ present.=Se você encontrar um problema ou um bug, verifique a versão mais recente, se o problema ainda está presente. Keep\ both=Manter ambos diff --git a/src/main/resources/l10n/JabRef_tr.properties b/src/main/resources/l10n/JabRef_tr.properties index 4cbbac48496..74c64e7d41c 100644 --- a/src/main/resources/l10n/JabRef_tr.properties +++ b/src/main/resources/l10n/JabRef_tr.properties @@ -481,7 +481,6 @@ Docs\ (This\ Year)=Belgeler (Bu Yıl) Incorrect\ ISSN\ format=Yanlış ISSN biçemi Error\ accessing\ catalog=Kataloğa erişimde hata -Check\ for\ latest\ version\ online=En son çevrimiçi sürümü kontrol et If\ you\ encounter\ an\ issue\ or\ a\ bug,\ please\ check\ the\ latest\ version,\ whether\ the\ issue\ is\ still\ present.=Eğer bir sorun ya da yazılım hatasıyla karşılaşırsanız, hala var olup olmadığını en son sürümle kontrol ediniz. Keep\ both=İkisini de tut diff --git a/src/main/resources/l10n/JabRef_zh_CN.properties b/src/main/resources/l10n/JabRef_zh_CN.properties index 77d0d5d97fb..924fe737a26 100644 --- a/src/main/resources/l10n/JabRef_zh_CN.properties +++ b/src/main/resources/l10n/JabRef_zh_CN.properties @@ -466,7 +466,6 @@ h-index=h-index Error\ while\ fetching\ journal\ information\:\ %0=获取期刊信息时出错: %0 Incorrect\ ISSN\ format=不正确的 ISSN 格式 -Check\ for\ latest\ version\ online=在线检查最新版本 Keep\ both=保留全部 diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java index 0ac32eb8cc6..7871ef805b1 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java @@ -117,11 +117,13 @@ void importMultipleEntriesInSingleFile() throws IOException, URISyntaxException assertEquals(Optional.of("Inproceedings book title"), testEntry.getField(StandardField.BOOKTITLE)); BibEntry expectedEntry5 = new BibEntry(StandardEntryType.Proceedings) - .withField(StandardField.KEYWORDS, "Female"); + .withField(StandardField.KEYWORDS, "Female") + .withField(StandardField.PMID, "96578310"); assertEquals(expectedEntry5, entries.get(5)); BibEntry expectedEntry6 = new BibEntry(StandardEntryType.Misc) - .withField(StandardField.KEYWORDS, "Female"); + .withField(StandardField.KEYWORDS, "Female") + .withField(StandardField.PMID, "45984220"); assertEquals(expectedEntry6, entries.get(6)); } @@ -158,19 +160,49 @@ private void assertImportOfMedlineFileEqualsBibtexFile(String medlineFile, Strin @Test void multiLineComments() throws IOException { - try (BufferedReader reader = readerForString("PMID-22664220" + "\n" + "CON - Comment1" + "\n" + "CIN - Comment2" - + "\n" + "EIN - Comment3" + "\n" + "EFR - Comment4" + "\n" + "CRI - Comment5" + "\n" + "CRF - Comment6" - + "\n" + "PRIN- Comment7" + "\n" + "PROF- Comment8" + "\n" + "RPI - Comment9" + "\n" + "RPF - Comment10" - + "\n" + "RIN - Comment11" + "\n" + "ROF - Comment12" + "\n" + "UIN - Comment13" + "\n" - + "UOF - Comment14" + "\n" + "SPIN- Comment15" + "\n" + "ORI - Comment16")) { + try (BufferedReader reader = readerForString(""" + PMID-22664220 + CON - Comment1 + CIN - Comment2\ + + EIN - Comment3 + EFR - Comment4 + CRI - Comment5 + CRF - Comment6\ + + PRIN- Comment7 + PROF- Comment8 + RPI - Comment9 + RPF - Comment10\ + + RIN - Comment11 + ROF - Comment12 + UIN - Comment13 + UOF - Comment14 + SPIN- Comment15 + ORI - Comment16""")) { List actualEntries = importer.importDatabase(reader).getDatabase().getEntries(); BibEntry expectedEntry = new BibEntry(); + expectedEntry.setField(StandardField.PMID, "22664220"); expectedEntry.setField(StandardField.COMMENT, - "Comment1" + "\n" + "Comment2" + "\n" + "Comment3" + "\n" + "Comment4" + "\n" + "Comment5" + "\n" - + "Comment6" + "\n" + "Comment7" + "\n" + "Comment8" + "\n" + "Comment9" + "\n" - + "Comment10" + "\n" + "Comment11" + "\n" + "Comment12" + "\n" + "Comment13" + "\n" - + "Comment14" + "\n" + "Comment15" + "\n" + "Comment16"); + """ + Comment1 + Comment2 + Comment3 + Comment4 + Comment5 + Comment6 + Comment7 + Comment8 + Comment9 + Comment10 + Comment11 + Comment12 + Comment13 + Comment14 + Comment15 + Comment16"""); assertEquals(Collections.singletonList(expectedEntry), actualEntries); } } @@ -184,6 +216,7 @@ void keyWords() throws IOException { List actualEntries = importer.importDatabase(reader).getDatabase().getEntries(); BibEntry expectedEntry = new BibEntry(); + expectedEntry.setField(StandardField.PMID, "22664795"); expectedEntry.setField(StandardField.KEYWORDS, "Female, Male"); assertEquals(Collections.singletonList(expectedEntry), actualEntries); @@ -200,7 +233,7 @@ void withNbibFile() throws IOException, URISyntaxException { } @Test - void withMultipleEntries() throws IOException, URISyntaxException { + void withMultipleEntriesInvalidFormat() throws IOException, URISyntaxException { Path file = Path.of(MedlinePlainImporter.class.getResource("MedlinePlainImporterStringOutOfBounds.txt").toURI()); List entries = importer.importDatabase(file).getDatabase().getEntries(); @@ -229,14 +262,20 @@ void nullReader() throws IOException { @Test void allArticleTypes() throws IOException { - try (BufferedReader reader = readerForString("PMID-22664795" + "\n" + "MH - Female\n" + "PT - journal article" - + "\n" + "PT - classical article" + "\n" + "PT - corrected and republished article" + "\n" - + "PT - introductory journal article" + "\n" + "PT - newspaper article")) { + try (BufferedReader reader = readerForString(""" + PMID-22664795 + MH - Female + PT - journal article\ + + PT - classical article + PT - corrected and republished article + PT - introductory journal article + PT - newspaper article""")) { List actualEntries = importer.importDatabase(reader).getDatabase().getEntries(); - BibEntry expectedEntry = new BibEntry(); - expectedEntry.setType(StandardEntryType.Article); - expectedEntry.setField(StandardField.KEYWORDS, "Female"); + BibEntry expectedEntry = new BibEntry(StandardEntryType.Article) + .withField(StandardField.KEYWORDS, "Female") + .withField(StandardField.PMID, "22664795"); assertEquals(Collections.singletonList(expectedEntry), actualEntries); } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterStringOutOfBounds.bib b/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterStringOutOfBounds.bib index cf5f8e920e8..74631a03b1f 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterStringOutOfBounds.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterStringOutOfBounds.bib @@ -1,6 +1,9 @@ @misc{, - title = {This is a test title} + title = {This is a test title}, + pmid = {27433151 SO invalid line}, + } @misc{, - title = {This is also a test title} + title = {This is also a test title}, + pmid = {27394443 SO- another invalid line}, } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterTestCompleteEntry.bib b/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterTestCompleteEntry.bib index 02ebcde0152..c1cd9983aeb 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterTestCompleteEntry.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterTestCompleteEntry.bib @@ -15,6 +15,7 @@ @article{ other-id = {NLM: PMC4513071}, owner = {NLM}, pages = {454-81}, + pmid = {20481061}, print-issn = {0955-2359}, publication-status = {ppublish}, revised = {20150731}, diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterTestDOI.bib b/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterTestDOI.bib index c4e061c9f3d..8b18625dd22 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterTestDOI.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterTestDOI.bib @@ -1,3 +1,4 @@ @TechReport{, - doi = {10.1016/j.cpr.2005.02.002} + doi = {10.1016/j.cpr.2005.02.002}, + pmid = {22664220}, } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterTestInproceeding.bib b/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterTestInproceeding.bib index 27745e9c3ec..5ffa3dcd3fb 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterTestInproceeding.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/MedlinePlainImporterTestInproceeding.bib @@ -1,3 +1,5 @@ @InProceedings{, - Booktitle = {Inproceedings book title} + Booktitle = {Inproceedings book title}, + pmid = {22664238}, + } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/NbibImporterTest.bib b/src/test/resources/org/jabref/logic/importer/fileformat/NbibImporterTest.bib index f8f7210461f..81b3427c506 100644 --- a/src/test/resources/org/jabref/logic/importer/fileformat/NbibImporterTest.bib +++ b/src/test/resources/org/jabref/logic/importer/fileformat/NbibImporterTest.bib @@ -29,6 +29,7 @@ @article{ other-abstract = {other abstract infos}, owner = {NLM}, pages = {67}, + pmid = {27169098}, publication-status = {epublish}, registry-number = {123456789}, second-id = {12563},