From df7aa34fe7309d8b70990d291a9307e3ade8a696 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 26 Nov 2018 07:26:54 +0100 Subject: [PATCH 1/8] Bump junit-platform-launcher from 1.3.1 to 1.3.2 (#4515) Bumps [junit-platform-launcher](https://github.com/junit-team/junit5) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/commits) Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6913fab8cc0..0e12af5d982 100644 --- a/build.gradle +++ b/build.gradle @@ -164,7 +164,7 @@ dependencies { testCompile 'org.junit.jupiter:junit-jupiter-params:5.3.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1' testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.1' - testCompile 'org.junit.platform:junit-platform-launcher:1.3.1' + testCompile 'org.junit.platform:junit-platform-launcher:1.3.2' testCompile 'org.junit-pioneer:junit-pioneer:0.3.0' testRuntime 'org.apache.logging.log4j:log4j-core:2.11.1' testRuntime 'org.apache.logging.log4j:log4j-jul:2.11.1' From 72adcdd9569057d015340c45b9ddf954e352abd0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 26 Nov 2018 07:27:04 +0100 Subject: [PATCH 2/8] Bump junit-jupiter-api from 5.3.1 to 5.3.2 (#4510) Bumps [junit-jupiter-api](https://github.com/junit-team/junit5) from 5.3.1 to 5.3.2. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.3.1...r5.3.2) Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 0e12af5d982..70405f0931d 100644 --- a/build.gradle +++ b/build.gradle @@ -160,7 +160,7 @@ dependencies { compile group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '2.2.1' compile group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.2.1' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.2' testCompile 'org.junit.jupiter:junit-jupiter-params:5.3.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1' testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.1' From 4048cb3aa4fe3fc8483e3a07e182143a3b537c89 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 26 Nov 2018 07:28:31 +0100 Subject: [PATCH 3/8] Bump richtextfx from 0.9.1 to 0.9.2 (#4512) Bumps [richtextfx](https://github.com/FXMisc/RichTextFX) from 0.9.1 to 0.9.2. - [Release notes](https://github.com/FXMisc/RichTextFX/releases) - [Changelog](https://github.com/FXMisc/RichTextFX/blob/master/CHANGELOG.md) - [Commits](https://github.com/FXMisc/RichTextFX/compare/v0.9.1...v0.9.2) Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 70405f0931d..16454f8b502 100644 --- a/build.gradle +++ b/build.gradle @@ -133,7 +133,7 @@ dependencies { compile 'de.saxsys:mvvmfx:1.7.0' compile 'org.fxmisc.easybind:easybind:1.0.3' compile 'org.fxmisc.flowless:flowless:0.6.1' - compile 'org.fxmisc.richtext:richtextfx:0.9.1' + compile 'org.fxmisc.richtext:richtextfx:0.9.2' compile 'com.sibvisions.external.jvxfx:dndtabpane:0.1' compile 'javax.inject:javax.inject:1' compile 'com.jfoenix:jfoenix:8.0.7' From 3feaf7bd8e8d045293f34e0057b101bf4b55720e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 26 Nov 2018 07:29:16 +0100 Subject: [PATCH 4/8] Bump junit-jupiter-engine from 5.3.1 to 5.3.2 (#4513) Bumps [junit-jupiter-engine](https://github.com/junit-team/junit5) from 5.3.1 to 5.3.2. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.3.1...r5.3.2) Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 16454f8b502..e0ca3da86d2 100644 --- a/build.gradle +++ b/build.gradle @@ -162,7 +162,7 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.2' testCompile 'org.junit.jupiter:junit-jupiter-params:5.3.1' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.2' testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.1' testCompile 'org.junit.platform:junit-platform-launcher:1.3.2' testCompile 'org.junit-pioneer:junit-pioneer:0.3.0' From 0cb4907f77e06d992d332203322ba3bf4ad38bc2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 26 Nov 2018 07:30:41 +0100 Subject: [PATCH 5/8] Bump junit-vintage-engine from 5.3.1 to 5.3.2 (#4511) Bumps [junit-vintage-engine](https://github.com/junit-team/junit5) from 5.3.1 to 5.3.2. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.3.1...r5.3.2) Signed-off-by: dependabot[bot] --- build.gradle | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index e0ca3da86d2..2da6e7d1afd 100644 --- a/build.gradle +++ b/build.gradle @@ -161,10 +161,11 @@ dependencies { compile group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.2.1' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.2' - testCompile 'org.junit.jupiter:junit-jupiter-params:5.3.1' + testCompile 'org.junit.jupiter:junit-jupiter-params:5.3.2' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.2' - testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.1' + testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.2' testCompile 'org.junit.platform:junit-platform-launcher:1.3.2' + testCompile 'org.junit-pioneer:junit-pioneer:0.3.0' testRuntime 'org.apache.logging.log4j:log4j-core:2.11.1' testRuntime 'org.apache.logging.log4j:log4j-jul:2.11.1' From 89d4d745ca73543b22e0ac9347b243f1fa0b7a23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 26 Nov 2018 07:31:48 +0100 Subject: [PATCH 6/8] Bump junit-jupiter-params from 5.3.1 to 5.3.2 (#4514) Bumps [junit-jupiter-params](https://github.com/junit-team/junit5) from 5.3.1 to 5.3.2. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.3.1...r5.3.2) Signed-off-by: dependabot[bot] From 37be33450b56d72750e1e9957ccc19b5efb696c6 Mon Sep 17 00:00:00 2001 From: Ali Date: Thu, 29 Nov 2018 13:35:50 +0600 Subject: [PATCH 7/8] Create test (#4518) * refactor and create test for SaveAllAction * refactor code * refactor code SaveAllAction * change test name * use Paths.get instead of new File --- .../jabref/gui/exporter/SaveAllAction.java | 19 +++-- .../gui/exporter/SaveAllActionTest.java | 77 +++++++++++++++++++ 2 files changed, 89 insertions(+), 7 deletions(-) create mode 100644 src/test/java/org/jabref/gui/exporter/SaveAllActionTest.java diff --git a/src/main/java/org/jabref/gui/exporter/SaveAllAction.java b/src/main/java/org/jabref/gui/exporter/SaveAllAction.java index 7a58e2895b4..4ac5618f991 100644 --- a/src/main/java/org/jabref/gui/exporter/SaveAllAction.java +++ b/src/main/java/org/jabref/gui/exporter/SaveAllAction.java @@ -1,6 +1,7 @@ package org.jabref.gui.exporter; import org.jabref.gui.BasePanel; +import org.jabref.gui.DialogService; import org.jabref.gui.JabRefFrame; import org.jabref.gui.actions.Actions; import org.jabref.gui.actions.SimpleCommand; @@ -9,23 +10,27 @@ public class SaveAllAction extends SimpleCommand { private final JabRefFrame frame; + private final DialogService dialogService; public SaveAllAction(JabRefFrame frame) { this.frame = frame; + this.dialogService = frame.getDialogService(); } @Override public void execute() { - frame.output(Localization.lang("Saving all libraries...")); + dialogService.notify(Localization.lang("Saving all libraries...")); + for (BasePanel panel : frame.getBasePanelList()) { if (!panel.getBibDatabaseContext().getDatabasePath().isPresent()) { - frame.showBasePanel(panel); - - // TODO: Ask for path + //It will ask a path before saving. + panel.runCommand(Actions.SAVE_AS); + } else { + panel.runCommand(Actions.SAVE); + // TODO: can we find out whether the save was actually done or not? } - panel.runCommand(Actions.SAVE); - // TODO: can we find out whether the save was actually done or not? } - frame.output(Localization.lang("Save all finished.")); + + dialogService.notify(Localization.lang("Save all finished.")); } } diff --git a/src/test/java/org/jabref/gui/exporter/SaveAllActionTest.java b/src/test/java/org/jabref/gui/exporter/SaveAllActionTest.java new file mode 100644 index 00000000000..1233d14a72f --- /dev/null +++ b/src/test/java/org/jabref/gui/exporter/SaveAllActionTest.java @@ -0,0 +1,77 @@ +package org.jabref.gui.exporter; + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.Optional; + +import org.jabref.gui.BasePanel; +import org.jabref.gui.DialogService; +import org.jabref.gui.JabRefFrame; +import org.jabref.gui.actions.Actions; +import org.jabref.logic.l10n.Localization; +import org.jabref.model.database.BibDatabaseContext; + +import org.junit.Before; +import org.junit.Test; + +import static org.mockito.Mockito.anyString; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +public class SaveAllActionTest { + + private BasePanel firstPanel = mock(BasePanel.class); + private BasePanel secondPanel = mock(BasePanel.class); + private JabRefFrame jabRefFrame = mock(JabRefFrame.class); + private DialogService dialogService = mock(DialogService.class); + private BibDatabaseContext bibDatabaseContext = mock(BibDatabaseContext.class); + private Optional databasePath = Optional.of(Paths.get("C:\\Users\\John_Doe\\Jabref")); + private SaveAllAction saveAllAction; + + @Before + public void setUp() { + when(firstPanel.getBibDatabaseContext()).thenReturn(bibDatabaseContext); + when(secondPanel.getBibDatabaseContext()).thenReturn(bibDatabaseContext); + when(bibDatabaseContext.getDatabasePath()).thenReturn(databasePath); + + when(jabRefFrame.getBasePanelList()).thenReturn(Arrays.asList(firstPanel, secondPanel)); + when(jabRefFrame.getDialogService()).thenReturn(dialogService); + + saveAllAction = new SaveAllAction(jabRefFrame); + } + + @Test + public void executeShouldRunSaveCommandInEveryPanel() { + doNothing().when(dialogService).notify(anyString()); + + saveAllAction.execute(); + + verify(firstPanel, times(1)).runCommand(Actions.SAVE); + verify(secondPanel, times(1)).runCommand(Actions.SAVE); + } + + @Test + public void executeShouldNotifyAboutSavingProcess() { + when(bibDatabaseContext.getDatabasePath()).thenReturn(databasePath); + + saveAllAction.execute(); + + verify(dialogService, times(1)).notify(Localization.lang("Saving all libraries...")); + verify(dialogService, times(1)).notify(Localization.lang("Save all finished.")); + } + + @Test + public void executeShouldShowSaveAsWindowIfDatabaseNotSelected() { + when(bibDatabaseContext.getDatabasePath()).thenReturn(Optional.empty()); + doNothing().when(dialogService).notify(anyString()); + + saveAllAction.execute(); + + verify(firstPanel, times(1)).runCommand(Actions.SAVE_AS); + verify(secondPanel, times(1)).runCommand(Actions.SAVE_AS); + } +} From 65a1a03b93a5d9c7d27018adfae431a1d5988d3f Mon Sep 17 00:00:00 2001 From: Dominik Schrempf Date: Fri, 30 Nov 2018 21:40:43 +0100 Subject: [PATCH 8/8] Correct PNAS abbrev. (#4524) * Correct PNAS abbrev. * Use long name, PNAS seems non-standard. --- src/main/resources/journals/journalList.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/journals/journalList.txt b/src/main/resources/journals/journalList.txt index cdb5e36ab78..167a87d8290 100644 --- a/src/main/resources/journals/journalList.txt +++ b/src/main/resources/journals/journalList.txt @@ -12215,7 +12215,7 @@ Proceedings of the Koninklijke Nederlandse Akademie Van Wetenschappen. Series C: Proceedings of the Latvian Academy of Sciences, Section B: Natural, Exact and Applied Sciences = Proc. Latv. Acad. Sci. Sect. B Proceedings of the Mine Medical Officers Association = Proc. Mine Med. Off. Assoc. Proceedings of the Mine Medical Officers Association of SA = Proc. Mine Med. Off. Assoc. SA -Proceedings of the National academy of Sciences of the United States of America = Proc. Natl. Acad. Sci. U.S.A. +Proceedings of the National Academy of Sciences of the United States of America = Proc. Natl. Acad. Sci. U.S.A. Proceedings of the National Cancer Conference = Proc. Natl. Cancer Conf. Proceedings of the National Science Council, Republic of China. Part B, Life Sciences = Proc. Natl. Sci. Counc. Repub. China B Proceedings of the Nutrition Society = Proc. Nutr. Soc.