diff --git a/rewrite.yml b/rewrite.yml index c5786acfe5b..709e0b15761 100644 --- a/rewrite.yml +++ b/rewrite.yml @@ -199,5 +199,6 @@ recipeList: - org.openrewrite.staticanalysis.WhileInsteadOfFor # - org.openrewrite.staticanalysis.WriteOctalValuesAsDecimal + - org.openrewrite.java.testing.cleanup.RemoveTestPrefix - org.openrewrite.java.testing.junit5.CleanupAssertions # - org.openrewrite.java.testing.junit5.JUnit5BestPractices diff --git a/src/test/java/org/jabref/IconsPropertiesTest.java b/src/test/java/org/jabref/IconsPropertiesTest.java index c330ca4a1fe..e37e2f63533 100644 --- a/src/test/java/org/jabref/IconsPropertiesTest.java +++ b/src/test/java/org/jabref/IconsPropertiesTest.java @@ -20,7 +20,7 @@ public class IconsPropertiesTest { @Test - public void testExistenceOfIconImagesReferencedFromIconsProperties() throws IOException { + public void existenceOfIconImagesReferencedFromIconsProperties() throws IOException { String folder = "src/main/resources/images/external"; String iconsProperties = "Icons.properties"; String iconsPropertiesPath = "src/main/resources/images/" + iconsProperties; diff --git a/src/test/java/org/jabref/cli/ArgumentProcessorTest.java b/src/test/java/org/jabref/cli/ArgumentProcessorTest.java index 55c9520b30a..a74063b9a01 100644 --- a/src/test/java/org/jabref/cli/ArgumentProcessorTest.java +++ b/src/test/java/org/jabref/cli/ArgumentProcessorTest.java @@ -54,7 +54,7 @@ void setup() { } @Test - void testAuxImport(@TempDir Path tempDir) throws Exception { + void auxImport(@TempDir Path tempDir) throws Exception { String auxFile = Path.of(AuxCommandLineTest.class.getResource("paper.aux").toURI()).toAbsolutePath().toString(); String originBib = Path.of(AuxCommandLineTest.class.getResource("origin.bib").toURI()).toAbsolutePath().toString(); @@ -75,7 +75,7 @@ void testAuxImport(@TempDir Path tempDir) throws Exception { } @Test - void testExportMatches(@TempDir Path tempDir) throws Exception { + void exportMatches(@TempDir Path tempDir) throws Exception { Path originBib = Path.of(Objects.requireNonNull(ArgumentProcessorTest.class.getResource("origin.bib")).toURI()); String originBibFile = originBib.toAbsolutePath().toString(); diff --git a/src/test/java/org/jabref/gui/autocompleter/AppendPersonNamesStrategyTest.java b/src/test/java/org/jabref/gui/autocompleter/AppendPersonNamesStrategyTest.java index e4acf04061d..57f6c09b548 100644 --- a/src/test/java/org/jabref/gui/autocompleter/AppendPersonNamesStrategyTest.java +++ b/src/test/java/org/jabref/gui/autocompleter/AppendPersonNamesStrategyTest.java @@ -9,7 +9,7 @@ public class AppendPersonNamesStrategyTest { @Test - void testWithoutParam() { + void withoutParam() { AppendPersonNamesStrategy strategy = new AppendPersonNamesStrategy(); assertEquals(" and ", strategy.getDelimiter()); } @@ -19,7 +19,7 @@ void testWithoutParam() { "TRUE, ' '", "FALSE, ' and '", }) - void testWithParam(boolean separationBySpace, String expectedResult) { + void withParam(boolean separationBySpace, String expectedResult) { AppendPersonNamesStrategy strategy = new AppendPersonNamesStrategy(separationBySpace); assertEquals(expectedResult, strategy.getDelimiter()); } diff --git a/src/test/java/org/jabref/gui/autocompleter/PersonNameStringConverterTest.java b/src/test/java/org/jabref/gui/autocompleter/PersonNameStringConverterTest.java index e1fdff0f8b1..44408b0df4d 100644 --- a/src/test/java/org/jabref/gui/autocompleter/PersonNameStringConverterTest.java +++ b/src/test/java/org/jabref/gui/autocompleter/PersonNameStringConverterTest.java @@ -38,7 +38,7 @@ void setUp() { "FALSE, TRUE, BOTH, 'Reagle, Jr., J. M.'", "FALSE, FALSE, BOTH, 'Reagle'" }) - void testToStringWithoutAutoCompletePreferences(boolean autoCompFF, boolean autoCompLF, AutoCompleteFirstNameMode autoCompleteFirstNameMode, String expectedResult) { + void toStringWithoutAutoCompletePreferences(boolean autoCompFF, boolean autoCompLF, AutoCompleteFirstNameMode autoCompleteFirstNameMode, String expectedResult) { PersonNameStringConverter converter = new PersonNameStringConverter(autoCompFF, autoCompLF, autoCompleteFirstNameMode); String formattedStr = converter.toString(author); assertEquals(expectedResult, formattedStr); @@ -58,7 +58,7 @@ void testToStringWithoutAutoCompletePreferences(boolean autoCompFF, boolean auto "TRUE, ONLY_ABBREVIATED, BOTH, 'Reagle, Jr., J. M.'", "TRUE, BOTH, BOTH, 'Reagle, Jr., J. M.'" }) - void testToStringWithAutoCompletePreferences(boolean shouldAutoComplete, + void toStringWithAutoCompletePreferences(boolean shouldAutoComplete, AutoCompleteFirstNameMode firstNameMode, AutoCompletePreferences.NameFormat nameFormat, String expectedResult) { diff --git a/src/test/java/org/jabref/gui/autocompleter/SuggestionProvidersTest.java b/src/test/java/org/jabref/gui/autocompleter/SuggestionProvidersTest.java index 247ee476fd8..79459a8c5b7 100644 --- a/src/test/java/org/jabref/gui/autocompleter/SuggestionProvidersTest.java +++ b/src/test/java/org/jabref/gui/autocompleter/SuggestionProvidersTest.java @@ -57,7 +57,7 @@ private static Stream getTestPairs() { @ParameterizedTest @MethodSource("getTestPairs") - public void testAppropriateCompleterReturned(Class> expected, Field field) { + public void appropriateCompleterReturned(Class> expected, Field field) { assertEquals(expected, suggestionProviders.getForField(field).getClass()); } diff --git a/src/test/java/org/jabref/gui/edit/CopyMoreActionTest.java b/src/test/java/org/jabref/gui/edit/CopyMoreActionTest.java index ba3c8465be1..7d8b0b2733d 100644 --- a/src/test/java/org/jabref/gui/edit/CopyMoreActionTest.java +++ b/src/test/java/org/jabref/gui/edit/CopyMoreActionTest.java @@ -67,7 +67,7 @@ public void setUp() { } @Test - public void testExecuteOnFail() { + public void executeOnFail() { when(stateManager.getActiveDatabase()).thenReturn(Optional.empty()); when(stateManager.getSelectedEntries()).thenReturn(FXCollections.emptyObservableList()); copyMoreAction = new CopyMoreAction(StandardActions.COPY_TITLE, dialogService, stateManager, clipBoardManager, preferencesService, abbreviationRepository); @@ -78,7 +78,7 @@ public void testExecuteOnFail() { } @Test - public void testExecuteCopyTitleWithNoTitle() { + public void executeCopyTitleWithNoTitle() { BibEntry entryWithNoTitle = (BibEntry) entry.clone(); entryWithNoTitle.clearField(StandardField.TITLE); ObservableList entriesWithNoTitles = FXCollections.observableArrayList(entryWithNoTitle); @@ -94,7 +94,7 @@ public void testExecuteCopyTitleWithNoTitle() { } @Test - public void testExecuteCopyTitleOnPartialSuccess() { + public void executeCopyTitleOnPartialSuccess() { BibEntry entryWithNoTitle = (BibEntry) entry.clone(); entryWithNoTitle.clearField(StandardField.TITLE); ObservableList mixedEntries = FXCollections.observableArrayList(entryWithNoTitle, entry); @@ -112,7 +112,7 @@ public void testExecuteCopyTitleOnPartialSuccess() { } @Test - public void testExecuteCopyTitleOnSuccess() { + public void executeCopyTitleOnSuccess() { ObservableList entriesWithTitles = FXCollections.observableArrayList(entry); BibDatabaseContext databaseContext = new BibDatabaseContext(new BibDatabase(entriesWithTitles)); @@ -128,7 +128,7 @@ public void testExecuteCopyTitleOnSuccess() { } @Test - public void testExecuteCopyKeyWithNoKey() { + public void executeCopyKeyWithNoKey() { BibEntry entryWithNoKey = (BibEntry) entry.clone(); entryWithNoKey.clearCiteKey(); ObservableList entriesWithNoKeys = FXCollections.observableArrayList(entryWithNoKey); @@ -144,7 +144,7 @@ public void testExecuteCopyKeyWithNoKey() { } @Test - public void testExecuteCopyKeyOnPartialSuccess() { + public void executeCopyKeyOnPartialSuccess() { BibEntry entryWithNoKey = (BibEntry) entry.clone(); entryWithNoKey.clearCiteKey(); ObservableList mixedEntries = FXCollections.observableArrayList(entryWithNoKey, entry); @@ -162,7 +162,7 @@ public void testExecuteCopyKeyOnPartialSuccess() { } @Test - public void testExecuteCopyKeyOnSuccess() { + public void executeCopyKeyOnSuccess() { ObservableList entriesWithKeys = FXCollections.observableArrayList(entry); BibDatabaseContext databaseContext = new BibDatabaseContext(new BibDatabase(entriesWithKeys)); @@ -178,7 +178,7 @@ public void testExecuteCopyKeyOnSuccess() { } @Test - public void testExecuteCopyDoiWithNoDoi() { + public void executeCopyDoiWithNoDoi() { BibEntry entryWithNoDoi = (BibEntry) entry.clone(); entryWithNoDoi.clearField(StandardField.DOI); ObservableList entriesWithNoDois = FXCollections.observableArrayList(entryWithNoDoi); @@ -194,7 +194,7 @@ public void testExecuteCopyDoiWithNoDoi() { } @Test - public void testExecuteCopyDoiOnPartialSuccess() { + public void executeCopyDoiOnPartialSuccess() { BibEntry entryWithNoDoi = (BibEntry) entry.clone(); entryWithNoDoi.clearField(StandardField.DOI); ObservableList mixedEntries = FXCollections.observableArrayList(entryWithNoDoi, entry); @@ -212,7 +212,7 @@ public void testExecuteCopyDoiOnPartialSuccess() { } @Test - public void testExecuteCopyDoiOnSuccess() { + public void executeCopyDoiOnSuccess() { ObservableList entriesWithDois = FXCollections.observableArrayList(entry); BibDatabaseContext databaseContext = new BibDatabaseContext(new BibDatabase(entriesWithDois)); diff --git a/src/test/java/org/jabref/gui/edit/ReplaceStringViewModelTest.java b/src/test/java/org/jabref/gui/edit/ReplaceStringViewModelTest.java index 758e3a8241b..606b34bc3ec 100644 --- a/src/test/java/org/jabref/gui/edit/ReplaceStringViewModelTest.java +++ b/src/test/java/org/jabref/gui/edit/ReplaceStringViewModelTest.java @@ -68,7 +68,7 @@ void setUp() { "and, '', author, TRUE, FALSE, 2", // replace two "and"s with empty string in the same AUTHOR field "' ', ',', date, TRUE, FALSE, 1" // replace space with comma in DATE field }) - void testReplace(String findString, String replaceString, String fieldString, boolean selectOnly, boolean allFieldReplace, int expectedResult) { + void replace(String findString, String replaceString, String fieldString, boolean selectOnly, boolean allFieldReplace, int expectedResult) { viewModel.findStringProperty().bind(new SimpleStringProperty(findString)); viewModel.replaceStringProperty().bind(new SimpleStringProperty(replaceString)); viewModel.fieldStringProperty().bind(new SimpleStringProperty(fieldString)); diff --git a/src/test/java/org/jabref/gui/entryeditor/CommentsTabTest.java b/src/test/java/org/jabref/gui/entryeditor/CommentsTabTest.java index be3f9274d4a..36996370d4f 100644 --- a/src/test/java/org/jabref/gui/entryeditor/CommentsTabTest.java +++ b/src/test/java/org/jabref/gui/entryeditor/CommentsTabTest.java @@ -144,7 +144,7 @@ void commentFieldShownIfContainsText(boolean shouldShowUserCommentsFields) { } @Test - void testDetermineFieldsToShowWorksForMultipleUsers() { + void determineFieldsToShowWorksForMultipleUsers() { final UserSpecificCommentField ownerComment = new UserSpecificCommentField(ownerName); final UserSpecificCommentField otherUsersComment = new UserSpecificCommentField("other-user-id"); @@ -159,7 +159,7 @@ void testDetermineFieldsToShowWorksForMultipleUsers() { } @Test - public void testDifferentiateCaseInUserName() { + public void differentiateCaseInUserName() { UserSpecificCommentField field1 = new UserSpecificCommentField("USER"); UserSpecificCommentField field2 = new UserSpecificCommentField("user"); assertNotEquals(field1, field2, "Two UserSpecificCommentField instances with usernames that differ only by case should be considered different"); diff --git a/src/test/java/org/jabref/gui/entryeditor/SciteTabTest.java b/src/test/java/org/jabref/gui/entryeditor/SciteTabTest.java index 59d5ce4c776..2e39af4d541 100644 --- a/src/test/java/org/jabref/gui/entryeditor/SciteTabTest.java +++ b/src/test/java/org/jabref/gui/entryeditor/SciteTabTest.java @@ -41,25 +41,25 @@ void setUp() { } @Test - public void testName() { + public void name() { Assertions.assertEquals(SciteTab.NAME, "Citation information"); } @Test - public void testShouldShow() { + public void shouldShow() { var tab = new SciteTab(preferencesService, taskExecutor, dialogService); boolean shouldShow = tab.shouldShow(null); Assertions.assertTrue(shouldShow); } @Test - public void testBindNullEntry() { + public void bindNullEntry() { var tab = new SciteTab(preferencesService, taskExecutor, dialogService); tab.bindToEntry(null); } @Test - public void testBindEntry() { + public void bindEntry() { var tab = new SciteTab(preferencesService, taskExecutor, dialogService); var entry = new BibEntry() .withField(StandardField.DOI, SAMPLE_DOI); diff --git a/src/test/java/org/jabref/gui/entryeditor/SciteTabViewModelTest.java b/src/test/java/org/jabref/gui/entryeditor/SciteTabViewModelTest.java index 0b6c8349efc..184bccc66c5 100644 --- a/src/test/java/org/jabref/gui/entryeditor/SciteTabViewModelTest.java +++ b/src/test/java/org/jabref/gui/entryeditor/SciteTabViewModelTest.java @@ -34,7 +34,7 @@ void setUp() { } @Test - public void testSciteTallyDTO() { + public void sciteTallyDTO() { JSONObject jsonObject = new JSONObject(); jsonObject.put("total", 1); jsonObject.put("supporting", 2); @@ -56,7 +56,7 @@ public void testSciteTallyDTO() { } @Test - void testFetchTallies() throws FetcherException { + void fetchTallies() throws FetcherException { var viewModel = new SciteTabViewModel(preferencesService, taskExecutor); DOI doi = new DOI(SciteTabTest.SAMPLE_DOI); var actual = DOI.parse(viewModel.fetchTallies(doi).doi()); diff --git a/src/test/java/org/jabref/gui/entryeditor/citationrelationtab/CitationsRelationsTabViewModelTest.java b/src/test/java/org/jabref/gui/entryeditor/citationrelationtab/CitationsRelationsTabViewModelTest.java index e3037b2edc6..0e20217e7c9 100644 --- a/src/test/java/org/jabref/gui/entryeditor/citationrelationtab/CitationsRelationsTabViewModelTest.java +++ b/src/test/java/org/jabref/gui/entryeditor/citationrelationtab/CitationsRelationsTabViewModelTest.java @@ -99,7 +99,7 @@ void setUp() { } @Test - void testExistingEntryCitesOtherPaperWithCitationKeys() { + void existingEntryCitesOtherPaperWithCitationKeys() { var citationItems = List.of(new CitationRelationItem(firstEntryToImport, false), new CitationRelationItem(secondEntryToImport, false)); @@ -109,7 +109,7 @@ void testExistingEntryCitesOtherPaperWithCitationKeys() { } @Test - void testImportedEntriesWithExistingCitationKeysCiteExistingEntry() { + void importedEntriesWithExistingCitationKeysCiteExistingEntry() { var citationItems = List.of(new CitationRelationItem(firstEntryToImport, false), new CitationRelationItem(secondEntryToImport, false)); @@ -119,7 +119,7 @@ void testImportedEntriesWithExistingCitationKeysCiteExistingEntry() { } @Test - void testExistingEntryCitesOtherPaperWithCitationKeysAndExistingCiteField() { + void existingEntryCitesOtherPaperWithCitationKeysAndExistingCiteField() { existingEntry.setField(StandardField.CITES, "Asdf1222"); var citationItems = List.of(new CitationRelationItem(firstEntryToImport, false), new CitationRelationItem(secondEntryToImport, false)); diff --git a/src/test/java/org/jabref/gui/exporter/ExportToClipboardActionTest.java b/src/test/java/org/jabref/gui/exporter/ExportToClipboardActionTest.java index 973247fe8f0..1d545d104f4 100644 --- a/src/test/java/org/jabref/gui/exporter/ExportToClipboardActionTest.java +++ b/src/test/java/org/jabref/gui/exporter/ExportToClipboardActionTest.java @@ -73,7 +73,7 @@ public void setUp() { } @Test - public void testExecuteIfNoSelectedEntries() { + public void executeIfNoSelectedEntries() { when(stateManager.getSelectedEntries()).thenReturn(FXCollections.emptyObservableList()); exportToClipboardAction.execute(); @@ -81,7 +81,7 @@ public void testExecuteIfNoSelectedEntries() { } @Test - public void testExecuteOnSuccess() { + public void executeOnSuccess() { Exporter selectedExporter = new Exporter("html", "HTML", StandardFileType.HTML) { @Override public void export(BibDatabaseContext databaseContext, Path file, List entries) { diff --git a/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java b/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java index b429b879454..51a91c5bc80 100644 --- a/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java +++ b/src/test/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtilTest.java @@ -47,7 +47,7 @@ public void setUp(@TempDir Path folder) throws Exception { } @Test - public void testFindAssociatedNotLinkedFilesSuccess() throws Exception { + public void findAssociatedNotLinkedFilesSuccess() throws Exception { when(databaseContext.getFileDirectories(any())).thenReturn(Collections.singletonList(path.getParent())); List expected = Collections.singletonList(new LinkedFile("", Path.of("CiteKey.pdf"), "PDF")); AutoSetFileLinksUtil util = new AutoSetFileLinksUtil(databaseContext, filePreferences, autoLinkPrefs); @@ -56,7 +56,7 @@ public void testFindAssociatedNotLinkedFilesSuccess() throws Exception { } @Test - public void testFindAssociatedNotLinkedFilesForEmptySearchDir() throws Exception { + public void findAssociatedNotLinkedFilesForEmptySearchDir() throws Exception { when(filePreferences.shouldStoreFilesRelativeToBibFile()).thenReturn(false); AutoSetFileLinksUtil util = new AutoSetFileLinksUtil(databaseContext, filePreferences, autoLinkPrefs); List actual = util.findAssociatedNotLinkedFiles(entry); diff --git a/src/test/java/org/jabref/gui/externalfiles/FileFilterUtilsTest.java b/src/test/java/org/jabref/gui/externalfiles/FileFilterUtilsTest.java index 9deab592e8f..6f0ce769452 100755 --- a/src/test/java/org/jabref/gui/externalfiles/FileFilterUtilsTest.java +++ b/src/test/java/org/jabref/gui/externalfiles/FileFilterUtilsTest.java @@ -147,7 +147,7 @@ public void sortByDateDescendingPositiveTest() { } @Test - public void testSortByDateDescendingNegativeTest() { + public void sortByDateDescendingNegativeTest() { List sortedPaths = fileFilterUtils .sortByDateDescending(files) .stream() diff --git a/src/test/java/org/jabref/gui/groups/GroupDialogViewModelTest.java b/src/test/java/org/jabref/gui/groups/GroupDialogViewModelTest.java index 808b37a8158..1c47527d0f8 100644 --- a/src/test/java/org/jabref/gui/groups/GroupDialogViewModelTest.java +++ b/src/test/java/org/jabref/gui/groups/GroupDialogViewModelTest.java @@ -85,7 +85,7 @@ void validateExistingRelativePath() throws Exception { } @Test - void testHierarchicalContextFromGroup() throws Exception { + void hierarchicalContextFromGroup() throws Exception { GroupHierarchyType groupHierarchyType = GroupHierarchyType.INCLUDING; when(group.getHierarchicalContext()).thenReturn(groupHierarchyType); viewModel = new GroupDialogViewModel(dialogService, bibDatabaseContext, preferencesService, group, null, new DummyFileUpdateMonitor()); @@ -94,7 +94,7 @@ void testHierarchicalContextFromGroup() throws Exception { } @Test - void testDefaultHierarchicalContext() throws Exception { + void defaultHierarchicalContext() throws Exception { GroupHierarchyType defaultHierarchicalContext = GroupHierarchyType.REFINING; when(preferencesService.getGroupsPreferences().getDefaultHierarchicalContext()).thenReturn(defaultHierarchicalContext); viewModel = new GroupDialogViewModel(dialogService, bibDatabaseContext, preferencesService, null, null, new DummyFileUpdateMonitor()); diff --git a/src/test/java/org/jabref/gui/importer/NewEntryActionTest.java b/src/test/java/org/jabref/gui/importer/NewEntryActionTest.java index 12e36236576..3bb923b426c 100644 --- a/src/test/java/org/jabref/gui/importer/NewEntryActionTest.java +++ b/src/test/java/org/jabref/gui/importer/NewEntryActionTest.java @@ -37,7 +37,7 @@ public void setUp() { } @Test - public void testExecuteOnSuccessWithFixedType() { + public void executeOnSuccessWithFixedType() { EntryType type = StandardEntryType.Article; newEntryAction = new NewEntryAction(() -> libraryTab, type, dialogService, preferencesService, stateManager); when(tabContainer.getLibraryTabs()).thenReturn(List.of(libraryTab)); diff --git a/src/test/java/org/jabref/gui/keyboard/KeyBindingsTabModelTest.java b/src/test/java/org/jabref/gui/keyboard/KeyBindingsTabModelTest.java index 2eb8da4ea63..b9e9d8f93d6 100644 --- a/src/test/java/org/jabref/gui/keyboard/KeyBindingsTabModelTest.java +++ b/src/test/java/org/jabref/gui/keyboard/KeyBindingsTabModelTest.java @@ -37,7 +37,7 @@ void setUp() { } @Test - void testInvalidKeyBindingIsNotSaved() { + void invalidKeyBindingIsNotSaved() { setKeyBindingViewModel(KeyBinding.COPY); KeyEvent shortcutKeyEvent = new KeyEvent(KeyEvent.KEY_RELEASED, "Q", "Q", KeyCode.Q, false, false, false, false); @@ -50,7 +50,7 @@ void testInvalidKeyBindingIsNotSaved() { } @Test - void testSpecialKeysValidKeyBindingIsSaved() { + void specialKeysValidKeyBindingIsSaved() { setKeyBindingViewModel(KeyBinding.IMPORT_INTO_NEW_DATABASE); KeyEvent shortcutKeyEvent = new KeyEvent(KeyEvent.KEY_RELEASED, "F1", "F1", KeyCode.F1, false, false, false, false); @@ -70,7 +70,7 @@ void testSpecialKeysValidKeyBindingIsSaved() { } @Test - void testKeyBindingCategory() { + void keyBindingCategory() { KeyBindingViewModel bindViewModel = new KeyBindingViewModel(keyBindingRepository, KeyBindingCategory.FILE); model.selectedKeyBindingProperty().set(Optional.of(bindViewModel)); KeyEvent shortcutKeyEvent = new KeyEvent(KeyEvent.KEY_PRESSED, "M", "M", KeyCode.M, true, true, true, false); @@ -80,7 +80,7 @@ void testKeyBindingCategory() { } @Test - void testRandomNewKeyKeyBindingInRepository() { + void randomNewKeyKeyBindingInRepository() { setKeyBindingViewModel(KeyBinding.CLEANUP); KeyEvent shortcutKeyEvent = new KeyEvent(KeyEvent.KEY_PRESSED, "K", "K", KeyCode.K, true, true, true, false); assertFalse(keyBindingRepository.checkKeyCombinationEquality(KeyBinding.CLEANUP, shortcutKeyEvent)); @@ -94,7 +94,7 @@ void testRandomNewKeyKeyBindingInRepository() { } @Test - void testSaveNewKeyBindingsToPreferences() { + void saveNewKeyBindingsToPreferences() { assumeFalse(OS.OS_X); setKeyBindingViewModel(KeyBinding.ABBREVIATE); @@ -108,7 +108,7 @@ void testSaveNewKeyBindingsToPreferences() { } @Test - void testSaveNewSpecialKeysKeyBindingsToPreferences() { + void saveNewSpecialKeysKeyBindingsToPreferences() { setKeyBindingViewModel(KeyBinding.ABBREVIATE); KeyEvent shortcutKeyEvent = new KeyEvent(KeyEvent.KEY_PRESSED, "F1", "F1", KeyCode.F1, true, false, false, false); @@ -122,7 +122,7 @@ void testSaveNewSpecialKeysKeyBindingsToPreferences() { } @Test - void testSetAllKeyBindingsToDefault() { + void setAllKeyBindingsToDefault() { assumeFalse(OS.OS_X); setKeyBindingViewModel(KeyBinding.ABBREVIATE); @@ -142,7 +142,7 @@ void testSetAllKeyBindingsToDefault() { } @Test - void testCloseEntryEditorCloseEntryKeybinding() { + void closeEntryEditorCloseEntryKeybinding() { KeyBindingViewModel viewModel = setKeyBindingViewModel(KeyBinding.CLOSE); model.selectedKeyBindingProperty().set(Optional.of(viewModel)); KeyEvent closeEditorEvent = new KeyEvent(KeyEvent.KEY_PRESSED, "", "", KeyCode.ESCAPE, false, false, false, false); @@ -156,7 +156,7 @@ void testCloseEntryEditorCloseEntryKeybinding() { } @Test - void testSetSingleKeyBindingToDefault() { + void setSingleKeyBindingToDefault() { assumeFalse(OS.OS_X); KeyBindingViewModel viewModel = setKeyBindingViewModel(KeyBinding.ABBREVIATE); diff --git a/src/test/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesViewModelTest.java b/src/test/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesViewModelTest.java index 7280c3e33e1..60311301dee 100644 --- a/src/test/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesViewModelTest.java +++ b/src/test/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesViewModelTest.java @@ -30,7 +30,7 @@ void setUp() { @DisplayName("Check that the list of strings is sorted according to their keys") @Test - void testStringsListPropertySorting() { + void stringsListPropertySorting() { BibtexString string1 = new BibtexString("TSE", "Transactions on Software Engineering"); BibtexString string2 = new BibtexString("ICSE", "International Conference on Software Engineering"); BibDatabase db = new BibDatabase(); @@ -51,7 +51,7 @@ void testStringsListPropertySorting() { @DisplayName("Check that the list of strings is sorted after resorting it") @Test - void testStringsListPropertyResorting() { + void stringsListPropertyResorting() { BibDatabase db = new BibDatabase(); BibDatabaseContext context = new BibDatabaseContext(db); List expected = List.of("ICSE", "TSE"); diff --git a/src/test/java/org/jabref/gui/mergeentries/DiffHighlightingTest.java b/src/test/java/org/jabref/gui/mergeentries/DiffHighlightingTest.java index 9ed45408946..d84ec3f5ecd 100644 --- a/src/test/java/org/jabref/gui/mergeentries/DiffHighlightingTest.java +++ b/src/test/java/org/jabref/gui/mergeentries/DiffHighlightingTest.java @@ -29,17 +29,17 @@ public static void assertEquals(List expected, List actual) { } @Test - void testGenerateDiffHighlightingBothNullThrowsNPE() { + void generateDiffHighlightingBothNullThrowsNPE() { Assertions.assertThrows(NullPointerException.class, () -> DiffHighlighting.generateDiffHighlighting(null, null, "")); } @Test - void testNullSeparatorThrowsNPE() { + void nullSeparatorThrowsNPE() { Assertions.assertThrows(NullPointerException.class, () -> DiffHighlighting.generateDiffHighlighting("", "", null)); } @Test - void testGenerateDiffHighlightingNoDiff() { + void generateDiffHighlightingNoDiff() { assertEquals( Arrays.asList( DiffHighlighting.forUnchanged("f"), @@ -50,7 +50,7 @@ void testGenerateDiffHighlightingNoDiff() { } @Test - void testGenerateDiffHighlightingSingleWordAddTextWordDiff() { + void generateDiffHighlightingSingleWordAddTextWordDiff() { assertEquals( Arrays.asList( DiffHighlighting.forRemoved("foo "), @@ -60,7 +60,7 @@ void testGenerateDiffHighlightingSingleWordAddTextWordDiff() { } @Test - void testGenerateDiffHighlightingSingleWordAddTextCharacterDiff() { + void generateDiffHighlightingSingleWordAddTextCharacterDiff() { assertEquals( Arrays.asList( DiffHighlighting.forUnchanged("f"), @@ -72,7 +72,7 @@ void testGenerateDiffHighlightingSingleWordAddTextCharacterDiff() { } @Test - void testGenerateDiffHighlightingSingleWordDeleteTextWordDiff() { + void generateDiffHighlightingSingleWordDeleteTextWordDiff() { assertEquals( Arrays.asList( DiffHighlighting.forRemoved("foobar "), @@ -82,7 +82,7 @@ void testGenerateDiffHighlightingSingleWordDeleteTextWordDiff() { } @Test - void testGenerateDiffHighlightingSingleWordDeleteTextCharacterDiff() { + void generateDiffHighlightingSingleWordDeleteTextCharacterDiff() { assertEquals( Arrays.asList( DiffHighlighting.forUnchanged("f"), diff --git a/src/test/java/org/jabref/gui/mergeentries/ThreeWayMergeCellViewModelTest.java b/src/test/java/org/jabref/gui/mergeentries/ThreeWayMergeCellViewModelTest.java index 929e0e56db0..663077b854c 100644 --- a/src/test/java/org/jabref/gui/mergeentries/ThreeWayMergeCellViewModelTest.java +++ b/src/test/java/org/jabref/gui/mergeentries/ThreeWayMergeCellViewModelTest.java @@ -20,7 +20,7 @@ void setup() { viewModel = new ThreeWayMergeCellViewModel("Hello", 0); } - private static Stream testOddEvenLogic() { + private static Stream oddEvenLogic() { return Stream.of( Arguments.of(true, false, true, false), Arguments.of(false, false, true, false), @@ -65,7 +65,7 @@ private static Stream getTextAndSetTextShouldBeConsistent() { @ParameterizedTest @MethodSource - void testOddEvenLogic(boolean setIsOdd, boolean setIsEven, boolean expectedIsOdd, boolean expectedIsEven) { + void oddEvenLogic(boolean setIsOdd, boolean setIsEven, boolean expectedIsOdd, boolean expectedIsEven) { viewModel.setOdd(setIsOdd); viewModel.setEven(setIsEven); assertEquals(expectedIsOdd, viewModel.isOdd()); diff --git a/src/test/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/FileMergerTest.java b/src/test/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/FileMergerTest.java index 164015cbfdc..fd3051031fd 100644 --- a/src/test/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/FileMergerTest.java +++ b/src/test/java/org/jabref/gui/mergeentries/newmergedialog/fieldsmerger/FileMergerTest.java @@ -30,7 +30,7 @@ class FileMergerTest { :A2012 -A.pdf:;B2013 - B.pdf:PDF:,A2012 -A.pdf,B2013 - B.pdf:PDF :A2012 -A.pdf:;:asdf:,A2012 -A.pdf,asdf """) - void testMerge(String expect, String fileA, String fileB) { + void merge(String expect, String fileA, String fileB) { assertEquals(expect, fileMerger.merge(fileA, fileB)); } } diff --git a/src/test/java/org/jabref/gui/preferences/journals/JournalAbbreviationsViewModelTabTest.java b/src/test/java/org/jabref/gui/preferences/journals/JournalAbbreviationsViewModelTabTest.java index 433d736862d..330d09e2f92 100644 --- a/src/test/java/org/jabref/gui/preferences/journals/JournalAbbreviationsViewModelTabTest.java +++ b/src/test/java/org/jabref/gui/preferences/journals/JournalAbbreviationsViewModelTabTest.java @@ -188,21 +188,21 @@ void setUpViewModel(@TempDir Path tempFolder) throws Exception { } @Test - void testInitialHasNoFilesAndNoAbbreviations() { + void initialHasNoFilesAndNoAbbreviations() { assertEquals(0, viewModel.journalFilesProperty().size()); assertEquals(0, viewModel.abbreviationsProperty().size()); } @ParameterizedTest @MethodSource("provideTestFiles") - void testInitialWithSavedFilesIncrementsFilesCounter(TestData testData) throws IOException { + void initialWithSavedFilesIncrementsFilesCounter(TestData testData) throws IOException { addFourTestFileToViewModelAndPreferences(testData); assertEquals(4, viewModel.journalFilesProperty().size()); } @ParameterizedTest @MethodSource("provideTestFiles") - void testRemoveDuplicatesWhenReadingFiles(TestData testData) throws IOException { + void removeDuplicatesWhenReadingFiles(TestData testData) throws IOException { addFourTestFileToViewModelAndPreferences(testData); viewModel.selectLastJournalFile(); @@ -230,7 +230,7 @@ void addDuplicatedFileResultsInErrorDialog(TestData testData) throws IOException @ParameterizedTest @MethodSource("provideTestFiles") - void testOpenDuplicatedFileResultsInAnException(TestData testData) throws IOException { + void openDuplicatedFileResultsInAnException(TestData testData) throws IOException { when(dialogService.showFileOpenDialog(any())).thenReturn(Optional.of(createTestFile(testData.csvFiles.get(0)))); viewModel.openFile(); viewModel.openFile(); @@ -239,7 +239,7 @@ void testOpenDuplicatedFileResultsInAnException(TestData testData) throws IOExce @ParameterizedTest @MethodSource("provideTestFiles") - void testSelectLastJournalFileSwitchesFilesAndTheirAbbreviations(TestData testData) throws IOException { + void selectLastJournalFileSwitchesFilesAndTheirAbbreviations(TestData testData) throws IOException { when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(emptyTestFile)); viewModel.addNewFile(); viewModel.selectLastJournalFile(); @@ -253,7 +253,7 @@ void testSelectLastJournalFileSwitchesFilesAndTheirAbbreviations(TestData testDa @ParameterizedTest @MethodSource("provideTestFiles") - void testOpenValidFileContainsTheSpecificEntryAndEnoughAbbreviations(TestData testData) throws IOException { + void openValidFileContainsTheSpecificEntryAndEnoughAbbreviations(TestData testData) throws IOException { when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(createTestFile(testData.csvFiles.get(2)))); viewModel.addNewFile(); viewModel.selectLastJournalFile(); @@ -266,7 +266,7 @@ void testOpenValidFileContainsTheSpecificEntryAndEnoughAbbreviations(TestData te @ParameterizedTest @MethodSource("provideTestFiles") - void testRemoveLastListSetsCurrentFileAndCurrentAbbreviationToNull(TestData testData) throws IOException { + void removeLastListSetsCurrentFileAndCurrentAbbreviationToNull(TestData testData) throws IOException { when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(createTestFile(testData.csvFiles.get(0)))); viewModel.addNewFile(); viewModel.removeCurrentFile(); @@ -279,7 +279,7 @@ void testRemoveLastListSetsCurrentFileAndCurrentAbbreviationToNull(TestData test @ParameterizedTest @MethodSource("provideTestFiles") - void testMixedFileUsage(TestData testData) throws IOException { + void mixedFileUsage(TestData testData) throws IOException { // simulate open file button twice when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(createTestFile(testData.csvFiles.get(1)))); viewModel.addNewFile(); @@ -323,7 +323,7 @@ void testMixedFileUsage(TestData testData) throws IOException { } @Test - void testBuiltInListsIncludeAllBuiltInAbbreviations() { + void builtInListsIncludeAllBuiltInAbbreviations() { viewModel.addBuiltInList(); assertEquals(1, viewModel.journalFilesProperty().getSize()); viewModel.currentFileProperty().set(viewModel.journalFilesProperty().get(0)); @@ -338,7 +338,7 @@ void testBuiltInListsIncludeAllBuiltInAbbreviations() { @ParameterizedTest @MethodSource("provideTestFiles") - void testCurrentFilePropertyChangeActiveFile(TestData testData) throws IOException { + void currentFilePropertyChangeActiveFile(TestData testData) throws IOException { for (CsvFileNameAndContent testFile : testData.csvFiles) { when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(createTestFile(testFile))); viewModel.addNewFile(); @@ -370,7 +370,7 @@ void testCurrentFilePropertyChangeActiveFile(TestData testData) throws IOExcepti @ParameterizedTest @MethodSource("provideTestFiles") - void testAddAbbreviationIncludesAbbreviationsInAbbreviationList(TestData testData) throws IOException { + void addAbbreviationIncludesAbbreviationsInAbbreviationList(TestData testData) throws IOException { when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(createTestFile(testData.csvFiles.get(2)))); viewModel.addNewFile(); when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(createTestFile(testData.csvFiles.get(3)))); @@ -385,7 +385,7 @@ void testAddAbbreviationIncludesAbbreviationsInAbbreviationList(TestData testDat @ParameterizedTest @MethodSource("provideTestFiles") - void testAddDuplicatedAbbreviationResultsInException(TestData testData) throws IOException { + void addDuplicatedAbbreviationResultsInException(TestData testData) throws IOException { when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(createTestFile(testData.csvFiles.get(1)))); viewModel.addNewFile(); viewModel.selectLastJournalFile(); @@ -395,7 +395,7 @@ void testAddDuplicatedAbbreviationResultsInException(TestData testData) throws I } @Test - void testEditSameAbbreviationWithNoChangeDoesNotResultInException() { + void editSameAbbreviationWithNoChangeDoesNotResultInException() { when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(emptyTestFile)); viewModel.addNewFile(); viewModel.selectLastJournalFile(); @@ -408,7 +408,7 @@ void testEditSameAbbreviationWithNoChangeDoesNotResultInException() { @ParameterizedTest @MethodSource("provideTestFiles") - void testEditAbbreviationIncludesNewAbbreviationInAbbreviationsList(TestData testData) throws IOException { + void editAbbreviationIncludesNewAbbreviationInAbbreviationsList(TestData testData) throws IOException { when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(createTestFile(testData.csvFiles.get(2)))); viewModel.addNewFile(); when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(createTestFile(testData.csvFiles.get(3)))); @@ -432,7 +432,7 @@ void testEditAbbreviationIncludesNewAbbreviationInAbbreviationsList(TestData tes @ParameterizedTest @MethodSource("provideTestFiles") - void testEditAbbreviationToExistingOneResultsInException(TestData testData) throws IOException { + void editAbbreviationToExistingOneResultsInException(TestData testData) throws IOException { when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(createTestFile(testData.csvFiles.get(1)))); viewModel.addNewFile(); viewModel.selectLastJournalFile(); @@ -448,7 +448,7 @@ void testEditAbbreviationToExistingOneResultsInException(TestData testData) thro @ParameterizedTest @MethodSource("provideTestFiles") - void testEditAbbreviationToEmptyNameResultsInException(TestData testData) throws IOException { + void editAbbreviationToEmptyNameResultsInException(TestData testData) throws IOException { when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(createTestFile(testData.csvFiles.get(1)))); viewModel.addNewFile(); viewModel.selectLastJournalFile(); @@ -462,7 +462,7 @@ void testEditAbbreviationToEmptyNameResultsInException(TestData testData) throws @ParameterizedTest @MethodSource("provideTestFiles") - void testEditAbbreviationToEmptyAbbreviationResultsInException(TestData testData) throws IOException { + void editAbbreviationToEmptyAbbreviationResultsInException(TestData testData) throws IOException { when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(createTestFile(testData.csvFiles.get(1)))); viewModel.addNewFile(); viewModel.selectLastJournalFile(); @@ -476,7 +476,7 @@ void testEditAbbreviationToEmptyAbbreviationResultsInException(TestData testData @ParameterizedTest @MethodSource("provideTestFiles") - void testSaveAbbreviationsToFilesCreatesNewFilesWithWrittenAbbreviations(TestData testData) throws Exception { + void saveAbbreviationsToFilesCreatesNewFilesWithWrittenAbbreviations(TestData testData) throws Exception { Path testFile2 = createTestFile(testData.csvFiles.get(2)); when(dialogService.showFileSaveDialog(any())).thenReturn(Optional.of(testFile2)); viewModel.addNewFile(); diff --git a/src/test/java/org/jabref/gui/search/ContainsAndRegexBasedSearchRuleDescriberTest.java b/src/test/java/org/jabref/gui/search/ContainsAndRegexBasedSearchRuleDescriberTest.java index bc3406ec43c..c44c1d8c77b 100644 --- a/src/test/java/org/jabref/gui/search/ContainsAndRegexBasedSearchRuleDescriberTest.java +++ b/src/test/java/org/jabref/gui/search/ContainsAndRegexBasedSearchRuleDescriberTest.java @@ -29,7 +29,7 @@ void onStart(Stage stage) { } @Test - void testSimpleTerm() { + void simpleTerm() { String query = "test"; List expectedTexts = List.of( TooltipTextUtil.createText("This search contains entries in which any field contains the term "), @@ -41,7 +41,7 @@ void testSimpleTerm() { } @Test - void testNoAst() { + void noAst() { String query = "a b"; List expectedTexts = List.of( TooltipTextUtil.createText("This search contains entries in which any field contains the term "), @@ -55,7 +55,7 @@ void testNoAst() { } @Test - void testNoAstRegex() { + void noAstRegex() { String query = "a b"; List expectedTexts = List.of( TooltipTextUtil.createText("This search contains entries in which any field contains the regular expression "), @@ -69,7 +69,7 @@ void testNoAstRegex() { } @Test - void testNoAstRegexCaseSensitive() { + void noAstRegexCaseSensitive() { String query = "a b"; List expectedTexts = List.of( TooltipTextUtil.createText("This search contains entries in which any field contains the regular expression "), @@ -83,7 +83,7 @@ void testNoAstRegexCaseSensitive() { } @Test - void testNoAstCaseSensitive() { + void noAstCaseSensitive() { String query = "a b"; List expectedTexts = List.of( TooltipTextUtil.createText("This search contains entries in which any field contains the term "), diff --git a/src/test/java/org/jabref/gui/search/GetLastSearchHistoryTest.java b/src/test/java/org/jabref/gui/search/GetLastSearchHistoryTest.java index 390c9c81505..f97eca96ff7 100644 --- a/src/test/java/org/jabref/gui/search/GetLastSearchHistoryTest.java +++ b/src/test/java/org/jabref/gui/search/GetLastSearchHistoryTest.java @@ -23,7 +23,7 @@ void onStart(Stage stage) { } @Test - void testGetLastSearchHistory() { + void getLastSearchHistory() { StateManager stateManager = new StateManager(); stateManager.addSearchHistory("test1"); stateManager.addSearchHistory("test2"); @@ -35,7 +35,7 @@ void testGetLastSearchHistory() { } @Test - void testduplicateSearchHistory() { + void duplicateSearchHistory() { StateManager stateManager = new StateManager(); stateManager.addSearchHistory("test1"); stateManager.addSearchHistory("test2"); @@ -48,7 +48,7 @@ void testduplicateSearchHistory() { } @Test - void testclearSearchHistory() { + void clearSearchHistory() { StateManager stateManager = new StateManager(); stateManager.addSearchHistory("test1"); stateManager.addSearchHistory("test2"); diff --git a/src/test/java/org/jabref/gui/search/GrammarBasedSearchRuleDescriberTest.java b/src/test/java/org/jabref/gui/search/GrammarBasedSearchRuleDescriberTest.java index ce2c4cc3a49..626c0238148 100644 --- a/src/test/java/org/jabref/gui/search/GrammarBasedSearchRuleDescriberTest.java +++ b/src/test/java/org/jabref/gui/search/GrammarBasedSearchRuleDescriberTest.java @@ -40,7 +40,7 @@ private TextFlow createDescription(String query, EnumSet searchFlag } @Test - void testSimpleQueryCaseSensitiveRegex() { + void simpleQueryCaseSensitiveRegex() { String query = "a=b"; List expectedTexts = Arrays.asList(TooltipTextUtil.createText("This search contains entries in which "), TooltipTextUtil.createText("the field "), TooltipTextUtil.createText("a", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" contains the regular expression "), TooltipTextUtil.createText("b", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(". "), @@ -51,7 +51,7 @@ void testSimpleQueryCaseSensitiveRegex() { } @Test - void testSimpleQueryCaseSensitive() { + void simpleQueryCaseSensitive() { String query = "a=b"; List expectedTexts = Arrays.asList(TooltipTextUtil.createText("This search contains entries in which "), TooltipTextUtil.createText("the field "), TooltipTextUtil.createText("a", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" contains the term "), TooltipTextUtil.createText("b", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(". "), @@ -62,7 +62,7 @@ void testSimpleQueryCaseSensitive() { } @Test - void testSimpleQuery() { + void simpleQuery() { String query = "a=b"; List expectedTexts = Arrays.asList(TooltipTextUtil.createText("This search contains entries in which "), TooltipTextUtil.createText("the field "), TooltipTextUtil.createText("a", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" contains the term "), TooltipTextUtil.createText("b", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(". "), @@ -73,7 +73,7 @@ void testSimpleQuery() { } @Test - void testSimpleQueryRegex() { + void simpleQueryRegex() { String query = "a=b"; List expectedTexts = Arrays.asList(TooltipTextUtil.createText("This search contains entries in which "), TooltipTextUtil.createText("the field "), TooltipTextUtil.createText("a", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" contains the regular expression "), TooltipTextUtil.createText("b", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(". "), @@ -84,7 +84,7 @@ void testSimpleQueryRegex() { } @Test - void testComplexQueryCaseSensitiveRegex() { + void complexQueryCaseSensitiveRegex() { String query = "not a=b and c=e or e=\"x\""; List expectedTexts = Arrays.asList(TooltipTextUtil.createText("This search contains entries in which "), TooltipTextUtil.createText("not "), TooltipTextUtil.createText("the field "), TooltipTextUtil.createText("a", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" contains the regular expression "), TooltipTextUtil.createText("b", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" and "), TooltipTextUtil.createText("the field "), TooltipTextUtil.createText("c", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" contains the regular expression "), @@ -96,7 +96,7 @@ void testComplexQueryCaseSensitiveRegex() { } @Test - void testComplexQueryRegex() { + void complexQueryRegex() { String query = "not a=b and c=e or e=\"x\""; List expectedTexts = Arrays.asList(TooltipTextUtil.createText("This search contains entries in which "), TooltipTextUtil.createText("not "), TooltipTextUtil.createText("the field "), TooltipTextUtil.createText("a", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" contains the regular expression "), TooltipTextUtil.createText("b", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" and "), TooltipTextUtil.createText("the field "), TooltipTextUtil.createText("c", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" contains the regular expression "), @@ -108,7 +108,7 @@ void testComplexQueryRegex() { } @Test - void testComplexQueryCaseSensitive() { + void complexQueryCaseSensitive() { String query = "not a=b and c=e or e=\"x\""; List expectedTexts = Arrays.asList(TooltipTextUtil.createText("This search contains entries in which "), TooltipTextUtil.createText("not "), TooltipTextUtil.createText("the field "), TooltipTextUtil.createText("a", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" contains the term "), TooltipTextUtil.createText("b", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" and "), TooltipTextUtil.createText("the field "), TooltipTextUtil.createText("c", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" contains the term "), TooltipTextUtil.createText("e", TooltipTextUtil.TextType.BOLD), @@ -119,7 +119,7 @@ void testComplexQueryCaseSensitive() { } @Test - void testComplexQuery() { + void complexQuery() { String query = "not a=b and c=e or e=\"x\""; List expectedTexts = Arrays.asList(TooltipTextUtil.createText("This search contains entries in which "), TooltipTextUtil.createText("not "), TooltipTextUtil.createText("the field "), TooltipTextUtil.createText("a", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" contains the term "), TooltipTextUtil.createText("b", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" and "), TooltipTextUtil.createText("the field "), TooltipTextUtil.createText("c", TooltipTextUtil.TextType.BOLD), TooltipTextUtil.createText(" contains the term "), TooltipTextUtil.createText("e", TooltipTextUtil.TextType.BOLD), diff --git a/src/test/java/org/jabref/gui/util/FileDialogConfigurationTest.java b/src/test/java/org/jabref/gui/util/FileDialogConfigurationTest.java index ac7c3830c5e..5e89f07bc93 100644 --- a/src/test/java/org/jabref/gui/util/FileDialogConfigurationTest.java +++ b/src/test/java/org/jabref/gui/util/FileDialogConfigurationTest.java @@ -18,7 +18,7 @@ class FileDialogConfigurationTest { @Test - void testWithValidDirectoryString(@TempDir Path folder) { + void withValidDirectoryString(@TempDir Path folder) { String tempFolder = folder.toAbsolutePath().toString(); FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() @@ -28,7 +28,7 @@ void testWithValidDirectoryString(@TempDir Path folder) { } @Test - void testWithValidDirectoryPath(@TempDir Path tempFolder) { + void withValidDirectoryPath(@TempDir Path tempFolder) { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .withInitialDirectory(tempFolder).build(); @@ -36,7 +36,7 @@ void testWithValidDirectoryPath(@TempDir Path tempFolder) { } @Test - void testWithNullStringDirectory() { + void withNullStringDirectory() { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .withInitialDirectory((String) null).build(); @@ -44,7 +44,7 @@ void testWithNullStringDirectory() { } @Test - void testWithNullPathDirectory() { + void withNullPathDirectory() { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .withInitialDirectory((Path) null).build(); @@ -52,7 +52,7 @@ void testWithNullPathDirectory() { } @Test - void testWithNonExistingDirectoryAndParentNull() { + void withNonExistingDirectoryAndParentNull() { String tempFolder = "workingDirectory"; FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .withInitialDirectory(tempFolder).build(); @@ -61,7 +61,7 @@ void testWithNonExistingDirectoryAndParentNull() { } @Test - void testSingleExtension() { + void singleExtension() { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .withDefaultExtension(StandardFileType.BIBTEX_DB).build(); diff --git a/src/test/java/org/jabref/gui/util/TooltipTextUtilTest.java b/src/test/java/org/jabref/gui/util/TooltipTextUtilTest.java index a181178c1d3..3b266e37cb9 100644 --- a/src/test/java/org/jabref/gui/util/TooltipTextUtilTest.java +++ b/src/test/java/org/jabref/gui/util/TooltipTextUtilTest.java @@ -62,7 +62,7 @@ public void stringRemainsTheSameAfterTransformationToItalic() { } @Test - public void testCreateTextMonospaced() { + public void createTextMonospaced() { Text text = TooltipTextUtil.createText(testText, TooltipTextUtil.TextType.MONOSPACED); assertEquals("tooltip-text-monospaced", text.getStyleClass().toString()); assertEquals(testText, text.getText()); diff --git a/src/test/java/org/jabref/logic/auxparser/AuxParserTest.java b/src/test/java/org/jabref/logic/auxparser/AuxParserTest.java index de5d360df4e..572f15438f2 100644 --- a/src/test/java/org/jabref/logic/auxparser/AuxParserTest.java +++ b/src/test/java/org/jabref/logic/auxparser/AuxParserTest.java @@ -39,7 +39,7 @@ void tearDown() { } @Test - void testNormal() throws URISyntaxException, IOException { + void normal() throws URISyntaxException, IOException { InputStream originalStream = AuxParserTest.class.getResourceAsStream("origin.bib"); Path auxFile = Path.of(AuxParserTest.class.getResource("paper.aux").toURI()); try (InputStreamReader originalReader = new InputStreamReader(originalStream, StandardCharsets.UTF_8)) { @@ -64,7 +64,7 @@ void testNormal() throws URISyntaxException, IOException { } @Test - void testTwoArgMacro() throws URISyntaxException, IOException { + void twoArgMacro() throws URISyntaxException, IOException { // Result should be identical to that of testNormal InputStream originalStream = AuxParserTest.class.getResourceAsStream("origin.bib"); @@ -91,7 +91,7 @@ void testTwoArgMacro() throws URISyntaxException, IOException { } @Test - void testNotAllFound() throws URISyntaxException, IOException { + void notAllFound() throws URISyntaxException, IOException { InputStream originalStream = AuxParserTest.class.getResourceAsStream("origin.bib"); Path auxFile = Path.of(AuxParserTest.class.getResource("badpaper.aux").toURI()); try (InputStreamReader originalReader = new InputStreamReader(originalStream, StandardCharsets.UTF_8)) { @@ -129,7 +129,7 @@ void duplicateBibDatabaseConfiguration() throws URISyntaxException, IOException } @Test - void testNestedAux() throws URISyntaxException, IOException { + void nestedAux() throws URISyntaxException, IOException { InputStream originalStream = AuxParserTest.class.getResourceAsStream("origin.bib"); Path auxFile = Path.of(AuxParserTest.class.getResource("nested.aux").toURI()); try (InputStreamReader originalReader = new InputStreamReader(originalStream, StandardCharsets.UTF_8)) { @@ -151,7 +151,7 @@ void testNestedAux() throws URISyntaxException, IOException { } @Test - void testCrossRef() throws URISyntaxException, IOException { + void crossRef() throws URISyntaxException, IOException { InputStream originalStream = AuxParserTest.class.getResourceAsStream("origin.bib"); Path auxFile = Path.of(AuxParserTest.class.getResource("crossref.aux").toURI()); try (InputStreamReader originalReader = new InputStreamReader(originalStream, StandardCharsets.UTF_8)) { @@ -173,7 +173,7 @@ void testCrossRef() throws URISyntaxException, IOException { } @Test - void testFileNotFound() { + void fileNotFound() { AuxParser auxParser = new DefaultAuxParser(new BibDatabase()); AuxParserResult auxResult = auxParser.parse(Path.of("unknownfile.aux")); diff --git a/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java b/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java index 69a9695bbd3..9dbc53287e9 100644 --- a/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java +++ b/src/test/java/org/jabref/logic/bibtex/BibEntryWriterTest.java @@ -53,7 +53,7 @@ void setUpWriter() { } @Test - void testSerialization() throws IOException { + void serialization() throws IOException { BibEntry entry = new BibEntry(StandardEntryType.Article); // set a required field entry.setField(StandardField.AUTHOR, "Foo Bar"); @@ -406,7 +406,7 @@ void roundTripWithCamelCasingInTheOriginalEntryAndResultInLowerCase() throws IOE } @Test - void testEntryTypeChange() throws IOException { + void entryTypeChange() throws IOException { // @formatter:off String expected = """ @@ -830,7 +830,7 @@ void alphabeticSerialization() throws IOException { } @Test - void testSerializeAll() throws IOException { + void serializeAll() throws IOException { BibEntry entry1 = new BibEntry(StandardEntryType.Article); // required fields entry1.setField(StandardField.AUTHOR, "Journal Author"); @@ -907,7 +907,7 @@ static Stream testGetFormattedFieldNameData() { @ParameterizedTest @MethodSource("testGetFormattedFieldNameData") - void testGetFormattedFieldName(String expected, String fieldName, int indent) { + void getFormattedFieldName(String expected, String fieldName, int indent) { Field field = FieldFactory.parseField(fieldName); assertEquals(expected, BibEntryWriter.getFormattedFieldName(field, indent)); } @@ -923,7 +923,7 @@ static Stream testGetLengthOfLongestFieldNameData() { @ParameterizedTest @MethodSource("testGetLengthOfLongestFieldNameData") - void testGetLengthOfLongestFieldName(int expected, BibEntry entry) { + void getLengthOfLongestFieldName(int expected, BibEntry entry) { assertEquals(expected, BibEntryWriter.getLengthOfLongestFieldName(entry)); } } diff --git a/src/test/java/org/jabref/logic/bibtex/FileFieldWriterTest.java b/src/test/java/org/jabref/logic/bibtex/FileFieldWriterTest.java index 34032fb7859..1d8754478d3 100644 --- a/src/test/java/org/jabref/logic/bibtex/FileFieldWriterTest.java +++ b/src/test/java/org/jabref/logic/bibtex/FileFieldWriterTest.java @@ -16,22 +16,22 @@ public class FileFieldWriterTest { @Test - public void testQuoteStandard() { + public void quoteStandard() { assertEquals("a", FileFieldWriter.quote("a")); } @Test - public void testQuoteAllCharacters() { + public void quoteAllCharacters() { assertEquals("a\\:\\;\\\\", FileFieldWriter.quote("a:;\\")); } @Test - public void testQuoteEmpty() { + public void quoteEmpty() { assertEquals("", FileFieldWriter.quote("")); } @Test - public void testQuoteNull() { + public void quoteNull() { assertNull(FileFieldWriter.quote(null)); } @@ -46,12 +46,12 @@ private static Stream getEncodingTestData() { @ParameterizedTest @MethodSource("getEncodingTestData") - public void testEncodeStringArray(String expected, String[][] values) { + public void encodeStringArray(String expected, String[][] values) { assertEquals(expected, FileFieldWriter.encodeStringArray(values)); } @Test - public void testFileFieldWriterGetStringRepresentation() { + public void fileFieldWriterGetStringRepresentation() { LinkedFile file = new LinkedFile("test", Path.of("X:\\Users\\abc.pdf"), "PDF"); assertEquals("test:X\\:/Users/abc.pdf:PDF", FileFieldWriter.getStringRepresentation(file)); } diff --git a/src/test/java/org/jabref/logic/bibtex/comparator/BibStringDiffTest.java b/src/test/java/org/jabref/logic/bibtex/comparator/BibStringDiffTest.java index 03527cb4387..d1b4d5986b8 100644 --- a/src/test/java/org/jabref/logic/bibtex/comparator/BibStringDiffTest.java +++ b/src/test/java/org/jabref/logic/bibtex/comparator/BibStringDiffTest.java @@ -66,7 +66,7 @@ void compareToDifferentClassIsFalse() { } @Test - void testGetters() { + void getters() { BibtexString bsOne = new BibtexString("aKahle", "Kahle, Brewster"); BibtexString bsTwo = new BibtexString("iMIT", "Institute of Technology"); BibStringDiff diff = new BibStringDiff(bsOne, bsTwo); @@ -75,7 +75,7 @@ void testGetters() { } @Test - void testCompareEmptyDatabases() { + void compareEmptyDatabases() { when(originalDataBase.hasNoStrings()).thenReturn(true); when(newDataBase.hasNoStrings()).thenReturn(true); @@ -83,7 +83,7 @@ void testCompareEmptyDatabases() { } @Test - void testCompareNameChange() { + void compareNameChange() { when(originalDataBase.getStringValues()).thenReturn(List.of(new BibtexString("name", "content"))); when(newDataBase.getStringValues()).thenReturn(List.of(new BibtexString("name2", "content"))); @@ -93,7 +93,7 @@ void testCompareNameChange() { } @Test - void testCompareNoDiff() { + void compareNoDiff() { when(originalDataBase.getStringValues()).thenReturn(List.of(new BibtexString("name", "content"))); when(newDataBase.getStringValues()).thenReturn(List.of(new BibtexString("name", "content"))); @@ -102,7 +102,7 @@ void testCompareNoDiff() { } @Test - void testCompareRemovedString() { + void compareRemovedString() { when(originalDataBase.getStringValues()).thenReturn(List.of(new BibtexString("name", "content"))); when(newDataBase.getStringValues()).thenReturn(Collections.emptyList()); @@ -112,7 +112,7 @@ void testCompareRemovedString() { } @Test - void testCompareAddString() { + void compareAddString() { when(originalDataBase.getStringValues()).thenReturn(Collections.emptyList()); when(newDataBase.getStringValues()).thenReturn(List.of(new BibtexString("name", "content"))); diff --git a/src/test/java/org/jabref/logic/bst/BstFunctionsTest.java b/src/test/java/org/jabref/logic/bst/BstFunctionsTest.java index 1b63e26cbb3..1db07da6474 100644 --- a/src/test/java/org/jabref/logic/bst/BstFunctionsTest.java +++ b/src/test/java/org/jabref/logic/bst/BstFunctionsTest.java @@ -34,7 +34,7 @@ */ class BstFunctionsTest { @Test - public void testCompareFunctions() throws RecognitionException { + public void compareFunctions() throws RecognitionException { BstVM vm = new BstVM(""" FUNCTION { test.compare } { #5 #5 = % TRUE @@ -67,7 +67,7 @@ public void testCompareFunctions() throws RecognitionException { } @Test - public void testArithmeticFunctions() throws RecognitionException { + public void arithmeticFunctions() throws RecognitionException { BstVM vm = new BstVM(""" FUNCTION { test } { #1 #1 + % 2 @@ -84,7 +84,7 @@ public void testArithmeticFunctions() throws RecognitionException { } @Test - public void testArithmeticFunctionTypeMismatch() throws RecognitionException { + public void arithmeticFunctionTypeMismatch() throws RecognitionException { BstVM vm = new BstVM(""" FUNCTION { test } { #1 "HELLO" + % Should throw exception @@ -96,7 +96,7 @@ public void testArithmeticFunctionTypeMismatch() throws RecognitionException { } @Test - public void testStringOperations() throws RecognitionException { + public void stringOperations() throws RecognitionException { // Test for concat (*) and add.period BstVM vm = new BstVM(""" FUNCTION { test } { @@ -128,7 +128,7 @@ public void testStringOperations() throws RecognitionException { } @Test - public void testMissing() throws RecognitionException { + public void missing() throws RecognitionException { BstVM vm = new BstVM(""" ENTRY { title } { } { } FUNCTION { presort } { cite$ 'sort.key$ := } @@ -154,7 +154,7 @@ public void testMissing() throws RecognitionException { } @Test - public void testNumNames() throws RecognitionException { + public void numNames() throws RecognitionException { BstVM vm = new BstVM(""" FUNCTION { test } { "Johnny Foo { and } Mary Bar" num.names$ @@ -171,7 +171,7 @@ public void testNumNames() throws RecognitionException { } @Test - public void testSubstring() throws RecognitionException { + public void substring() throws RecognitionException { BstVM vm = new BstVM(""" FUNCTION { test } { "123456789" #2 #1 substring$ % 2 @@ -201,7 +201,7 @@ public void testSubstring() throws RecognitionException { } @Test - public void testEmpty() throws RecognitionException { + public void empty() throws RecognitionException { BstVM vm = new BstVM(""" ENTRY { title } { } { } READ @@ -228,7 +228,7 @@ public void testEmpty() throws RecognitionException { } @Test - public void testFormatNameStatic() throws RecognitionException { + public void formatNameStatic() throws RecognitionException { BstVM vm = new BstVM(""" FUNCTION { format }{ "Charles Louis Xavier Joseph de la Vall{\\'e}e Poussin" #1 "{vv~}{ll}{, jj}{, f}?" format.name$ } EXECUTE { format } @@ -242,7 +242,7 @@ public void testFormatNameStatic() throws RecognitionException { } @Test - public void testFormatNameInEntries() throws RecognitionException { + public void formatNameInEntries() throws RecognitionException { BstVM vm = new BstVM(""" ENTRY { author } { } { } FUNCTION { presort } { cite$ 'sort.key$ := } @@ -266,7 +266,7 @@ public void testFormatNameInEntries() throws RecognitionException { } @Test - public void testChangeCase() throws RecognitionException { + public void changeCase() throws RecognitionException { BstVM vm = new BstVM(""" STRINGS { title } READ @@ -296,7 +296,7 @@ public void testChangeCase() throws RecognitionException { } @Test - public void testTextLength() throws RecognitionException { + public void textLength() throws RecognitionException { BstVM vm = new BstVM(""" FUNCTION { test } { "hello world" text.length$ % 11 @@ -325,7 +325,7 @@ public void testTextLength() throws RecognitionException { } @Test - public void testIntToStr() throws RecognitionException { + public void intToStr() throws RecognitionException { BstVM vm = new BstVM(""" FUNCTION { test } { #3 int.to.str$ #9999 int.to.str$ } EXECUTE { test } @@ -339,7 +339,7 @@ public void testIntToStr() throws RecognitionException { } @Test - public void testChrToInt() throws RecognitionException { + public void chrToInt() throws RecognitionException { BstVM vm = new BstVM(""" FUNCTION { test } { "H" chr.to.int$ } EXECUTE { test } @@ -352,7 +352,7 @@ public void testChrToInt() throws RecognitionException { } @Test - public void testChrToIntIntToChr() throws RecognitionException { + public void chrToIntIntToChr() throws RecognitionException { BstVM vm = new BstVM(""" FUNCTION { test } { "H" chr.to.int$ int.to.chr$ } EXECUTE {test} @@ -365,7 +365,7 @@ public void testChrToIntIntToChr() throws RecognitionException { } @Test - public void testType() throws RecognitionException { + public void type() throws RecognitionException { BstVM vm = new BstVM(""" ENTRY { } { } { } FUNCTION { presort } { cite$ 'sort.key$ := } @@ -390,7 +390,7 @@ public void testType() throws RecognitionException { } @Test - public void testCallType() throws RecognitionException { + public void callType() throws RecognitionException { BstVM vm = new BstVM(""" ENTRY { title } { } { } FUNCTION { presort } { cite$ 'sort.key$ := } @@ -417,7 +417,7 @@ public void testCallType() throws RecognitionException { } @Test - public void testSwap() throws RecognitionException { + public void swap() throws RecognitionException { BstVM vm = new BstVM(""" FUNCTION { a } { #3 "Hallo" swap$ } EXECUTE { a } @@ -432,7 +432,7 @@ public void testSwap() throws RecognitionException { } @Test - void testAssignFunction() { + void assignFunction() { BstVM vm = new BstVM(""" INTEGERS { test.var } FUNCTION { test.func } { #1 'test.var := } @@ -448,7 +448,7 @@ void testAssignFunction() { } @Test - void testSimpleIf() { + void simpleIf() { BstVM vm = new BstVM(""" FUNCTION { path1 } { #1 } FUNCTION { path0 } { #0 } @@ -467,7 +467,7 @@ void testSimpleIf() { } @Test - void testSimpleWhile() { + void simpleWhile() { BstVM vm = new BstVM(""" INTEGERS { i } FUNCTION { test } { @@ -492,7 +492,7 @@ void testSimpleWhile() { } @Test - public void testNestedControlFunctions() throws RecognitionException { + public void nestedControlFunctions() throws RecognitionException { BstVM vm = new BstVM(""" STRINGS { t } FUNCTION { not } { { #0 } { #1 } if$ } @@ -537,7 +537,7 @@ public void testNestedControlFunctions() throws RecognitionException { } @Test - public void testLogic() throws RecognitionException { + public void logic() throws RecognitionException { BstVM vm = new BstVM(""" FUNCTION { not } { { #0 } { #1 } if$ } FUNCTION { and } { 'skip$ { pop$ #0 } if$ } @@ -577,7 +577,7 @@ public void testLogic() throws RecognitionException { */ @Test - public void testWidth() throws RecognitionException { + public void width() throws RecognitionException { BstVM vm = new BstVM(""" ENTRY { address author title type } { } { label } STRINGS { longest.label } @@ -619,7 +619,7 @@ public void testWidth() throws RecognitionException { } @Test - public void testDuplicateEmptyPopSwapIf() throws RecognitionException { + public void duplicateEmptyPopSwapIf() throws RecognitionException { BstVM vm = new BstVM(""" FUNCTION { emphasize } { duplicate$ empty$ @@ -642,7 +642,7 @@ public void testDuplicateEmptyPopSwapIf() throws RecognitionException { } @Test - public void testPreambleWriteNewlineQuote() { + public void preambleWriteNewlineQuote() { BstVM vm = new BstVM(""" FUNCTION { test } { preamble$ diff --git a/src/test/java/org/jabref/logic/bst/BstVMTest.java b/src/test/java/org/jabref/logic/bst/BstVMTest.java index 52a36b987d0..dca6030587c 100644 --- a/src/test/java/org/jabref/logic/bst/BstVMTest.java +++ b/src/test/java/org/jabref/logic/bst/BstVMTest.java @@ -30,7 +30,7 @@ public static BibEntry defaultTestEntry() { } @Test - public void testAbbrv() throws RecognitionException, IOException { + public void abbrv() throws RecognitionException, IOException { BstVM vm = new BstVM(Path.of("src/test/resources/org/jabref/logic/bst/abbrv.bst")); List testEntries = List.of(defaultTestEntry()); @@ -43,7 +43,7 @@ public void testAbbrv() throws RecognitionException, IOException { } @Test - public void testSimple() throws RecognitionException { + public void simple() throws RecognitionException { BstVM vm = new BstVM(""" ENTRY { address author title type } { } { label } INTEGERS { output.state before.all mid.sentence after.sentence after.block } @@ -68,7 +68,7 @@ public void testSimple() throws RecognitionException { } @Test - public void testLabel() throws RecognitionException { + public void label() throws RecognitionException { BstVM vm = new BstVM(""" ENTRY { title } {} { label } FUNCTION { test } { @@ -88,7 +88,7 @@ public void testLabel() throws RecognitionException { } @Test - public void testQuote() throws RecognitionException { + public void quote() throws RecognitionException { BstVM vm = new BstVM("FUNCTION { a }{ quote$ quote$ * } EXECUTE { a }"); vm.render(Collections.emptyList()); @@ -96,7 +96,7 @@ public void testQuote() throws RecognitionException { } @Test - public void testBuildIn() throws RecognitionException { + public void buildIn() throws RecognitionException { BstVM vm = new BstVM("EXECUTE { global.max$ }"); vm.render(Collections.emptyList()); @@ -106,7 +106,7 @@ public void testBuildIn() throws RecognitionException { } @Test - public void testVariables() throws RecognitionException { + public void variables() throws RecognitionException { BstVM vm = new BstVM(""" STRINGS { t } FUNCTION { not } { @@ -125,7 +125,7 @@ public void testVariables() throws RecognitionException { } @Test - public void testHypthenatedName() throws RecognitionException, IOException { + public void hypthenatedName() throws RecognitionException, IOException { BstVM vm = new BstVM(Path.of("src/test/resources/org/jabref/logic/bst/abbrv.bst")); List testEntries = List.of( new BibEntry(StandardEntryType.Article) @@ -139,7 +139,7 @@ public void testHypthenatedName() throws RecognitionException, IOException { } @Test - void testAbbrevStyleChopWord() { + void abbrevStyleChopWord() { BstVM vm = new BstVM(""" STRINGS { s } INTEGERS { len } @@ -175,7 +175,7 @@ void testAbbrevStyleChopWord() { } @Test - void testAbbrevStyleSortFormatTitle() { + void abbrevStyleSortFormatTitle() { BstVM vm = new BstVM(""" STRINGS { s t } INTEGERS { len } diff --git a/src/test/java/org/jabref/logic/bst/BstVMVisitorTest.java b/src/test/java/org/jabref/logic/bst/BstVMVisitorTest.java index 947e281227f..552ad596bde 100644 --- a/src/test/java/org/jabref/logic/bst/BstVMVisitorTest.java +++ b/src/test/java/org/jabref/logic/bst/BstVMVisitorTest.java @@ -21,7 +21,7 @@ class BstVMVisitorTest { @Test - public void testVisitStringsCommand() { + public void visitStringsCommand() { BstVM vm = new BstVM("STRINGS { test.string1 test.string2 test.string3 }"); vm.render(Collections.emptyList()); @@ -36,7 +36,7 @@ public void testVisitStringsCommand() { } @Test - public void testVisitIntegersCommand() { + public void visitIntegersCommand() { BstVM vm = new BstVM("INTEGERS { variable.a variable.b variable.c }"); vm.render(Collections.emptyList()); @@ -51,7 +51,7 @@ public void testVisitIntegersCommand() { } @Test - void testVisitFunctionCommand() { + void visitFunctionCommand() { BstVM vm = new BstVM(""" FUNCTION { test.func } { #1 'test.var := } EXECUTE { test.func } @@ -65,7 +65,7 @@ void testVisitFunctionCommand() { } @Test - void testVisitMacroCommand() { + void visitMacroCommand() { BstVM vm = new BstVM(""" MACRO { jan } { "January" } EXECUTE { jan } @@ -81,7 +81,7 @@ void testVisitMacroCommand() { } @Test - void testVisitEntryCommand() { + void visitEntryCommand() { BstVM vm = new BstVM("ENTRY { address author title type } { variable } { label }"); List testEntries = List.of(BstVMTest.defaultTestEntry()); @@ -98,7 +98,7 @@ void testVisitEntryCommand() { } @Test - void testVisitReadCommand() { + void visitReadCommand() { BstVM vm = new BstVM(""" ENTRY { author title booktitle year owner timestamp url } { } { } READ @@ -118,7 +118,7 @@ void testVisitReadCommand() { } @Test - public void testVisitExecuteCommand() throws RecognitionException { + public void visitExecuteCommand() throws RecognitionException { BstVM vm = new BstVM(""" INTEGERS { variable.a } FUNCTION { init.state.consts } { #5 'variable.a := } @@ -131,7 +131,7 @@ public void testVisitExecuteCommand() throws RecognitionException { } @Test - public void testVisitIterateCommand() throws RecognitionException { + public void visitIterateCommand() throws RecognitionException { BstVM vm = new BstVM(""" ENTRY { } { } { } FUNCTION { test } { cite$ } @@ -151,7 +151,7 @@ public void testVisitIterateCommand() throws RecognitionException { } @Test - public void testVisitReverseCommand() throws RecognitionException { + public void visitReverseCommand() throws RecognitionException { BstVM vm = new BstVM(""" ENTRY { } { } { } FUNCTION { test } { cite$ } @@ -171,7 +171,7 @@ public void testVisitReverseCommand() throws RecognitionException { } @Test - public void testVisitSortCommand() throws RecognitionException { + public void visitSortCommand() throws RecognitionException { BstVM vm = new BstVM(""" ENTRY { } { } { } FUNCTION { presort } { cite$ 'sort.key$ := } @@ -194,7 +194,7 @@ public void testVisitSortCommand() throws RecognitionException { } @Test - void testVisitIdentifier() { + void visitIdentifier() { BstVM vm = new BstVM(""" ENTRY { } { local.variable } { local.label } READ @@ -222,7 +222,7 @@ void testVisitIdentifier() { } @Test - void testVisitStackitem() { + void visitStackitem() { BstVM vm = new BstVM(""" STRINGS { t } FUNCTION { test2 } { #3 } diff --git a/src/test/java/org/jabref/logic/bst/util/BstCaseChangersTest.java b/src/test/java/org/jabref/logic/bst/util/BstCaseChangersTest.java index 3bf615093e4..1265c86302a 100644 --- a/src/test/java/org/jabref/logic/bst/util/BstCaseChangersTest.java +++ b/src/test/java/org/jabref/logic/bst/util/BstCaseChangersTest.java @@ -16,7 +16,7 @@ public class BstCaseChangersTest { @ParameterizedTest @MethodSource("provideStringsForTitleLowers") - public void testChangeCaseTitleLowers(String expected, String toBeFormatted) { + public void changeCaseTitleLowers(String expected, String toBeFormatted) { assertEquals(expected, BstCaseChanger.changeCase(toBeFormatted, FormatMode.TITLE_LOWERS)); } @@ -58,7 +58,7 @@ private static Stream provideStringsForTitleLowers() { @ParameterizedTest @MethodSource("provideStringsForAllLowers") - public void testChangeCaseAllLowers(String expected, String toBeFormatted) { + public void changeCaseAllLowers(String expected, String toBeFormatted) { assertEquals(expected, BstCaseChanger.changeCase(toBeFormatted, FormatMode.ALL_LOWERS)); } @@ -89,7 +89,7 @@ private static Stream provideStringsForAllLowers() { @ParameterizedTest @MethodSource("provideStringsForAllUppers") - public void testChangeCaseAllUppers(String expected, String toBeFormatted) { + public void changeCaseAllUppers(String expected, String toBeFormatted) { assertEquals(expected, BstCaseChanger.changeCase(toBeFormatted, FormatMode.ALL_UPPERS)); } @@ -120,7 +120,7 @@ private static Stream provideStringsForAllUppers() { @ParameterizedTest @MethodSource("provideTitleCaseAllLowers") - public void testTitleCaseAllLowers(String expected, String toBeFormatted) { + public void titleCaseAllLowers(String expected, String toBeFormatted) { assertEquals(expected, BstCaseChanger.changeCase(toBeFormatted, FormatMode.ALL_LOWERS)); } @@ -138,7 +138,7 @@ private static Stream provideTitleCaseAllLowers() { @Disabled @Test - public void testTitleCaseAllUppers() { + public void titleCaseAllUppers() { /* the real test would look like as follows. Also from the comment of issue 176, order reversed as the "should be" comes first */ // assertCaseChangerTitleUppers("This is a Simple Example {TITLE}", "This is a simple example {TITLE}"); // assertCaseChangerTitleUppers("This {IS} Another Simple Example Tit{LE}", "This {IS} another simple example tit{LE}"); diff --git a/src/test/java/org/jabref/logic/bst/util/BstNameFormatterTest.java b/src/test/java/org/jabref/logic/bst/util/BstNameFormatterTest.java index 4912af099bf..16caae557a2 100644 --- a/src/test/java/org/jabref/logic/bst/util/BstNameFormatterTest.java +++ b/src/test/java/org/jabref/logic/bst/util/BstNameFormatterTest.java @@ -9,7 +9,7 @@ public class BstNameFormatterTest { @Test - public void testUmlautsFullNames() { + public void umlautsFullNames() { AuthorList list = AuthorList.parse("Charles Louis Xavier Joseph de la Vall{\\'e}e Poussin"); assertEquals("de~laVall{\\'e}e~PoussinCharles Louis Xavier~Joseph", @@ -17,7 +17,7 @@ public void testUmlautsFullNames() { } @Test - public void testUmlautsAbbreviations() { + public void umlautsAbbreviations() { AuthorList list = AuthorList.parse("Charles Louis Xavier Joseph de la Vall{\\'e}e Poussin"); assertEquals("de~la Vall{\\'e}e~Poussin, C.~L. X.~J.", @@ -25,7 +25,7 @@ public void testUmlautsAbbreviations() { } @Test - public void testUmlautsAbbreviationsWithQuestionMark() { + public void umlautsAbbreviationsWithQuestionMark() { AuthorList list = AuthorList.parse("Charles Louis Xavier Joseph de la Vall{\\'e}e Poussin"); assertEquals("de~la Vall{\\'e}e~Poussin, C.~L. X.~J?", @@ -33,7 +33,7 @@ public void testUmlautsAbbreviationsWithQuestionMark() { } @Test - public void testFormatName() { + public void formatName() { AuthorList list = AuthorList.parse("Charles Louis Xavier Joseph de la Vall{\\'e}e Poussin"); assertEquals("dlVP", BstNameFormatter.formatName(list.getAuthor(0), "{v{}}{l{}}")); @@ -84,14 +84,14 @@ public void matchingBraceConsumedForBracesInWords() { } @Test - public void testConsumeToMatchingBrace() { + public void consumeToMatchingBrace() { StringBuilder sb = new StringBuilder(); assertEquals(10, BstNameFormatter.consumeToMatchingBrace(sb, "{HE{L{}L}O} {WORLD}".toCharArray(), 0)); assertEquals("{HE{L{}L}O}", sb.toString()); } @Test - public void testGetFirstCharOfString() { + public void getFirstCharOfString() { assertEquals("C", BstNameFormatter.getFirstCharOfString("Charles")); assertEquals("V", BstNameFormatter.getFirstCharOfString("Vall{\\'e}e")); assertEquals("{\\'e}", BstNameFormatter.getFirstCharOfString("{\\'e}")); @@ -100,7 +100,7 @@ public void testGetFirstCharOfString() { } @Test - public void testNumberOfChars() { + public void numberOfChars() { assertEquals(6, BstNameFormatter.numberOfChars("Vall{\\'e}e", -1)); assertEquals(2, BstNameFormatter.numberOfChars("Vall{\\'e}e", 2)); assertEquals(1, BstNameFormatter.numberOfChars("Vall{\\'e}e", 1)); diff --git a/src/test/java/org/jabref/logic/bst/util/BstPurifierTest.java b/src/test/java/org/jabref/logic/bst/util/BstPurifierTest.java index 295b735fd37..9bd094d7706 100644 --- a/src/test/java/org/jabref/logic/bst/util/BstPurifierTest.java +++ b/src/test/java/org/jabref/logic/bst/util/BstPurifierTest.java @@ -12,7 +12,7 @@ public class BstPurifierTest { @ParameterizedTest @MethodSource("provideTestStrings") - public void testPurify(String expected, String toBePurified) { + public void purify(String expected, String toBePurified) { assertEquals(expected, BstPurifier.purify(toBePurified)); } diff --git a/src/test/java/org/jabref/logic/bst/util/BstTextPrefixerTest.java b/src/test/java/org/jabref/logic/bst/util/BstTextPrefixerTest.java index cc857101822..bdab979539a 100644 --- a/src/test/java/org/jabref/logic/bst/util/BstTextPrefixerTest.java +++ b/src/test/java/org/jabref/logic/bst/util/BstTextPrefixerTest.java @@ -7,7 +7,7 @@ public class BstTextPrefixerTest { @Test - public void testPrefix() { + public void prefix() { assertPrefix("i", "i"); assertPrefix("0I~ ", "0I~ "); assertPrefix("Hi Hi", "Hi Hi "); diff --git a/src/test/java/org/jabref/logic/bst/util/BstWidthCalculatorTest.java b/src/test/java/org/jabref/logic/bst/util/BstWidthCalculatorTest.java index 30f2f6770e5..1c5dcfe324e 100644 --- a/src/test/java/org/jabref/logic/bst/util/BstWidthCalculatorTest.java +++ b/src/test/java/org/jabref/logic/bst/util/BstWidthCalculatorTest.java @@ -39,7 +39,7 @@ public class BstWidthCalculatorTest { @ParameterizedTest @MethodSource("provideTestWidth") - public void testWidth(int i, String str) { + public void width(int i, String str) { assertEquals(i, BstWidthCalculator.width(str)); } @@ -59,7 +59,7 @@ private static Stream provideTestWidth() { @ParameterizedTest @MethodSource("provideTestGetCharWidth") - public void testGetCharWidth(int i, Character c) { + public void getCharWidth(int i, Character c) { assertEquals(i, BstWidthCalculator.getCharWidth(c)); } diff --git a/src/test/java/org/jabref/logic/citationkeypattern/BracketedPatternTest.java b/src/test/java/org/jabref/logic/citationkeypattern/BracketedPatternTest.java index 6959dde3ce0..77c6b5d61ca 100644 --- a/src/test/java/org/jabref/logic/citationkeypattern/BracketedPatternTest.java +++ b/src/test/java/org/jabref/logic/citationkeypattern/BracketedPatternTest.java @@ -287,7 +287,7 @@ void authShort(String expected, AuthorList list) { "'Agency', '[authors]', 'European Union Aviation Safety Agency'", "'EUASA', '[authors]', '{European Union Aviation Safety Agency}'" }) - void testAuthorFieldMarkers(String expectedCitationKey, String pattern, String author) { + void authorFieldMarkers(String expectedCitationKey, String pattern, String author) { BibEntry bibEntry = new BibEntry().withField(StandardField.AUTHOR, author); BracketedPattern bracketedPattern = new BracketedPattern(pattern); assertEquals(expectedCitationKey, bracketedPattern.expand(bibEntry)); @@ -477,7 +477,7 @@ void lowerFormatterWorksOnVonNamePrefixes() { } @Test - void testResolvedFieldAndFormat() { + void resolvedFieldAndFormat() { BibEntry child = new BibEntry().withField(StandardField.CROSSREF, "HipKro03"); database.insertEntry(child); @@ -501,7 +501,7 @@ void testResolvedFieldAndFormat() { } @Test - void testResolvedParentNotInDatabase() { + void resolvedParentNotInDatabase() { BibEntry child = new BibEntry() .withField(StandardField.CROSSREF, "HipKro03"); database.removeEntry(dbentry); @@ -523,7 +523,7 @@ void regularExpressionWithBrackets() { } @Test - void testEmptyBrackets() { + void emptyBrackets() { assertEquals("2003-Organization Science", BracketedPattern.expandBrackets("[year][]-[journal]", ';', dbentry, database)); } @@ -678,7 +678,7 @@ void expandBracketsWithoutProtectiveBracesUsingUnprotectTermsModifier() { "'EUASA', '[editors]', '{European Union Aviation Safety Agency}'" }) - void testEditorFieldMarkers(String expectedCitationKey, String pattern, String editor) { + void editorFieldMarkers(String expectedCitationKey, String pattern, String editor) { BibEntry bibEntry = new BibEntry().withField(StandardField.EDITOR, editor); BracketedPattern bracketedPattern = new BracketedPattern(pattern); assertEquals(expectedCitationKey, bracketedPattern.expand(bibEntry)); diff --git a/src/test/java/org/jabref/logic/citationkeypattern/CitationKeyGeneratorTest.java b/src/test/java/org/jabref/logic/citationkeypattern/CitationKeyGeneratorTest.java index 5617337c855..3c43ccbb563 100644 --- a/src/test/java/org/jabref/logic/citationkeypattern/CitationKeyGeneratorTest.java +++ b/src/test/java/org/jabref/logic/citationkeypattern/CitationKeyGeneratorTest.java @@ -109,7 +109,7 @@ static String generateKey(BibEntry entry, String pattern, BibDatabase database) } @Test - void testAndInAuthorName() throws ParseException { + void andInAuthorName() throws ParseException { Optional entry0 = BibtexParser.singleFromString("@ARTICLE{kohn, author={Simon Holland}}", importFormatPreferences); assertEquals("Holland", @@ -118,7 +118,7 @@ void testAndInAuthorName() throws ParseException { } @Test - void testCrossrefAndInAuthorNames() { + void crossrefAndInAuthorNames() { BibDatabase database = new BibDatabase(); BibEntry entry1 = new BibEntry().withField(StandardField.CROSSREF, "entry2"); BibEntry entry2 = new BibEntry() @@ -133,7 +133,7 @@ void testCrossrefAndInAuthorNames() { } @Test - void testAndAuthorNames() throws ParseException { + void andAuthorNames() throws ParseException { String bibtexString = "@ARTICLE{whatevery, author={Mari D. Herland and Mona-Iren Hauge and Ingeborg M. Helgeland}}"; Optional entry = BibtexParser.singleFromString(bibtexString, importFormatPreferences); assertEquals("HerlandHaugeHelgeland", @@ -142,7 +142,7 @@ void testAndAuthorNames() throws ParseException { } @Test - void testCrossrefAndAuthorNames() { + void crossrefAndAuthorNames() { BibDatabase database = new BibDatabase(); BibEntry entry1 = new BibEntry() .withField(StandardField.CROSSREF, "entry2"); @@ -158,7 +158,7 @@ void testCrossrefAndAuthorNames() { } @Test - void testSpecialLatexCharacterInAuthorName() throws ParseException { + void specialLatexCharacterInAuthorName() throws ParseException { Optional entry = BibtexParser.singleFromString( "@ARTICLE{kohn, author={Simon Popovi\\v{c}ov\\'{a}}}", importFormatPreferences); assertEquals("Popovicova", @@ -197,7 +197,7 @@ void testSpecialLatexCharacterInAuthorName() throws ParseException { "@ARTICLE{kohn, author={Andrés Aʹrnold}, year={2000}}", "Arn" """ ) - void testMakeLabelAndCheckLegalKeys(String bibtexString, String expectedResult) throws ParseException { + void makeLabelAndCheckLegalKeys(String bibtexString, String expectedResult) throws ParseException { Optional bibEntry = BibtexParser.singleFromString(bibtexString, importFormatPreferences); String citationKey = generateKey(bibEntry.orElse(null), "[auth3]", new BibDatabase()); @@ -207,7 +207,7 @@ void testMakeLabelAndCheckLegalKeys(String bibtexString, String expectedResult) } @Test - void testFirstAuthor() { + void firstAuthor() { assertEquals("Newton", generateKey(AUTHOR_FIRSTNAME_INITIAL_LASTNAME_FULL_COUNT_5, "[auth]")); assertEquals("Newton", generateKey(AUTHOR_FIRSTNAME_INITIAL_LASTNAME_FULL_COUNT_1, "[auth]")); @@ -218,7 +218,7 @@ void testFirstAuthor() { } @Test - void testUniversity() throws ParseException { + void university() throws ParseException { Optional entry = BibtexParser.singleFromString( "@ARTICLE{kohn, author={{Link{\\\"{o}}ping University}}}", importFormatPreferences); assertEquals("UniLinkoeping", @@ -264,12 +264,12 @@ void testUniversity() throws ParseException { "Ḍ ḍ Ḥ ḥ Ḷ ḷ Ḹ ḹ Ṃ ṃ Ṇ ṇ Ṛ ṛ Ṝ ṝ Ṣ ṣ Ṭ ṭ ", "DdHhLlLlMmNnRrRrSsTt" """ ) - void testCheckLegalKey(String accents, String expectedResult) { + void checkLegalKey(String accents, String expectedResult) { assertEquals(expectedResult, CitationKeyGenerator.cleanKey(accents, DEFAULT_UNWANTED_CHARACTERS)); } @Test - void testcrossrefUniversity() { + void crossrefUniversity() { BibDatabase database = new BibDatabase(); BibEntry entry1 = new BibEntry() .withField(StandardField.CROSSREF, "entry2"); @@ -285,7 +285,7 @@ void testcrossrefUniversity() { } @Test - void testDepartment() throws ParseException { + void department() throws ParseException { Optional entry = BibtexParser.singleFromString( "@ARTICLE{kohn, author={{Link{\\\"{o}}ping University, Department of Electrical Engineering}}}", importFormatPreferences); @@ -295,7 +295,7 @@ void testDepartment() throws ParseException { } @Test - void testcrossrefDepartment() { + void crossrefDepartment() { BibDatabase database = new BibDatabase(); BibEntry entry1 = new BibEntry() .withField(StandardField.CROSSREF, "entry2"); @@ -311,7 +311,7 @@ void testcrossrefDepartment() { } @Test - void testSchool() throws ParseException { + void school() throws ParseException { Optional entry = BibtexParser.singleFromString( "@ARTICLE{kohn, author={{Link{\\\"{o}}ping University, School of Computer Engineering}}}", importFormatPreferences); @@ -341,7 +341,7 @@ void generateKeyAbbreviateCorporateAuthorSchoolWithoutAcademicInstitute() throws } @Test - void testcrossrefSchool() { + void crossrefSchool() { BibDatabase database = new BibDatabase(); BibEntry entry1 = new BibEntry() .withField(StandardField.CROSSREF, "entry2"); @@ -357,7 +357,7 @@ void testcrossrefSchool() { } @Test - void testInstituteOfTechnology() throws ParseException { + void instituteOfTechnology() throws ParseException { Optional entry = BibtexParser.singleFromString( "@ARTICLE{kohn, author={{Massachusetts Institute of Technology}}}", importFormatPreferences); assertEquals("MIT", @@ -366,7 +366,7 @@ void testInstituteOfTechnology() throws ParseException { } @Test - void testcrossrefInstituteOfTechnology() { + void crossrefInstituteOfTechnology() { BibDatabase database = new BibDatabase(); BibEntry entry1 = new BibEntry() .withField(StandardField.CROSSREF, "entry2"); @@ -382,7 +382,7 @@ void testcrossrefInstituteOfTechnology() { } @Test - void testAuthIniN() { + void authIniN() { assertEquals("", generateKey(AUTHOR_EMPTY, "[authIni4]")); assertEquals("Newt", generateKey(AUTHOR_FIRSTNAME_INITIAL_LASTNAME_FULL_COUNT_1, "[authIni4]")); assertEquals("NeMa", generateKey(AUTHOR_FIRSTNAME_INITIAL_LASTNAME_FULL_COUNT_2, "[authIni4]")); @@ -398,7 +398,7 @@ void testAuthIniN() { } @Test - void testAuthIniNEmptyReturnsEmpty() { + void authIniNEmptyReturnsEmpty() { assertEquals("", generateKey(AUTHOR_EMPTY, "[authIni1]")); } @@ -413,7 +413,7 @@ void authAuthEa() { } @Test - void testAuthEaEmptyReturnsEmpty() { + void authEaEmptyReturnsEmpty() { assertEquals("", generateKey(AUTHOR_EMPTY, AUTHAUTHEA)); } @@ -421,7 +421,7 @@ void testAuthEaEmptyReturnsEmpty() { * Tests the [auth.etal] and [authEtAl] patterns */ @Test - void testAuthEtAl() { + void authEtAl() { // tests taken from the comments // [auth.etal] @@ -437,7 +437,7 @@ void testAuthEtAl() { * Test the [authshort] pattern */ @Test - void testAuthShort() { + void authShort() { // tests taken from the comments assertEquals("NME+", generateKey(AUTHOR_FIRSTNAME_INITIAL_LASTNAME_FULL_COUNT_4, AUTHSHORT)); assertEquals("NME", generateKey(AUTHOR_FIRSTNAME_INITIAL_LASTNAME_FULL_COUNT_3, AUTHSHORT)); @@ -446,7 +446,7 @@ void testAuthShort() { } @Test - void testAuthShortEmptyReturnsEmpty() { + void authShortEmptyReturnsEmpty() { assertEquals("", generateKey(AUTHOR_EMPTY, AUTHSHORT)); } @@ -497,13 +497,13 @@ void firstAuthorVonAndLastNoVonInName() { * Tests [authors] */ @Test - void testAllAuthors() { + void allAuthors() { assertEquals("Newton", generateKey(AUTHOR_FIRSTNAME_INITIAL_LASTNAME_FULL_COUNT_1, AUTHORS)); assertEquals("NewtonMaxwell", generateKey(AUTHOR_FIRSTNAME_INITIAL_LASTNAME_FULL_COUNT_2, AUTHORS)); assertEquals("NewtonMaxwellEinstein", generateKey(AUTHOR_FIRSTNAME_INITIAL_LASTNAME_FULL_COUNT_3, AUTHORS)); } - static Stream testAuthorsAlpha() { + static Stream authorsAlpha() { return Stream.of( Arguments.of("New", AUTHOR_FIRSTNAME_INITIAL_LASTNAME_FULL_COUNT_1, AUTHORSALPHA), Arguments.of("NM", AUTHOR_FIRSTNAME_INITIAL_LASTNAME_FULL_COUNT_2, AUTHORSALPHA), @@ -518,7 +518,7 @@ static Stream testAuthorsAlpha() { @ParameterizedTest @MethodSource - void testAuthorsAlpha(String expected, BibEntry entry, String pattern) { + void authorsAlpha(String expected, BibEntry entry, String pattern) { assertEquals(expected, generateKey(entry, pattern)); } @@ -571,7 +571,7 @@ void oneAuthorPlusIni() { * Tests the [authorsN] pattern. -> [authors1] */ @Test - void testNAuthors1() { + void nAuthors1() { assertEquals("Newton", generateKey(AUTHOR_FIRSTNAME_INITIAL_LASTNAME_FULL_COUNT_1, AUTHORN.formatted(1))); assertEquals("NewtonEtAl", generateKey(AUTHOR_FIRSTNAME_INITIAL_LASTNAME_FULL_COUNT_2, AUTHORN.formatted(1))); assertEquals("NewtonEtAl", generateKey(AUTHOR_FIRSTNAME_INITIAL_LASTNAME_FULL_COUNT_3, AUTHORN.formatted(1))); @@ -579,7 +579,7 @@ void testNAuthors1() { } @Test - void testNAuthors1EmptyReturnEmpty() { + void nAuthors1EmptyReturnEmpty() { assertEquals("", generateKey(AUTHOR_EMPTY, AUTHORN.formatted(1))); } @@ -587,7 +587,7 @@ void testNAuthors1EmptyReturnEmpty() { * Tests the [authorsN] pattern. -> [authors3] */ @Test - void testNAuthors3() { + void nAuthors3() { assertEquals("Newton", generateKey(AUTHOR_FIRSTNAME_INITIAL_LASTNAME_FULL_COUNT_1, AUTHORN.formatted(3))); assertEquals("NewtonMaxwell", @@ -599,7 +599,7 @@ void testNAuthors3() { } @Test - void testFirstPage() { + void firstPage() { assertEquals("7", CitationKeyGenerator.firstPage("7--27")); assertEquals("27", CitationKeyGenerator.firstPage("--27")); assertEquals("", CitationKeyGenerator.firstPage("")); @@ -611,12 +611,12 @@ void testFirstPage() { @SuppressWarnings("ConstantConditions") @Test - void testFirstPageNull() { + void firstPageNull() { assertThrows(NullPointerException.class, () -> CitationKeyGenerator.firstPage(null)); } @Test - void testPagePrefix() { + void pagePrefix() { assertEquals("L", CitationKeyGenerator.pagePrefix("L7--27")); assertEquals("L--", CitationKeyGenerator.pagePrefix("L--27")); assertEquals("L", CitationKeyGenerator.pagePrefix("L")); @@ -635,12 +635,12 @@ void testPagePrefix() { @SuppressWarnings("ConstantConditions") @Test - void testPagePrefixNull() { + void pagePrefixNull() { assertThrows(NullPointerException.class, () -> CitationKeyGenerator.pagePrefix(null)); } @Test - void testLastPage() { + void lastPage() { assertEquals("27", CitationKeyGenerator.lastPage("7--27")); assertEquals("27", CitationKeyGenerator.lastPage("--27")); assertEquals("", CitationKeyGenerator.lastPage("")); @@ -654,7 +654,7 @@ void testLastPage() { @SuppressWarnings("ConstantConditions") @Test - void testLastPageNull() { + void lastPageNull() { assertThrows(NullPointerException.class, () -> CitationKeyGenerator.lastPage(null)); } @@ -835,27 +835,27 @@ void crossrefkeywordsNKeywordsSeparatedBySpace() { } @Test - void testCheckLegalKeyUnwantedCharacters() { + void checkLegalKeyUnwantedCharacters() { assertEquals("AAAA", CitationKeyGenerator.cleanKey("AA AA", DEFAULT_UNWANTED_CHARACTERS)); assertEquals("SPECIALCHARS", CitationKeyGenerator.cleanKey("SPECIAL CHARS#{\\\"}~,", DEFAULT_UNWANTED_CHARACTERS)); assertEquals("", CitationKeyGenerator.cleanKey("\n\t\r", DEFAULT_UNWANTED_CHARACTERS)); } @Test - void testCheckLegalKeyNoUnwantedCharacters() { + void checkLegalKeyNoUnwantedCharacters() { assertEquals("AAAA", CitationKeyGenerator.cleanKey("AA AA", "")); assertEquals("SPECIALCHARS^", CitationKeyGenerator.cleanKey("SPECIAL CHARS#{\\\"}~,^", "")); assertEquals("", CitationKeyGenerator.cleanKey("\n\t\r", "")); } @Test - void testCheckLegalNullInNullOut() { + void checkLegalNullInNullOut() { assertThrows(NullPointerException.class, () -> CitationKeyGenerator.cleanKey(null, DEFAULT_UNWANTED_CHARACTERS)); assertThrows(NullPointerException.class, () -> CitationKeyGenerator.cleanKey(null, DEFAULT_UNWANTED_CHARACTERS)); } @Test - void testApplyModifiers() { + void applyModifiers() { BibEntry entry = new BibEntry().withField(StandardField.TITLE, "Green Scheduling of Whatever"); assertEquals("GSo", generateKey(entry, "[shorttitleINI]")); assertEquals("GreenSchedulingWhatever", generateKey(entry, "[shorttitle]", @@ -863,7 +863,7 @@ void testApplyModifiers() { } @Test - void testcrossrefShorttitle() { + void crossrefShorttitle() { BibDatabase database = new BibDatabase(); BibEntry entry1 = new BibEntry() .withField(StandardField.CROSSREF, "entry2"); @@ -878,7 +878,7 @@ void testcrossrefShorttitle() { } @Test - void testcrossrefShorttitleInitials() { + void crossrefShorttitleInitials() { BibDatabase database = new BibDatabase(); BibEntry entry1 = new BibEntry() .withField(StandardField.CROSSREF, "entry2"); diff --git a/src/test/java/org/jabref/logic/citationstyle/CitationStyleGeneratorTest.java b/src/test/java/org/jabref/logic/citationstyle/CitationStyleGeneratorTest.java index a6694088d99..74ff9d25f81 100644 --- a/src/test/java/org/jabref/logic/citationstyle/CitationStyleGeneratorTest.java +++ b/src/test/java/org/jabref/logic/citationstyle/CitationStyleGeneratorTest.java @@ -25,7 +25,7 @@ class CitationStyleGeneratorTest { private final BibEntryTypesManager bibEntryTypesManager = new BibEntryTypesManager(); @Test - void testACMCitation() { + void aCMCitation() { BibDatabaseContext context = new BibDatabaseContext(new BibDatabase(List.of(TestEntry.getTestEntry()))); context.setMode(BibDatabaseMode.BIBLATEX); List styleList = CitationStyle.discoverCitationStyles(); @@ -42,7 +42,7 @@ void testACMCitation() { } @Test - void testAPACitation() { + void aPACitation() { BibDatabaseContext context = new BibDatabaseContext(new BibDatabase(List.of(TestEntry.getTestEntry()))); context.setMode(BibDatabaseMode.BIBLATEX); List styleList = CitationStyle.discoverCitationStyles(); @@ -59,7 +59,7 @@ void testAPACitation() { } @Test - void testIgnoreNewLine() { + void ignoreNewLine() { BibEntry entry = new BibEntry(); entry.setField(StandardField.AUTHOR, "Last, First and\nDoe, Jane"); @@ -72,7 +72,7 @@ void testIgnoreNewLine() { } @Test - void testIgnoreCarriageReturnNewLine() { + void ignoreCarriageReturnNewLine() { BibEntry entry = new BibEntry(); entry.setField(StandardField.AUTHOR, "Last, First and\r\nDoe, Jane"); @@ -85,14 +85,14 @@ void testIgnoreCarriageReturnNewLine() { } @Test - void testMissingCitationStyle() { + void missingCitationStyle() { String expected = Localization.lang("Cannot generate preview based on selected citation style."); String citation = CitationStyleGenerator.generateCitation(new BibEntry(), "faulty citation style", bibEntryTypesManager); assertEquals(expected, citation); } @Test - void testHtmlFormat() { + void htmlFormat() { String expectedCitation = "
\n" + "
[1]
B. Smith, B. Jones, and J. Williams, “Title of the test entry,” BibTeX Journal, vol. 34, no. 3, pp. 45–67, Jul. 2016, doi: 10.1001/bla.blubb.
\n" + "
\n"; @@ -106,7 +106,7 @@ void testHtmlFormat() { } @Test - void testTextFormat() { + void textFormat() { String expectedCitation = "[1]B. Smith, B. Jones, and J. Williams, “Title of the test entry,” BibTeX Journal, vol. 34, no. 3, pp. 45–67, Jul. 2016, doi: 10.1001/bla.blubb.\n"; BibEntry entry = TestEntry.getTestEntry(); @@ -118,7 +118,7 @@ void testTextFormat() { } @Test - void testHandleDiacritics() { + void handleDiacritics() { BibEntry entry = new BibEntry(); // We need to escape the backslash as well, because the slash is part of the LaTeX expression entry.setField(StandardField.AUTHOR, "L{\\\"a}st, First and Doe, Jane"); @@ -132,7 +132,7 @@ void testHandleDiacritics() { } @Test - void testHandleAmpersand() { + void handleAmpersand() { String expectedCitation = "[1]B. Smith, B. Jones, and J. Williams, “Famous quote: “&TitleTest&” - that is it,” BibTeX Journal, vol. 34, no. 3, pp. 45–67, Jul. 2016, doi: 10.1001/bla.blubb.\n"; BibEntry entry = TestEntry.getTestEntry(); entry.setField(StandardField.TITLE, "Famous quote: “&TitleTest&” - that is it"); @@ -144,7 +144,7 @@ void testHandleAmpersand() { } @Test - void testHandleCrossRefFields() { + void handleCrossRefFields() { BibEntry firstEntry = new BibEntry(StandardEntryType.InCollection) .withCitationKey("smit2021") .withField(StandardField.AUTHOR, "Smith, Bob") @@ -168,7 +168,7 @@ void testHandleCrossRefFields() { assertEquals(expectedCitation, actualCitation); } - static Stream testCslMapping() { + static Stream cslMapping() { // if the default citation style changes this has to be modified return Stream.of( Arguments.of( @@ -574,7 +574,7 @@ static Stream testCslMapping() { @ParameterizedTest @MethodSource - void testCslMapping(String expected, BibDatabaseMode mode, BibEntry entry, String cslFileName) throws Exception { + void cslMapping(String expected, BibDatabaseMode mode, BibEntry entry, String cslFileName) throws Exception { BibDatabaseContext bibDatabaseContext = new BibDatabaseContext(new BibDatabase(List.of(entry))); bibDatabaseContext.setMode(mode); diff --git a/src/test/java/org/jabref/logic/citationstyle/CitationStyleTest.java b/src/test/java/org/jabref/logic/citationstyle/CitationStyleTest.java index 6bdbac10b98..9e1d0b55a16 100644 --- a/src/test/java/org/jabref/logic/citationstyle/CitationStyleTest.java +++ b/src/test/java/org/jabref/logic/citationstyle/CitationStyleTest.java @@ -21,7 +21,7 @@ void getDefault() throws Exception { } @Test - void testDefaultCitation() { + void defaultCitation() { BibDatabaseContext context = new BibDatabaseContext(new BibDatabase(List.of(TestEntry.getTestEntry()))); context.setMode(BibDatabaseMode.BIBLATEX); String citation = CitationStyleGenerator.generateCitation(TestEntry.getTestEntry(), CitationStyle.getDefault().getSource(), CitationStyleOutputFormat.HTML, context, new BibEntryTypesManager()); @@ -37,7 +37,7 @@ void testDefaultCitation() { } @Test - void testDiscoverCitationStylesNotNull() throws Exception { + void discoverCitationStylesNotNull() throws Exception { List styleList = CitationStyle.discoverCitationStyles(); assertNotNull(styleList); } diff --git a/src/test/java/org/jabref/logic/cleanup/DoiCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/DoiCleanupTest.java index 10373808718..aa64e11b093 100644 --- a/src/test/java/org/jabref/logic/cleanup/DoiCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/DoiCleanupTest.java @@ -16,7 +16,7 @@ public class DoiCleanupTest { @ParameterizedTest @MethodSource("provideDoiForAllLowers") - public void testChangeDoi(BibEntry expected, BibEntry doiInfoField) { + public void changeDoi(BibEntry expected, BibEntry doiInfoField) { DoiCleanup cleanUp = new DoiCleanup(); cleanUp.cleanup(doiInfoField); diff --git a/src/test/java/org/jabref/logic/cleanup/DoiDecodeCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/DoiDecodeCleanupTest.java index b07904b2719..15a52614eb7 100644 --- a/src/test/java/org/jabref/logic/cleanup/DoiDecodeCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/DoiDecodeCleanupTest.java @@ -16,7 +16,7 @@ public class DoiDecodeCleanupTest { @ParameterizedTest @MethodSource("provideDoiForAllLowers") - public void testChangeDoi(BibEntry expected, BibEntry doiInfoField) { + public void changeDoi(BibEntry expected, BibEntry doiInfoField) { DoiCleanup cleanUp = new DoiCleanup(); cleanUp.cleanup(doiInfoField); diff --git a/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java index 27cbd8d322d..f8bbad52acd 100644 --- a/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/FieldFormatterCleanupTest.java @@ -38,7 +38,7 @@ public void setUp() { } @Test - public void testInternalAllField() throws Exception { + public void internalAllField() throws Exception { FieldFormatterCleanup cleanup = new FieldFormatterCleanup(InternalField.INTERNAL_ALL_FIELD, new UpperCaseFormatter()); cleanup.cleanup(entry); @@ -52,7 +52,7 @@ public void testInternalAllField() throws Exception { } @Test - public void testInternalAllTextFieldsField() throws Exception { + public void internalAllTextFieldsField() throws Exception { FieldFormatterCleanup cleanup = new FieldFormatterCleanup(InternalField.INTERNAL_ALL_TEXT_FIELDS_FIELD, new UpperCaseFormatter()); cleanup.cleanup(entry); @@ -66,7 +66,7 @@ public void testInternalAllTextFieldsField() throws Exception { } @Test - public void testCleanupAllFieldsIgnoresKeyField() throws Exception { + public void cleanupAllFieldsIgnoresKeyField() throws Exception { FieldFormatterCleanup cleanup = new FieldFormatterCleanup(InternalField.INTERNAL_ALL_FIELD, new UnicodeToLatexFormatter()); entry.setField(InternalField.KEY_FIELD, "François-Marie Arouet"); // Contains ç, not in Basic Latin cleanup.cleanup(entry); @@ -75,7 +75,7 @@ public void testCleanupAllFieldsIgnoresKeyField() throws Exception { } @Test - public void testCleanupAllTextFieldsIgnoresKeyField() throws Exception { + public void cleanupAllTextFieldsIgnoresKeyField() throws Exception { FieldFormatterCleanup cleanup = new FieldFormatterCleanup(InternalField.INTERNAL_ALL_TEXT_FIELDS_FIELD, new UnicodeToLatexFormatter()); entry.setField(InternalField.KEY_FIELD, "François-Marie Arouet"); // Contains ç, not in Basic Latin cleanup.cleanup(entry); @@ -84,7 +84,7 @@ public void testCleanupAllTextFieldsIgnoresKeyField() throws Exception { } @Test - public void testCleanupKeyFieldCleansUpKeyField() throws Exception { + public void cleanupKeyFieldCleansUpKeyField() throws Exception { FieldFormatterCleanup cleanup = new FieldFormatterCleanup(InternalField.KEY_FIELD, new UnicodeToLatexFormatter()); entry.setField(InternalField.KEY_FIELD, "François-Marie Arouet"); // Contains ç, not in Basic Latin cleanup.cleanup(entry); diff --git a/src/test/java/org/jabref/logic/cleanup/URLCleanupTest.java b/src/test/java/org/jabref/logic/cleanup/URLCleanupTest.java index 0a75b64b359..6242021cfdb 100644 --- a/src/test/java/org/jabref/logic/cleanup/URLCleanupTest.java +++ b/src/test/java/org/jabref/logic/cleanup/URLCleanupTest.java @@ -15,7 +15,7 @@ public class URLCleanupTest { @ParameterizedTest @MethodSource("provideURL") - public void testChangeURL(BibEntry expected, BibEntry urlInputField) { + public void changeURL(BibEntry expected, BibEntry urlInputField) { URLCleanup cleanUp = new URLCleanup(); cleanUp.cleanup(urlInputField); diff --git a/src/test/java/org/jabref/logic/crawler/CrawlerTest.java b/src/test/java/org/jabref/logic/crawler/CrawlerTest.java index 3bb915cf568..65a05e2404d 100644 --- a/src/test/java/org/jabref/logic/crawler/CrawlerTest.java +++ b/src/test/java/org/jabref/logic/crawler/CrawlerTest.java @@ -101,7 +101,7 @@ private void setUpTestStudyDefinitionFile() throws Exception { } @Test - public void testWhetherAllFilesAreCreated() throws Exception { + public void whetherAllFilesAreCreated() throws Exception { Crawler testCrawler = new Crawler(getPathToStudyDefinitionFile(), gitHandler, preferencesService, diff --git a/src/test/java/org/jabref/logic/database/DuplicateCheckTest.java b/src/test/java/org/jabref/logic/database/DuplicateCheckTest.java index 39741898087..587dbbef368 100644 --- a/src/test/java/org/jabref/logic/database/DuplicateCheckTest.java +++ b/src/test/java/org/jabref/logic/database/DuplicateCheckTest.java @@ -71,7 +71,7 @@ public void setUp() { } @Test - public void testDuplicateDetectionWithSameAuthor() { + public void duplicateDetectionWithSameAuthor() { BibEntry one = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Billy Bob"); BibEntry two = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Billy Bob"); @@ -79,7 +79,7 @@ public void testDuplicateDetectionWithSameAuthor() { } @Test - public void testDuplicateDetectionWithSameAuthorAndUmlauts() { + public void duplicateDetectionWithSameAuthorAndUmlauts() { BibEntry one = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Billy Bobä"); BibEntry two = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Bill{\\\"{a}} Bob{\\\"{a}}"); @@ -87,7 +87,7 @@ public void testDuplicateDetectionWithSameAuthorAndUmlauts() { } @Test - public void testDuplicateDetectionWithDifferentAuthors() { + public void duplicateDetectionWithDifferentAuthors() { BibEntry one = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Billy Bob"); BibEntry two = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "James Joyce"); @@ -95,7 +95,7 @@ public void testDuplicateDetectionWithDifferentAuthors() { } @Test - public void testDuplicateDetectionWithDifferentTypes() { + public void duplicateDetectionWithDifferentTypes() { BibEntry one = new BibEntry(StandardEntryType.Article).withField(StandardField.AUTHOR, "Billy Bob"); BibEntry two = new BibEntry(StandardEntryType.Book).withField(StandardField.AUTHOR, "Billy Bob"); @@ -103,7 +103,7 @@ public void testDuplicateDetectionWithDifferentTypes() { } @Test - public void testDuplicateDetectionWithSameYearTitleJournal() { + public void duplicateDetectionWithSameYearTitleJournal() { BibEntry one = new BibEntry(StandardEntryType.Article) .withField(StandardField.AUTHOR, "Billy Bob") .withField(StandardField.YEAR, "2005") @@ -121,7 +121,7 @@ public void testDuplicateDetectionWithSameYearTitleJournal() { } @Test - public void testDuplicateDetectionWithDifferentJournal() { + public void duplicateDetectionWithDifferentJournal() { BibEntry one = new BibEntry(StandardEntryType.Article) .withField(StandardField.AUTHOR, "Billy Bob") .withField(StandardField.YEAR, "2005") @@ -139,7 +139,7 @@ public void testDuplicateDetectionWithDifferentJournal() { } @Test - public void testDuplicateDetectionWithDifferentVolume() { + public void duplicateDetectionWithDifferentVolume() { BibEntry one = new BibEntry(StandardEntryType.Article) .withField(StandardField.AUTHOR, "Billy Bob") .withField(StandardField.YEAR, "2005") @@ -160,7 +160,7 @@ public void testDuplicateDetectionWithDifferentVolume() { } @Test - public void testDuplicateDetectionWithDifferentTitleSameVolume() { + public void duplicateDetectionWithDifferentTitleSameVolume() { BibEntry one = new BibEntry(StandardEntryType.Article) .withField(StandardField.AUTHOR, "Billy Bob") .withField(StandardField.YEAR, "2005") @@ -181,7 +181,7 @@ public void testDuplicateDetectionWithDifferentTitleSameVolume() { } @Test - public void testDuplicateDetectionWithSamePages() { + public void duplicateDetectionWithSamePages() { BibEntry one = new BibEntry(StandardEntryType.Article) .withField(StandardField.AUTHOR, "Billy Bob") .withField(StandardField.YEAR, "2005") @@ -204,7 +204,7 @@ public void testDuplicateDetectionWithSamePages() { } @Test - public void testDuplicateDetectionWithSamePagesOneEntryNoVolume() { + public void duplicateDetectionWithSamePagesOneEntryNoVolume() { BibEntry one = new BibEntry(StandardEntryType.Article) .withField(StandardField.AUTHOR, "Billy Bob") .withField(StandardField.YEAR, "2005") @@ -226,7 +226,7 @@ public void testDuplicateDetectionWithSamePagesOneEntryNoVolume() { } @Test - public void testDuplicateDetectionDifferentVolumeNoJournal() { + public void duplicateDetectionDifferentVolumeNoJournal() { BibEntry one = new BibEntry(StandardEntryType.Article) .withField(StandardField.AUTHOR, "Billy Bob") .withField(StandardField.YEAR, "2005") @@ -247,7 +247,7 @@ public void testDuplicateDetectionDifferentVolumeNoJournal() { } @Test - public void testDuplicateDetectionDifferentTitleNoJournal() { + public void duplicateDetectionDifferentTitleNoJournal() { BibEntry one = new BibEntry(StandardEntryType.Article) .withField(StandardField.AUTHOR, "Billy Bob") .withField(StandardField.YEAR, "2005") @@ -268,7 +268,7 @@ public void testDuplicateDetectionDifferentTitleNoJournal() { } @Test - public void testDuplicateDetectionDifferentVolumeAllOthersEqual() { + public void duplicateDetectionDifferentVolumeAllOthersEqual() { BibEntry one = new BibEntry(StandardEntryType.Article) .withField(StandardField.AUTHOR, "Billy Bob") .withField(StandardField.YEAR, "2005") @@ -291,7 +291,7 @@ public void testDuplicateDetectionDifferentVolumeAllOthersEqual() { } @Test - public void testDuplicateDetectionDifferentVolumeDifferentJournalAllOthersEqual() { + public void duplicateDetectionDifferentVolumeDifferentJournalAllOthersEqual() { BibEntry one = new BibEntry(StandardEntryType.Article) .withField(StandardField.AUTHOR, "Billy Bob") .withField(StandardField.YEAR, "2005") @@ -314,7 +314,7 @@ public void testDuplicateDetectionDifferentVolumeDifferentJournalAllOthersEqual( } @Test - public void testWordCorrelation() { + public void wordCorrelation() { String d1 = "Characterization of Calanus finmarchicus habitat in the North Sea"; String d2 = "Characterization of Calunus finmarchicus habitat in the North Sea"; String d3 = "Characterization of Calanus glacialissss habitat in the South Sea"; diff --git a/src/test/java/org/jabref/logic/exporter/CsvExportFormatTest.java b/src/test/java/org/jabref/logic/exporter/CsvExportFormatTest.java index 53342e7d7fa..8366cc64fff 100644 --- a/src/test/java/org/jabref/logic/exporter/CsvExportFormatTest.java +++ b/src/test/java/org/jabref/logic/exporter/CsvExportFormatTest.java @@ -46,7 +46,7 @@ public void tearDown() { } @Test - public void testPerformExportForSingleAuthor(@TempDir Path testFolder) throws Exception { + public void performExportForSingleAuthor(@TempDir Path testFolder) throws Exception { Path path = testFolder.resolve("ThisIsARandomlyNamedFile"); BibEntry entry = new BibEntry().withField(StandardField.AUTHOR, "Someone, Van Something"); @@ -62,7 +62,7 @@ public void testPerformExportForSingleAuthor(@TempDir Path testFolder) throws Ex } @Test - public void testPerformExportForMultipleAuthors(@TempDir Path testFolder) throws Exception { + public void performExportForMultipleAuthors(@TempDir Path testFolder) throws Exception { Path path = testFolder.resolve("ThisIsARandomlyNamedFile"); BibEntry entry = new BibEntry().withField(StandardField.AUTHOR, "von Neumann, John and Smith, John and Black Brown, Peter"); @@ -78,7 +78,7 @@ public void testPerformExportForMultipleAuthors(@TempDir Path testFolder) throws } @Test - public void testPerformExportForSingleEditor(@TempDir Path testFolder) throws Exception { + public void performExportForSingleEditor(@TempDir Path testFolder) throws Exception { Path path = testFolder.resolve("ThisIsARandomlyNamedFile"); File tmpFile = path.toFile(); BibEntry entry = new BibEntry().withField(StandardField.EDITOR, "Someone, Van Something"); @@ -94,7 +94,7 @@ public void testPerformExportForSingleEditor(@TempDir Path testFolder) throws Ex } @Test - public void testPerformExportForMultipleEditors(@TempDir Path testFolder) throws Exception { + public void performExportForMultipleEditors(@TempDir Path testFolder) throws Exception { Path path = testFolder.resolve("ThisIsARandomlyNamedFile"); File tmpFile = path.toFile(); BibEntry entry = new BibEntry() diff --git a/src/test/java/org/jabref/logic/exporter/DocBook5ExporterTest.java b/src/test/java/org/jabref/logic/exporter/DocBook5ExporterTest.java index 07877f9c255..d3dbc1c0c86 100644 --- a/src/test/java/org/jabref/logic/exporter/DocBook5ExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/DocBook5ExporterTest.java @@ -66,7 +66,7 @@ void setUp() throws URISyntaxException { } @Test - void testPerformExportForSingleEntry(@TempDir Path testFolder) throws Exception { + void performExportForSingleEntry(@TempDir Path testFolder) throws Exception { Path path = testFolder.resolve("ThisIsARandomlyNamedFile"); exporter.export(databaseContext, path, entries); diff --git a/src/test/java/org/jabref/logic/exporter/DocbookExporterTest.java b/src/test/java/org/jabref/logic/exporter/DocbookExporterTest.java index 23221d0311a..64564cfab6c 100644 --- a/src/test/java/org/jabref/logic/exporter/DocbookExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/DocbookExporterTest.java @@ -42,7 +42,7 @@ public void setUp() { } @Test - public void testCorruptedTitleBraces(@TempDir Path testFolder) throws Exception { + public void corruptedTitleBraces(@TempDir Path testFolder) throws Exception { Path tmpFile = testFolder.resolve("testBraces"); BibEntry entry = new BibEntry(); @@ -58,7 +58,7 @@ public void testCorruptedTitleBraces(@TempDir Path testFolder) throws Exception } @Test - public void testCorruptedTitleUnicode(@TempDir Path testFolder) throws Exception { + public void corruptedTitleUnicode(@TempDir Path testFolder) throws Exception { Path tmpFile = testFolder.resolve("testBraces"); BibEntry entry = new BibEntry(); diff --git a/src/test/java/org/jabref/logic/exporter/EmbeddedBibFilePdfExporterTest.java b/src/test/java/org/jabref/logic/exporter/EmbeddedBibFilePdfExporterTest.java index ef821bc6638..c186cf6100d 100644 --- a/src/test/java/org/jabref/logic/exporter/EmbeddedBibFilePdfExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/EmbeddedBibFilePdfExporterTest.java @@ -190,7 +190,7 @@ private static LinkedFile createDefaultLinkedFile(String fileName, Path tempDir) @ParameterizedTest @MethodSource("providePathToNewPDFs") - public void testRoundtripExportImport(Path path) throws Exception { + public void roundtripExportImport(Path path) throws Exception { BibEntry expected = new BibEntry(StandardEntryType.Misc) .withCitationKey("test") .withField(StandardField.AUTHOR, "Test Author") diff --git a/src/test/java/org/jabref/logic/exporter/ExporterTest.java b/src/test/java/org/jabref/logic/exporter/ExporterTest.java index b6e4c026e9b..a4dda2f2127 100644 --- a/src/test/java/org/jabref/logic/exporter/ExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/ExporterTest.java @@ -56,7 +56,7 @@ private static Stream exportFormats() { @ParameterizedTest @MethodSource("exportFormats") - public void testExportingEmptyDatabaseYieldsEmptyFile(Exporter exportFormat, String name, @TempDir Path testFolder) throws Exception { + public void exportingEmptyDatabaseYieldsEmptyFile(Exporter exportFormat, String name, @TempDir Path testFolder) throws Exception { Path tmpFile = testFolder.resolve("ARandomlyNamedFile"); Files.createFile(tmpFile); exportFormat.export(databaseContext, tmpFile, entries); @@ -65,7 +65,7 @@ public void testExportingEmptyDatabaseYieldsEmptyFile(Exporter exportFormat, Str @ParameterizedTest @MethodSource("exportFormats") - public void testExportingNullDatabaseThrowsNPE(Exporter exportFormat, String name, @TempDir Path testFolder) { + public void exportingNullDatabaseThrowsNPE(Exporter exportFormat, String name, @TempDir Path testFolder) { assertThrows(NullPointerException.class, () -> { Path tmpFile = testFolder.resolve("ARandomlyNamedFile"); Files.createFile(tmpFile); diff --git a/src/test/java/org/jabref/logic/exporter/MSBibExportFormatFilesTest.java b/src/test/java/org/jabref/logic/exporter/MSBibExportFormatFilesTest.java index f3c2ad9358e..e3cc7deb7d0 100644 --- a/src/test/java/org/jabref/logic/exporter/MSBibExportFormatFilesTest.java +++ b/src/test/java/org/jabref/logic/exporter/MSBibExportFormatFilesTest.java @@ -61,7 +61,7 @@ void setUp(@TempDir Path testFolder) throws Exception { @ParameterizedTest(name = "{index} file={0}") @MethodSource("fileNames") - void testPerformExport(String filename) throws IOException, SaveException { + void performExport(String filename) throws IOException, SaveException { String xmlFileName = filename.replace(".bib", ".xml"); Path expectedFile = resourceDir.resolve(xmlFileName); Path importFile = resourceDir.resolve(filename); diff --git a/src/test/java/org/jabref/logic/exporter/MetaDataSerializerTest.java b/src/test/java/org/jabref/logic/exporter/MetaDataSerializerTest.java index ebff3f7815e..0bdae1a7311 100644 --- a/src/test/java/org/jabref/logic/exporter/MetaDataSerializerTest.java +++ b/src/test/java/org/jabref/logic/exporter/MetaDataSerializerTest.java @@ -84,14 +84,14 @@ public void serializeSingleContentSelectors() { } @Test - void testParsingEmptyOrFieldsReturnsEmptyCollections() { + void parsingEmptyOrFieldsReturnsEmptyCollections() { String serialized = MetaDataSerializer.serializeCustomEntryTypes(newCustomType); Optional type = MetaDataParser.parseCustomEntryType(serialized); assertEquals(Collections.emptySet(), type.get().getRequiredFields()); } @Test - void testParsingEmptyOptionalFieldsFieldsReturnsEmptyCollections() { + void parsingEmptyOptionalFieldsFieldsReturnsEmptyCollections() { newCustomType = new BibEntryType( CUSTOM_TYPE, Collections.emptySet(), diff --git a/src/test/java/org/jabref/logic/exporter/ModsExportFormatFilesTest.java b/src/test/java/org/jabref/logic/exporter/ModsExportFormatFilesTest.java index 7fe416c513d..e82e8a97859 100644 --- a/src/test/java/org/jabref/logic/exporter/ModsExportFormatFilesTest.java +++ b/src/test/java/org/jabref/logic/exporter/ModsExportFormatFilesTest.java @@ -70,7 +70,7 @@ public void setUp(@TempDir Path testFolder) throws Exception { @ParameterizedTest @MethodSource("fileNames") - public final void testPerformExport(String filename) throws Exception { + public final void performExport(String filename) throws Exception { importFile = Path.of(ModsExportFormatFilesTest.class.getResource(filename).toURI()); String xmlFileName = filename.replace(".bib", ".xml"); List entries = bibtexImporter.importDatabase(importFile).getDatabase().getEntries(); @@ -85,7 +85,7 @@ public final void testPerformExport(String filename) throws Exception { @ParameterizedTest @MethodSource("fileNames") - public final void testExportAsModsAndThenImportAsMods(String filename) throws Exception { + public final void exportAsModsAndThenImportAsMods(String filename) throws Exception { importFile = Path.of(ModsExportFormatFilesTest.class.getResource(filename).toURI()); List entries = bibtexImporter.importDatabase(importFile).getDatabase().getEntries(); @@ -95,7 +95,7 @@ public final void testExportAsModsAndThenImportAsMods(String filename) throws Ex @ParameterizedTest @MethodSource("fileNames") - public final void testImportAsModsAndExportAsMods(String filename) throws Exception { + public final void importAsModsAndExportAsMods(String filename) throws Exception { importFile = Path.of(ModsExportFormatFilesTest.class.getResource(filename).toURI()); String xmlFileName = filename.replace(".bib", ".xml"); Path xmlFile = Path.of(ModsExportFormatFilesTest.class.getResource(xmlFileName).toURI()); diff --git a/src/test/java/org/jabref/logic/exporter/MsBibExportFormatTest.java b/src/test/java/org/jabref/logic/exporter/MsBibExportFormatTest.java index 7be464fc9a6..6096ed61647 100644 --- a/src/test/java/org/jabref/logic/exporter/MsBibExportFormatTest.java +++ b/src/test/java/org/jabref/logic/exporter/MsBibExportFormatTest.java @@ -27,7 +27,7 @@ public void setUp() throws Exception { } @Test - public final void testPerformExportWithNoEntry(@TempDir Path tempFile) throws IOException, SaveException { + public final void performExportWithNoEntry(@TempDir Path tempFile) throws IOException, SaveException { Path path = tempFile.resolve("ThisIsARandomlyNamedFile"); Files.createFile(path); List entries = Collections.emptyList(); diff --git a/src/test/java/org/jabref/logic/exporter/OpenOfficeDocumentCreatorTest.java b/src/test/java/org/jabref/logic/exporter/OpenOfficeDocumentCreatorTest.java index db1cffa4ab1..3ec4af00069 100644 --- a/src/test/java/org/jabref/logic/exporter/OpenOfficeDocumentCreatorTest.java +++ b/src/test/java/org/jabref/logic/exporter/OpenOfficeDocumentCreatorTest.java @@ -62,7 +62,7 @@ void setUp() throws URISyntaxException { } @Test - void testPerformExportForSingleEntry(@TempDir Path testFolder) throws Exception { + void performExportForSingleEntry(@TempDir Path testFolder) throws Exception { Path zipPath = testFolder.resolve("OpenOfficeRandomNamedFile"); exporter.export(databaseContext, zipPath, entries); diff --git a/src/test/java/org/jabref/logic/exporter/XmpPdfExporterTest.java b/src/test/java/org/jabref/logic/exporter/XmpPdfExporterTest.java index afa5b3dad60..296aef43737 100644 --- a/src/test/java/org/jabref/logic/exporter/XmpPdfExporterTest.java +++ b/src/test/java/org/jabref/logic/exporter/XmpPdfExporterTest.java @@ -174,7 +174,7 @@ void unsuccessfulExportToFileByPath(Path path) throws Exception { @ParameterizedTest @MethodSource("providePathToNewPDFs") - public void testRoundtripExportImport(Path path) throws Exception { + public void roundtripExportImport(Path path) throws Exception { try (PDDocument document = new PDDocument()) { PDPage page = new PDPage(); document.addPage(page); diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatterTest.java b/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatterTest.java index 3ecd073a917..7834ea9df17 100644 --- a/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToLatexFormatterTest.java @@ -33,12 +33,12 @@ public void formatCombinedAccent() { } @Test - public void testBasic() { + public void basic() { assertEquals("aaa", formatter.format("aaa")); } @Test - public void testHTML() { + public void hTML() { assertEquals("{\\\"{a}}", formatter.format("ä")); assertEquals("{\\\"{a}}", formatter.format("ä")); assertEquals("{\\\"{a}}", formatter.format("ä")); @@ -46,12 +46,12 @@ public void testHTML() { } @Test - public void testHTMLRemoveTags() { + public void hTMLRemoveTags() { assertEquals("aaa", formatter.format("aaa")); } @Test - public void testHTMLCombiningAccents() { + public void hTMLCombiningAccents() { assertEquals("{\\\"{a}}", formatter.format("ä")); assertEquals("{\\\"{a}}", formatter.format("ä")); assertEquals("{\\\"{a}}b", formatter.format("äb")); diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatterTest.java b/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatterTest.java index 64f14737bb9..c66cdb6ff8d 100644 --- a/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/bibtexfields/HtmlToUnicodeFormatterTest.java @@ -34,7 +34,7 @@ public void setUp() { @ParameterizedTest @MethodSource("data") - void testFormatterWorksCorrectly(String expected, String input) { + void formatterWorksCorrectly(String expected, String input) { assertEquals(expected, formatter.format(input)); } } diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatterTest.java b/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatterTest.java index c2f74c4d560..715e532b781 100644 --- a/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/bibtexfields/NormalizeNamesFormatterTest.java @@ -18,7 +18,7 @@ public void setUp() { } @Test - public void testNormalizeAuthorList() { + public void normalizeAuthorList() { assertEquals("Bilbo, Staci D.", formatter.format("Staci D Bilbo")); assertEquals("Bilbo, Staci D.", formatter.format("Staci D. Bilbo")); @@ -99,13 +99,13 @@ public void lastThenJuniorThenFirst() { } @Test - public void testConcatenationOfAuthorsWithCommas() { + public void concatenationOfAuthorsWithCommas() { assertEquals("Ali Babar, M. and Dingsøyr, T. and Lago, P. and van der Vliet, H.", formatter.format("Ali Babar, M., Dingsøyr, T., Lago, P., van der Vliet, H.")); assertEquals("Ali Babar, M.", formatter.format("Ali Babar, M.")); } @Test - public void testOddCountOfCommas() { + public void oddCountOfCommas() { assertEquals("Ali Babar, M., Dingsøyr T. Lago P.", formatter.format("Ali Babar, M., Dingsøyr, T., Lago P.")); } @@ -115,66 +115,66 @@ public void formatExample() { } @Test - public void testNameAffixe() { + public void nameAffixe() { assertEquals("Surname, jr, First and Surname2, First2", formatter.format("Surname, jr, First, Surname2, First2")); } @Test - public void testAvoidSpecialCharacter() { + public void avoidSpecialCharacter() { assertEquals("Surname, {, First; Surname2, First2", formatter.format("Surname, {, First; Surname2, First2")); } @Test - public void testAndInName() { + public void andInName() { assertEquals("Surname and , First, Surname2 First2", formatter.format("Surname, and , First, Surname2, First2")); } @Test - public void testMultipleNameAffixes() { + public void multipleNameAffixes() { assertEquals("Mair, Jr, Daniel and Brühl, Sr, Daniel", formatter.format("Mair, Jr, Daniel, Brühl, Sr, Daniel")); } @Test - public void testCommaSeperatedNames() { + public void commaSeperatedNames() { assertEquals("Bosoi, Cristina and Oliveira, Mariana and Sanchez, Rafael Ochoa and Tremblay, Mélanie and TenHave, Gabrie and Deutz, Nicoolas and Rose, Christopher F. and Bemeur, Chantal", formatter.format("Cristina Bosoi, Mariana Oliveira, Rafael Ochoa Sanchez, Mélanie Tremblay, Gabrie TenHave, Nicoolas Deutz, Christopher F. Rose, Chantal Bemeur")); } @Test - public void testMultipleSpaces() { + public void multipleSpaces() { assertEquals("Bosoi, Cristina and Oliveira, Mariana and Sanchez, Rafael Ochoa and Tremblay, Mélanie and TenHave, Gabrie and Deutz, Nicoolas and Rose, Christopher F. and Bemeur, Chantal", formatter.format("Cristina Bosoi, Mariana Oliveira, Rafael Ochoa Sanchez , Mélanie Tremblay , Gabrie TenHave, Nicoolas Deutz, Christopher F. Rose, Chantal Bemeur")); } @Test - public void testAvoidPreposition() { + public void avoidPreposition() { assertEquals("von Zimmer, Hans and van Oberbergern, Michael and zu Berger, Kevin", formatter.format("Hans von Zimmer, Michael van Oberbergern, Kevin zu Berger")); } @Test - public void testPreposition() { + public void preposition() { assertEquals("von Zimmer, Hans and van Oberbergern, Michael and zu Berger, Kevin", formatter.format("Hans von Zimmer, Michael van Oberbergern, Kevin zu Berger")); } @Test - public void testOneCommaUntouched() { + public void oneCommaUntouched() { assertEquals("Canon der Barbar, Alexander der Große", formatter.format("Canon der Barbar, Alexander der Große")); } @Test - public void testAvoidNameAffixes() { + public void avoidNameAffixes() { assertEquals("der Barbar, Canon and der Große, Alexander and der Alexander, Peter", formatter.format("Canon der Barbar, Alexander der Große, Peter der Alexander")); } @Test - public void testUpperCaseSensitiveList() { + public void upperCaseSensitiveList() { assertEquals("der Barbar, Canon and der Große, Alexander", formatter.format("Canon der Barbar AND Alexander der Große")); assertEquals("der Barbar, Canon and der Große, Alexander", formatter.format("Canon der Barbar aNd Alexander der Große")); assertEquals("der Barbar, Canon and der Große, Alexander", formatter.format("Canon der Barbar AnD Alexander der Große")); } @Test - public void testSemiCorrectNamesWithSemicolon() { + public void semiCorrectNamesWithSemicolon() { assertEquals("Last, First and Last2, First2 and Last3, First3", formatter.format("Last, First; Last2, First2; Last3, First3")); assertEquals("Last, Jr, First and Last2, First2", formatter.format("Last, Jr, First; Last2, First2")); assertEquals("Last, First and Last2, First2 and Last3, First3 and Last4, First4", formatter.format("Last, First; Last2, First2; Last3, First3; First4 Last4")); diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeConverterTest.java b/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeConverterTest.java index a4d7f3fa7cb..08443edb568 100644 --- a/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeConverterTest.java +++ b/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeConverterTest.java @@ -18,24 +18,24 @@ public void setUp() { } @Test - public void testBasic() { + public void basic() { assertEquals("aaa", formatter.format("aaa")); } @Test - public void testUnicodeCombiningAccents() { + public void unicodeCombiningAccents() { assertEquals("{\\\"{a}}", formatter.format("a\u0308")); assertEquals("{\\\"{a}}b", formatter.format("a\u0308b")); } @Test - public void testUnicode() { + public void unicode() { assertEquals("{\\\"{a}}", formatter.format("ä")); assertEquals("{{$\\Epsilon$}}", formatter.format("\u0395")); } @Test - public void testUnicodeSingle() { + public void unicodeSingle() { assertEquals("a", formatter.format("a")); } } diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatterTest.java b/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatterTest.java index 2f43db8a4fe..00926849112 100644 --- a/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/bibtexfields/UnicodeToLatexFormatterTest.java @@ -30,7 +30,7 @@ private static Stream testCases() { @ParameterizedTest() @MethodSource("testCases") - void testFormat(String expectedResult, String input) { + void format(String expectedResult, String input) { assertEquals(expectedResult, formatter.format(input)); } } diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java b/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java index d662162c520..f7773ace883 100644 --- a/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java @@ -51,7 +51,7 @@ public void formatExample() { "-upper, -Upper", // single word with - "-{u}pper, -{u}pper", // single word with {} and - }) - public void testInputs(String input, String expectedResult) { + public void inputs(String input, String expectedResult) { String formattedStr = formatter.format(input); assertEquals(expectedResult, formattedStr); } diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatterTest.java b/src/test/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatterTest.java index f0b5e71811b..766ba96dded 100644 --- a/src/test/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/casechanger/ProtectTermsFormatterTest.java @@ -25,17 +25,17 @@ public void setUp() { } @Test - public void testSingleWord() { + public void singleWord() { assertEquals("{VLSI}", formatter.format("VLSI")); } @Test - public void testDoNotProtectAlreadyProtected() { + public void doNotProtectAlreadyProtected() { assertEquals("{VLSI}", formatter.format("{VLSI}")); } @Test - public void testCaseSensitivity() { + public void caseSensitivity() { assertEquals("VLsI", formatter.format("VLsI")); } @@ -45,7 +45,7 @@ public void formatExample() { } @Test - public void testCorrectOrderingOfTerms() { + public void correctOrderingOfTerms() { assertEquals("{3GPP} {3G}", formatter.format("3GPP 3G")); } diff --git a/src/test/java/org/jabref/logic/importer/DatabaseFileLookupTest.java b/src/test/java/org/jabref/logic/importer/DatabaseFileLookupTest.java index e4990202d1e..e2ed83fc2a0 100644 --- a/src/test/java/org/jabref/logic/importer/DatabaseFileLookupTest.java +++ b/src/test/java/org/jabref/logic/importer/DatabaseFileLookupTest.java @@ -38,7 +38,7 @@ void setUp() throws Exception { * Tests the prerequisites of this test-class itself. */ @Test - void testTestDatabase() { + void prerequisitesFulfilled() { assertEquals(2, database.getEntryCount()); assertEquals(2, entries.size()); assertNotNull(entry1); diff --git a/src/test/java/org/jabref/logic/importer/ImportDataTest.java b/src/test/java/org/jabref/logic/importer/ImportDataTest.java index 5aa06c9be9c..eeb6a3c84d1 100644 --- a/src/test/java/org/jabref/logic/importer/ImportDataTest.java +++ b/src/test/java/org/jabref/logic/importer/ImportDataTest.java @@ -21,7 +21,7 @@ public class ImportDataTest { * Tests the testing environment. */ @Test - void testTestingEnvironment() { + void environment() { assertTrue(Files.exists(ImportDataTest.EXISTING_FOLDER), "EXISTING_FOLDER does not exist"); assertTrue(Files.isDirectory(ImportDataTest.EXISTING_FOLDER), "EXISTING_FOLDER is not a directory"); diff --git a/src/test/java/org/jabref/logic/importer/ImportFormatReaderIntegrationTest.java b/src/test/java/org/jabref/logic/importer/ImportFormatReaderIntegrationTest.java index 14c447cfe0e..0fa6623fe6c 100644 --- a/src/test/java/org/jabref/logic/importer/ImportFormatReaderIntegrationTest.java +++ b/src/test/java/org/jabref/logic/importer/ImportFormatReaderIntegrationTest.java @@ -35,7 +35,7 @@ void setUp() { @ParameterizedTest @MethodSource("importFormats") - void testImportUnknownFormat(String resource, String format, int count) throws Exception { + void importUnknownFormat(String resource, String format, int count) throws Exception { Path file = Path.of(ImportFormatReaderIntegrationTest.class.getResource(resource).toURI()); ImportFormatReader.UnknownFormatImport unknownFormat = reader.importUnknownFormat(file, new DummyFileUpdateMonitor()); assertEquals(count, unknownFormat.parserResult().getDatabase().getEntryCount()); @@ -43,14 +43,14 @@ void testImportUnknownFormat(String resource, String format, int count) throws E @ParameterizedTest @MethodSource("importFormats") - void testImportFormatFromFile(String resource, String format, int count) throws Exception { + void importFormatFromFile(String resource, String format, int count) throws Exception { Path file = Path.of(ImportFormatReaderIntegrationTest.class.getResource(resource).toURI()); assertEquals(count, reader.importFromFile(format, file).getDatabase().getEntries().size()); } @ParameterizedTest @MethodSource("importFormats") - void testImportUnknownFormatFromString(String resource, String format, int count) throws Exception { + void importUnknownFormatFromString(String resource, String format, int count) throws Exception { Path file = Path.of(ImportFormatReaderIntegrationTest.class.getResource(resource).toURI()); String data = Files.readString(file); assertEquals(count, reader.importUnknownFormat(data).parserResult().getDatabase().getEntries().size()); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java index 6fe85359049..6fa418b3d34 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java @@ -60,7 +60,7 @@ void searchByQueryFindsEntry() throws Exception { } @Test - void testGetURLForQuery() throws FetcherException, MalformedURLException, URISyntaxException, QueryNodeParseException { + void getURLForQuery() throws FetcherException, MalformedURLException, URISyntaxException, QueryNodeParseException { String testQuery = "test query url"; SyntaxParser parser = new StandardSyntaxParser(); URL url = fetcher.getURLForQuery(parser.parse(testQuery, NO_EXPLICIT_FIELD)); @@ -69,7 +69,7 @@ void testGetURLForQuery() throws FetcherException, MalformedURLException, URISyn } @Test - void testGetParser() { + void getParser() { ACMPortalParser expected = new ACMPortalParser(); assertEquals(expected.getClass(), fetcher.getParser().getClass()); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java b/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java index afd4d51e573..fad10f8053d 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java @@ -133,7 +133,7 @@ public void setUp() throws Exception { } @Test - public void testGetName() { + public void getName() { assertEquals("SAO/NASA ADS", fetcher.getName()); } @@ -158,44 +158,44 @@ public void searchByEntryFindsEntry() throws Exception { } @Test - public void testPerformSearchByFamaeyMcGaughEntry() throws Exception { + public void performSearchByFamaeyMcGaughEntry() throws Exception { Optional fetchedEntry = fetcher.performSearchById("10.12942/lrr-2012-10"); fetchedEntry.ifPresent(entry -> entry.clearField(StandardField.ABSTRACT)); // Remove abstract due to copyright assertEquals(Optional.of(famaeyMcGaughEntry), fetchedEntry); } @Test - public void testPerformSearchByIdEmptyDOI() throws Exception { + public void performSearchByIdEmptyDOI() throws Exception { Optional fetchedEntry = fetcher.performSearchById(""); assertEquals(Optional.empty(), fetchedEntry); } @Test - public void testPerformSearchByIdInvalidDoi() throws Exception { + public void performSearchByIdInvalidDoi() throws Exception { assertEquals(Optional.empty(), fetcher.performSearchById("this.doi.will.fail")); } @Test - public void testPerformSearchBySunWelchEntry() throws Exception { + public void performSearchBySunWelchEntry() throws Exception { Optional fetchedEntry = fetcher.performSearchById("10.1038/nmat3160"); fetchedEntry.ifPresent(entry -> entry.clearField(StandardField.ABSTRACT)); // Remove abstract due to copyright assertEquals(Optional.of(sunWelchEntry), fetchedEntry); } @Test - public void testPerformSearchByXiongSunEntry() throws Exception { + public void performSearchByXiongSunEntry() throws Exception { Optional fetchedEntry = fetcher.performSearchById("10.1109/TGRS.2006.890567"); assertEquals(Optional.of(xiongSunEntry), fetchedEntry); } @Test - public void testPerformSearchByIngersollPollardEntry() throws Exception { + public void performSearchByIngersollPollardEntry() throws Exception { Optional fetchedEntry = fetcher.performSearchById("10.1016/0019-1035(82)90169-5"); assertEquals(Optional.of(ingersollPollardEntry), fetchedEntry); } @Test - public void testPerformSearchByLuceyPaulEntry() throws Exception { + public void performSearchByLuceyPaulEntry() throws Exception { Optional fetchedEntry = fetcher.performSearchById("2000JGR...10520297L"); assertEquals(Optional.of(luceyPaulEntry), fetchedEntry); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/BiodiversityLibraryTest.java b/src/test/java/org/jabref/logic/importer/fetcher/BiodiversityLibraryTest.java index 84936dd4e26..c8621e940e9 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/BiodiversityLibraryTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/BiodiversityLibraryTest.java @@ -41,7 +41,7 @@ void setUp() { } @Test - public void testGetName() { + public void getName() { assertEquals("Biodiversity Heritage", fetcher.getName()); assertNotEquals("Biodiversity Heritage Library", fetcher.getName()); assertNotEquals("Biodiversity Library", fetcher.getName()); @@ -90,7 +90,7 @@ public void getItemMetadaUrl(String id) throws MalformedURLException, URISyntaxE } @Test - public void testPerformSearch() throws FetcherException { + public void performSearch() throws FetcherException { BibEntry expected = new BibEntry(StandardEntryType.Article) .withField(StandardField.AUTHOR, "Clark, John L. (John Littner) and Neill, David A. ") .withField(StandardField.JOURNALTITLE, "PhytoKeys") diff --git a/src/test/java/org/jabref/logic/importer/fetcher/BvbFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/BvbFetcherTest.java index c2c17c357f7..e310cc61d42 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/BvbFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/BvbFetcherTest.java @@ -27,7 +27,7 @@ public class BvbFetcherTest { BibEntry bibEntryISBN9783960886402; @Test - void testPerformTest() throws Exception { + void performTest() throws Exception { String searchquery = "effective java author:bloch"; List result = fetcher.performSearch(searchquery); assertFalse(result.isEmpty()); @@ -69,7 +69,7 @@ public void setUp() { } @Test - public void testGetName() { + public void getName() { assertEquals("Bibliotheksverbund Bayern (Experimental)", fetcher.getName()); } @@ -90,14 +90,14 @@ public void complexSearchQueryURLCorrect() throws Exception { } @Test - public void testPerformSearchMatchingMultipleEntries() throws FetcherException { + public void performSearchMatchingMultipleEntries() throws FetcherException { List searchResult = fetcher.performSearch("effective java bloch"); assertEquals(bibEntryISBN9783960886402, searchResult.getFirst()); assertEquals(bibEntryISBN0134685997, searchResult.get(1)); } @Test - public void testPerformSearchEmpty() throws FetcherException { + public void performSearchEmpty() throws FetcherException { List searchResult = fetcher.performSearch(""); assertEquals(Collections.emptyList(), searchResult); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java index 790c1eee67f..647c18d789d 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/CiteSeerTest.java @@ -18,6 +18,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; @FetcherTest class CiteSeerTest { @@ -73,6 +74,7 @@ void searchWithSortingByYear() throws FetcherException { @Test void searchWithSortingByYearAndYearRange() throws FetcherException { List fetchedEntries = fetcher.performSearch("title:Theory AND year-range:2002-2012 AND sortBy:Year"); + assertNotEquals(List.of(), fetchedEntries); Iterator fetchedEntriesIter = fetchedEntries.iterator(); BibEntry recentEntry = fetchedEntriesIter.next(); while (fetchedEntriesIter.hasNext()) { diff --git a/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java b/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java index a0bd0bfc64e..287b65e857d 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/CrossRefTest.java @@ -151,7 +151,7 @@ public void performSearchByEmptyQuery() throws Exception { * reveal fetching error on crossref performSearchById */ @Test - public void testPerformSearchValidReturnNothingDOI() throws FetcherException { + public void performSearchValidReturnNothingDOI() throws FetcherException { assertThrows(FetcherClientException.class, () -> fetcher.performSearchById("10.1392/BC1.0")); } } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DOABFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/DOABFetcherTest.java index 024e6e0dffb..e640afd6801 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DOABFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DOABFetcherTest.java @@ -23,7 +23,7 @@ public class DOABFetcherTest { private final DOABFetcher fetcher = new DOABFetcher(); @Test - public void testGetName() { + public void getName() { assertEquals("DOAB", fetcher.getName()); } @@ -106,7 +106,7 @@ public static Stream testPerformSearch() { @ParameterizedTest @MethodSource - public void testPerformSearch(BibEntry expected, String query) throws FetcherException { + public void performSearch(BibEntry expected, String query) throws FetcherException { List entries = fetcher.performSearch(query); // We must not contain abstracts in our code base; thus we remove the abstracts from the fetched results entries.forEach(entry -> entry.clearField(StandardField.ABSTRACT)); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java index 1c7fec0b352..d68f0ad918e 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DOAJFetcherTest.java @@ -54,7 +54,7 @@ void searchByQueryFindsEntry() throws Exception { } @Test - void testBibJSONConverter() { + void bibJSONConverter() { String jsonString = "{\"title\":\"Design of Finite Word Length Linear-Phase FIR Filters in the Logarithmic Number System Domain\",\"journal\":{\"publisher\":\"Hindawi Publishing Corporation\",\"language\":[\"English\"],\"title\":\"VLSI Design\",\"country\":\"US\",\"volume\":\"2014\"},\"author\":[{\"name\":\"Syed Asad Alam\"},{\"name\":\"Oscar Gustafsson\"}],\"link\":[{\"url\":\"http://dx.doi.org/10.1155/2014/217495\",\"type\":\"fulltext\"}],\"year\":\"2014\",\"identifier\":[{\"type\":\"pissn\",\"id\":\"1065-514X\"},{\"type\":\"eissn\",\"id\":\"1563-5171\"},{\"type\":\"doi\",\"id\":\"10.1155/2014/217495\"}],\"created_date\":\"2014-05-09T19:38:31Z\"}"; JSONObject jsonObject = new JSONObject(jsonString); BibEntry bibEntry = DOAJFetcher.parseBibJSONtoBibtex(jsonObject, ','); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java b/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java index bd00f6d1627..a935977e734 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DiVATest.java @@ -28,12 +28,12 @@ public void setUp() { } @Test - public void testGetName() { + public void getName() { assertEquals("DiVA", fetcher.getName()); } @Test - public void testPerformSearchById() throws Exception { + public void performSearchById() throws Exception { BibEntry entry = new BibEntry(); entry.setType(StandardEntryType.Article); entry.setCitationKey("Gustafsson260746"); @@ -53,17 +53,17 @@ public void testPerformSearchById() throws Exception { } @Test - public void testValidIdentifier() { + public void validIdentifier() { assertTrue(fetcher.isValidId("diva2:260746")); } @Test - public void testInvalidIdentifier() { + public void invalidIdentifier() { assertFalse(fetcher.isValidId("banana")); } @Test - public void testEmptyId() throws Exception { + public void emptyId() throws Exception { assertEquals(Optional.empty(), fetcher.performSearchById("")); } } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java index e434ad1da99..11cacf3a446 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/DoiFetcherTest.java @@ -71,56 +71,56 @@ public class DoiFetcherTest { .withField(StandardField.NUMBER, "2"); @Test - public void testGetName() { + public void getName() { assertEquals("DOI", fetcher.getName()); } @Test - public void testPerformSearchBurd2011() throws FetcherException { + public void performSearchBurd2011() throws FetcherException { Optional fetchedEntry = fetcher.performSearchById("10.1002/9781118257517"); assertEquals(Optional.of(bibEntryBurd2011), fetchedEntry); } @Test - public void testPerformSearchDecker2007() throws FetcherException { + public void performSearchDecker2007() throws FetcherException { Optional fetchedEntry = fetcher.performSearchById("10.1109/ICWS.2007.59"); assertEquals(Optional.of(bibEntryDecker2007), fetchedEntry); } @Test - public void testPerformSearchIannarelli2019() throws FetcherException { + public void performSearchIannarelli2019() throws FetcherException { Optional fetchedEntry = fetcher.performSearchById("10.3303/CET1977146"); assertEquals(Optional.of(bibEntryIannarelli2019), fetchedEntry); } @Test - public void testPerformSearchEmptyDOI() { + public void performSearchEmptyDOI() { assertThrows(FetcherException.class, () -> fetcher.performSearchById("")); } @Test - public void testPerformSearchInvalidDOI() { + public void performSearchInvalidDOI() { assertThrows(FetcherException.class, () -> fetcher.performSearchById("10.1002/9781118257517F")); } @Test - public void testPerformSearchInvalidDOIClientResultsinFetcherClientException() { + public void performSearchInvalidDOIClientResultsinFetcherClientException() { assertThrows(FetcherException.class, () -> fetcher.performSearchById("10.1002/9781118257517F")); } @Test - public void testPerformSearchInvalidDOIClientResultsinFetcherClientException2() { + public void performSearchInvalidDOIClientResultsinFetcherClientException2() { assertThrows(FetcherException.class, () -> fetcher.performSearchById("10.1002/9781517F")); } @Test - public void testPerformSearchNonTrimmedDOI() throws FetcherException { + public void performSearchNonTrimmedDOI() throws FetcherException { Optional fetchedEntry = fetcher.performSearchById("http s://doi.org/ 10.1109 /ICWS .2007.59 "); assertEquals(Optional.of(bibEntryDecker2007), fetchedEntry); } @Test - public void testAPSJournalCopiesArticleIdToPageField() throws FetcherException { + public void aPSJournalCopiesArticleIdToPageField() throws FetcherException { Optional fetchedEntry = fetcher.performSearchById("10.1103/physreva.102.023315"); assertEquals(Optional.of(bibEntryStenzel2020), fetchedEntry); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java index 7ba45ee9aad..f98a9780056 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/GvkFetcherTest.java @@ -61,7 +61,7 @@ public void setUp() { } @Test - public void testGetName() { + public void getName() { assertEquals("GVK", fetcher.getName()); } @@ -82,26 +82,26 @@ public void complexSearchQueryURLCorrect() throws Exception { } @Test - public void testPerformSearchMatchingMultipleEntries() throws FetcherException { + public void performSearchMatchingMultipleEntries() throws FetcherException { List searchResult = fetcher.performSearch("title:\"effective java\""); assertTrue(searchResult.contains(bibEntryPPN591166003)); assertTrue(searchResult.contains(bibEntryPPN66391437X)); } @Test - public void testPerformSearch591166003() throws FetcherException { + public void performSearch591166003() throws FetcherException { List searchResult = fetcher.performSearch("ppn:591166003"); assertEquals(Collections.singletonList(bibEntryPPN591166003), searchResult); } @Test - public void testPerformSearch66391437X() throws FetcherException { + public void performSearch66391437X() throws FetcherException { List searchResult = fetcher.performSearch("ppn:66391437X"); assertEquals(Collections.singletonList(bibEntryPPN66391437X), searchResult); } @Test - public void testPerformSearchEmpty() throws FetcherException { + public void performSearchEmpty() throws FetcherException { List searchResult = fetcher.performSearch(""); assertEquals(Collections.emptyList(), searchResult); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java index 6b64af363c0..81d3ade744e 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/IacrEprintFetcherTest.java @@ -145,7 +145,7 @@ public void searchForNonexistentIdFails() { } @Test - public void testGetName() { + public void getName() { assertEquals(IacrEprintFetcher.NAME, fetcher.getName()); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java index 65573de7c5e..3c6afb75b5a 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/MedlineFetcherTest.java @@ -127,12 +127,12 @@ public void setUp() throws InterruptedException { } @Test - public void testGetName() { + public void getName() { assertEquals("Medline/PubMed", fetcher.getName()); } @Test - public void testSearchByIDWijedasa() throws Exception { + public void searchByIDWijedasa() throws Exception { Optional fetchedEntry = fetcher.performSearchById("27670948"); assertTrue(fetchedEntry.isPresent()); @@ -141,7 +141,7 @@ public void testSearchByIDWijedasa() throws Exception { } @Test - public void testSearchByIDEndharti() throws Exception { + public void searchByIDEndharti() throws Exception { Optional fetchedEntry = fetcher.performSearchById("27670445"); assertTrue(fetchedEntry.isPresent()); @@ -150,7 +150,7 @@ public void testSearchByIDEndharti() throws Exception { } @Test - public void testSearchByIDIchikawa() throws Exception { + public void searchByIDIchikawa() throws Exception { Optional fetchedEntry = fetcher.performSearchById("26197440"); assertTrue(fetchedEntry.isPresent()); @@ -159,7 +159,7 @@ public void testSearchByIDIchikawa() throws Exception { } @Test - public void testSearchByIDSari() throws Exception { + public void searchByIDSari() throws Exception { Optional fetchedEntry = fetcher.performSearchById("26867355"); assertTrue(fetchedEntry.isPresent()); @@ -168,39 +168,39 @@ public void testSearchByIDSari() throws Exception { } @Test - public void testMultipleEntries() throws Exception { + public void multipleEntries() throws Exception { List entryList = fetcher.performSearch("java"); entryList.forEach(entry -> entry.clearField(StandardField.ABSTRACT)); // Remove abstract due to copyright); assertEquals(50, entryList.size()); } @Test - public void testWithLuceneQueryAuthorDate() throws Exception { + public void withLuceneQueryAuthorDate() throws Exception { List entryList = fetcher.performSearch("author:vigmond AND year:2021"); entryList.forEach(entry -> entry.clearField(StandardField.ABSTRACT)); // Remove abstract due to copyright); assertEquals(18, entryList.size()); } @Test - public void testWithLuceneQueryAuthorDateRange() throws Exception { + public void withLuceneQueryAuthorDateRange() throws Exception { List entryList = fetcher.performSearch("author:vigmond AND year-range:2020-2021"); entryList.forEach(entry -> entry.clearField(StandardField.ABSTRACT)); // Remove abstract due to copyright); assertEquals(28, entryList.size()); } @Test - public void testInvalidSearchTerm() throws Exception { + public void invalidSearchTerm() throws Exception { assertThrows(FetcherClientException.class, () -> fetcher.performSearchById("this.is.a.invalid.search.term.for.the.medline.fetcher")); } @Test - public void testEmptyEntryList() throws Exception { + public void emptyEntryList() throws Exception { List entryList = fetcher.performSearch("java is fantastic and awesome "); assertEquals(Collections.emptyList(), entryList); } @Test - public void testEmptyInput() throws Exception { + public void emptyInput() throws Exception { assertEquals(Collections.emptyList(), fetcher.performSearch("")); } } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/MedraTest.java b/src/test/java/org/jabref/logic/importer/fetcher/MedraTest.java index ae5a867ee76..56900f8971a 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/MedraTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/MedraTest.java @@ -72,23 +72,23 @@ private static Stream getDoiBibEntryPairs() { } @Test - public void testGetName() { + public void getName() { assertEquals("mEDRA", fetcher.getName()); } @Test - public void testPerformSearchEmptyDOI() throws FetcherException { + public void performSearchEmptyDOI() throws FetcherException { assertEquals(Optional.empty(), fetcher.performSearchById("")); } @Test - public void testPerformNonExistent() throws FetcherException { + public void performNonExistent() throws FetcherException { assertThrows(FetcherServerException.class, () -> fetcher.performSearchById("10.1016/j.bjoms.2007.08.004")); } @ParameterizedTest @MethodSource("getDoiBibEntryPairs") - public void testDoiBibEntryPairs(String identifier, Optional expected) throws FetcherException { + public void doiBibEntryPairs(String identifier, Optional expected) throws FetcherException { Optional fetchedEntry = fetcher.performSearchById(identifier); assertEquals(expected, fetchedEntry); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/MrDLibFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/MrDLibFetcherTest.java index 830cc5f67b1..f444db731e8 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/MrDLibFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/MrDLibFetcherTest.java @@ -31,7 +31,7 @@ public void setUp() { } @Test - public void testPerformSearch() throws FetcherException { + public void performSearch() throws FetcherException { BibEntry bibEntry = new BibEntry(); bibEntry.setField(StandardField.TITLE, "lernen"); List bibEntrys = fetcher.performSearch(bibEntry); @@ -39,7 +39,7 @@ public void testPerformSearch() throws FetcherException { } @Test - public void testPerformSearchForHornecker2006() throws FetcherException { + public void performSearchForHornecker2006() throws FetcherException { BibEntry bibEntry = new BibEntry(); bibEntry.setCitationKey("Hornecker:2006:GGT:1124772.1124838"); bibEntry.setField(StandardField.ADDRESS, "New York, NY, USA"); @@ -60,7 +60,7 @@ public void testPerformSearchForHornecker2006() throws FetcherException { } @Test - public void testGetName() { + public void getName() { assertEquals("MDL_FETCHER", fetcher.getName()); } } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/PicaXmlParserTest.java b/src/test/java/org/jabref/logic/importer/fetcher/PicaXmlParserTest.java index b854717bfe4..b94abd8ae88 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/PicaXmlParserTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/PicaXmlParserTest.java @@ -45,7 +45,7 @@ public void resultFor797485368() throws Exception { } @Test - public void testGMP() throws Exception { + public void gMP() throws Exception { doTest("gvk_gmp.xml", 2, Arrays.asList("gvk_gmp.1.bib", "gvk_gmp.2.bib")); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java index 275642794f3..621574b6597 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/SpringerFetcherTest.java @@ -122,7 +122,7 @@ void searchByQueryFindsEntry() throws Exception { } @Test - void testSpringerJSONToBibtex() { + void springerJSONToBibtex() { String jsonString = """ {\r "identifier":"doi:10.1007/BF01201962",\r diff --git a/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java index 5048ff20efb..c34478cd57a 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/TitleFetcherTest.java @@ -38,24 +38,24 @@ public void setUp() { } @Test - public void testGetName() { + public void getName() { assertEquals("Title", fetcher.getName()); } @Test - public void testPerformSearchKopp2007() throws FetcherException { + public void performSearchKopp2007() throws FetcherException { Optional fetchedEntry = fetcher.performSearchById("BPELscript: A simplified script syntax for WS-BPEL 2.0"); assertEquals(Optional.of(bibEntryBischof2009), fetchedEntry); } @Test - public void testPerformSearchEmptyTitle() throws FetcherException { + public void performSearchEmptyTitle() throws FetcherException { Optional fetchedEntry = fetcher.performSearchById(""); assertEquals(Optional.empty(), fetchedEntry); } @Test - public void testPerformSearchInvalidTitle() throws FetcherException { + public void performSearchInvalidTitle() throws FetcherException { Optional fetchedEntry = fetcher.performSearchById("An unknown title where noi DOI can be determined"); assertEquals(Optional.empty(), fetchedEntry); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/DoiToBibtexConverterComIsbnFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/DoiToBibtexConverterComIsbnFetcherTest.java index 17f079edacd..17eca13ab80 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/DoiToBibtexConverterComIsbnFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/DoiToBibtexConverterComIsbnFetcherTest.java @@ -73,7 +73,7 @@ public void authorsAreCorrectlyFormatted() throws Exception { } @Test - public void testIsbnNeitherAvailable() { + public void isbnNeitherAvailable() { assertThrows(FetcherClientException.class, () -> fetcher.performSearchById("9785646216541")); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/GVKIsbnFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/GVKIsbnFetcherTest.java index fbdd60630a7..6fe2e9f2643 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/GVKIsbnFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/GVKIsbnFetcherTest.java @@ -95,14 +95,14 @@ public void authorsAreCorrectlyFormatted() throws Exception { * Checks whether the given ISBN is NOT available at any ISBN fetcher */ @Test - public void testIsbnNeitherAvailableOnEbookDeNorOrViaOpenLibrary() throws Exception { + public void isbnNeitherAvailableOnEbookDeNorOrViaOpenLibrary() throws Exception { // In this test, the ISBN needs to be a valid (syntax+checksum) ISBN number // However, the ISBN number must not be assigned to a real book assertEquals(Optional.empty(), fetcher.performSearchById("9785646216541")); } @Test - void testEResourceIsbnIsReturnedAsBoook() throws Exception { + void eResourceIsbnIsReturnedAsBoook() throws Exception { assertEquals(Optional.of(StandardEntryType.Book), fetcher.performSearchById("978-0-8229-4557-4").map(BibEntry::getType)); } } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcherTest.java index d2afbfb2b00..df4df8c8253 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/IsbnFetcherTest.java @@ -45,7 +45,7 @@ void setUp() { } @Test - void testName() { + void name() { assertEquals("ISBN", fetcher.getName()); } diff --git a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/OpenLibraryIsbnFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/OpenLibraryIsbnFetcherTest.java index 1253ebab464..2afb1aea590 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/OpenLibraryIsbnFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/isbntobibtex/OpenLibraryIsbnFetcherTest.java @@ -71,7 +71,7 @@ public void authorsAreCorrectlyFormatted() throws Exception { * Checks whether the given ISBN is NOT available at any ISBN fetcher */ @Test - public void testIsbnNeitherAvailableOnEbookDeNorOrViaOpenLibrary() throws Exception { + public void isbnNeitherAvailableOnEbookDeNorOrViaOpenLibrary() throws Exception { // In this test, the ISBN needs to be a valid (syntax+checksum) ISBN number // However, the ISBN number must not be assigned to a real book assertThrows(FetcherClientException.class, () -> fetcher.performSearchById("9785646216541")); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformerTest.java b/src/test/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformerTest.java index 91f2fccce28..13cc92863ae 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformerTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/transformers/IEEEQueryTransformerTest.java @@ -86,7 +86,7 @@ private static Stream getTitleTestData() { @ParameterizedTest @MethodSource("getTitleTestData") - public void testStopWordRemoval(String expected, String queryString) throws Exception { + public void stopWordRemoval(String expected, String queryString) throws Exception { QueryNode luceneQuery = new StandardSyntaxParser().parse(queryString, AbstractQueryTransformer.NO_EXPLICIT_FIELD); Optional result = getTransformer().transformLuceneQuery(luceneQuery); assertEquals(Optional.ofNullable(expected), result); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/ACMPortalParserTest.java b/src/test/java/org/jabref/logic/importer/fileformat/ACMPortalParserTest.java index 047e92c686c..1b16cded07b 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/ACMPortalParserTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/ACMPortalParserTest.java @@ -69,7 +69,7 @@ void setUp() throws URISyntaxException, MalformedURLException { } @Test - void testParseEntries() throws IOException, ParseException { + void parseEntries() throws IOException, ParseException { CookieHandler.setDefault(new CookieManager()); List bibEntries = parser.parseEntries(new URLDownload(searchUrl).asInputStream()); for (BibEntry bibEntry : bibEntries) { @@ -79,7 +79,7 @@ void testParseEntries() throws IOException, ParseException { } @Test - void testParseDoiSearchPage() throws ParseException, IOException { + void parseDoiSearchPage() throws ParseException, IOException { String testDoi = "10.1145/3129790.3129810"; CookieHandler.setDefault(new CookieManager()); List doiList = parser.parseDoiSearchPage(new URLDownload(searchUrl).asInputStream()); @@ -88,7 +88,7 @@ void testParseDoiSearchPage() throws ParseException, IOException { } @Test - void testGetBibEntriesFromDoiList() throws FetcherException { + void getBibEntriesFromDoiList() throws FetcherException { List testDoiList = List.of("10.1145/3129790.3129810", "10.1145/2950290"); List bibEntries = parser.getBibEntriesFromDoiList(testDoiList); for (BibEntry bibEntry : bibEntries) { @@ -98,7 +98,7 @@ void testGetBibEntriesFromDoiList() throws FetcherException { } @Test - void testGetUrlFromDoiList() throws MalformedURLException, URISyntaxException { + void getUrlFromDoiList() throws MalformedURLException, URISyntaxException { String target = "https://dl.acm.org/action/exportCiteProcCitation?targetFile=custom-bibtex&format=bibTex&dois=10.1145%2F3129790.3129810%2C10.1145%2F2950290"; List doiList = List.of("10.1145/3129790.3129810", "10.1145/2950290"); @@ -107,14 +107,14 @@ void testGetUrlFromDoiList() throws MalformedURLException, URISyntaxException { } @Test - void testParseBibEntry() { + void parseBibEntry() { BibEntry bibEntry = parser.parseBibEntry(jsonStr); bibEntry.clearField(StandardField.ABSTRACT); assertEquals(searchEntryList.getFirst(), bibEntry); } @Test - void testParseBibEntryWithFamilyAuthorOnly() { + void parseBibEntryWithFamilyAuthorOnly() { String json = "{\"id\":\"10.1145/3011077.3011113\",\"type\":\"PAPER_CONFERENCE\",\"author\":[{\"family\":\"Ngo-Thi-Thu-Trang\"},{\"family\":\"Bui\",\"given\":\"Hieu T.\"},{\"family\":\"Nguyen\",\"given\":\"Nhan D.\"}],\"accessed\":{\"date-parts\":[[2023,8,4]]},\"issued\":{\"date-parts\":[[2016,12,8]]},\"original-date\":{\"date-parts\":[[2016,12,8]]},\"abstract\":\"\",\"call-number\":\"10.1145/3011077.3011113\",\"collection-title\":\"SoICT '16\",\"container-title\":\"Proceedings of the 7th Symposium on Information and Communication Technology\",\"DOI\":\"10.1145/3011077.3011113\",\"event-place\":\"Ho Chi Minh City, Vietnam\",\"ISBN\":\"9781450348157\",\"keyword\":\"orthogonal frequency division multiplexing (OFDM), long-range passive optical network (LR PON), four-wave mixing (FWM), wavelength division multiplexing (WDM)\",\"number-of-pages\":\"6\",\"page\":\"216–221\",\"publisher\":\"Association for Computing Machinery\",\"publisher-place\":\"New York, NY, USA\",\"title\":\"A simple performance analysis of IM-DD OFDM WDM systems in long range PON application\",\"URL\":\"https://doi.org/10.1145/3011077.3011113\"}"; BibEntry expectedEntry = new BibEntry(StandardEntryType.Conference) .withField(StandardField.AUTHOR, "Ngo-Thi-Thu-Trang and Bui, Hieu T. and Nguyen, Nhan D.") @@ -139,7 +139,7 @@ void testParseBibEntryWithFamilyAuthorOnly() { } @Test - void testNoEntryFound() throws URISyntaxException, IOException, ParseException { + void noEntryFound() throws URISyntaxException, IOException, ParseException { CookieHandler.setDefault(new CookieManager()); URL url = new URIBuilder("https://dl.acm.org/action/doSearch?AllField=10.1145/3129790.31298").build().toURL(); List bibEntries = parser.parseEntries(new URLDownload(url).asInputStream()); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterFilesTest.java index db9ad71e613..6c5634abb93 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterFilesTest.java @@ -19,13 +19,13 @@ private static Stream fileNames() throws IOException { @ParameterizedTest @MethodSource("fileNames") - public void testIsRecognizedFormat(String fileName) throws IOException { + public void isRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsRecognizedFormat(new BiblioscapeImporter(), fileName); } @ParameterizedTest @MethodSource("fileNames") - public void testImportEntries(String fileName) throws Exception { + public void importEntries(String fileName) throws Exception { ImporterTestEngine.testImportEntries(new BiblioscapeImporter(), fileName, FILE_ENDING); } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTest.java index d83d80e5a0d..2bf72ec8cf3 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/BiblioscapeImporterTest.java @@ -20,28 +20,28 @@ public void setUp() throws Exception { } @Test - public void testGetFormatName() { + public void getFormatName() { assertEquals("Biblioscape", importer.getName()); } @Test - public void testsGetExtensions() { + public void sGetExtensions() { assertEquals(StandardFileType.TXT, importer.getFileType()); } @Test - public void testGetDescription() { + public void getDescription() { assertEquals("Imports a Biblioscape Tag File.\n" + "Several Biblioscape field types are ignored. Others are only included in the BibTeX field \"comment\".", importer.getDescription()); } @Test - public void testGetCLIID() { + public void getCLIID() { assertEquals("biblioscape", importer.getId()); } @Test - public void testImportEntriesAbortion() throws Throwable { + public void importEntriesAbortion() throws Throwable { Path file = Path.of(BiblioscapeImporter.class.getResource("BiblioscapeImporterTestCorrupt.txt").toURI()); assertEquals(Collections.emptyList(), importer.importDatabase(file).getDatabase().getEntries()); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/BibtexImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/BibtexImporterTest.java index d95eb7382c9..6aad5b3ab7c 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/BibtexImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/BibtexImporterTest.java @@ -47,13 +47,13 @@ public void setUp() { } @Test - public void testIsRecognizedFormat() throws IOException, URISyntaxException { + public void isRecognizedFormat() throws IOException, URISyntaxException { Path file = Path.of(BibtexImporterTest.class.getResource("BibtexImporter.examples.bib").toURI()); assertTrue(importer.isRecognizedFormat(file)); } @Test - public void testImportEntries() throws IOException, URISyntaxException { + public void importEntries() throws IOException, URISyntaxException { Path file = Path.of(BibtexImporterTest.class.getResource("BibtexImporter.examples.bib").toURI()); List bibEntries = importer.importDatabase(file).getDatabase().getEntries(); @@ -112,30 +112,30 @@ public void testImportEntries() throws IOException, URISyntaxException { } @Test - public void testGetFormatName() { + public void getFormatName() { assertEquals("BibTeX", importer.getName()); } @Test - public void testsGetExtensions() { + public void sGetExtensions() { assertEquals(StandardFileType.BIBTEX_DB, importer.getFileType()); } @Test - public void testGetDescription() { + public void getDescription() { assertEquals( "This importer enables `--importToOpen someEntry.bib`", importer.getDescription()); } @Test - public void testRecognizesDatabaseID() throws Exception { + public void recognizesDatabaseID() throws Exception { Path file = Path.of(BibtexImporterTest.class.getResource("AutosavedSharedDatabase.bib").toURI()); String sharedDatabaseID = importer.importDatabase(file).getDatabase().getSharedDatabaseID().get(); assertEquals("13ceoc8dm42f5g1iitao3dj2ap", sharedDatabaseID); } - static Stream testParsingOfEncodedFileWithHeader() { + static Stream parsingOfEncodedFileWithHeader() { return Stream.of( Arguments.of(StandardCharsets.US_ASCII, "encoding-us-ascii-with-header.bib"), Arguments.of(StandardCharsets.UTF_8, "encoding-utf-8-with-header.bib"), @@ -147,7 +147,7 @@ static Stream testParsingOfEncodedFileWithHeader() { @ParameterizedTest @MethodSource - public void testParsingOfEncodedFileWithHeader(Charset charset, String fileName) throws Exception { + public void parsingOfEncodedFileWithHeader(Charset charset, String fileName) throws Exception { ParserResult parserResult = importer.importDatabase( Path.of(BibtexImporterTest.class.getResource(fileName).toURI())); assertEquals(Optional.of(charset), parserResult.getMetaData().getEncoding()); @@ -155,7 +155,7 @@ public void testParsingOfEncodedFileWithHeader(Charset charset, String fileName) @ParameterizedTest @CsvSource({"encoding-windows-1252-with-header.bib", "encoding-windows-1252-without-header.bib"}) - public void testParsingOfWindows1252EncodedFileReadsDegreeCharacterCorrectly(String filename) throws Exception { + public void parsingOfWindows1252EncodedFileReadsDegreeCharacterCorrectly(String filename) throws Exception { ParserResult parserResult = importer.importDatabase( Path.of(BibtexImporterTest.class.getResource(filename).toURI())); assertEquals( @@ -166,7 +166,7 @@ public void testParsingOfWindows1252EncodedFileReadsDegreeCharacterCorrectly(Str @ParameterizedTest @CsvSource({"encoding-utf-8-with-header.bib", "encoding-utf-8-without-header.bib", "encoding-utf-16BE-with-header.bib", "encoding-utf-16BE-without-header.bib"}) - public void testParsingFilesReadsUmlautCharacterCorrectly(String filename) throws Exception { + public void parsingFilesReadsUmlautCharacterCorrectly(String filename) throws Exception { ParserResult parserResult = importer.importDatabase( Path.of(BibtexImporterTest.class.getResource(filename).toURI())); assertEquals( diff --git a/src/test/java/org/jabref/logic/importer/fileformat/CffImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/CffImporterTest.java index bea868227c1..54cbfee44bf 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/CffImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/CffImporterTest.java @@ -30,34 +30,34 @@ public void setUp() { } @Test - public void testGetFormatName() { + public void getFormatName() { assertEquals("CFF", importer.getName()); } @Test - public void testGetCLIId() { + public void getCLIId() { assertEquals("cff", importer.getId()); } @Test - public void testsGetExtensions() { + public void sGetExtensions() { assertEquals(StandardFileType.CFF, importer.getFileType()); } @Test - public void testGetDescription() { + public void getDescription() { assertEquals("Importer for the CFF format. Is only used to cite software, one entry per file.", importer.getDescription()); } @Test - public void testIsRecognizedFormat() throws IOException, URISyntaxException { + public void isRecognizedFormat() throws IOException, URISyntaxException { Path file = Path.of(CffImporterTest.class.getResource("CffImporterTestValid.cff").toURI()); assertTrue(importer.isRecognizedFormat(file)); } @Test - public void testIsRecognizedFormatReject() throws IOException, URISyntaxException { + public void isRecognizedFormatReject() throws IOException, URISyntaxException { List list = Arrays.asList("CffImporterTestInvalid1.cff", "CffImporterTestInvalid2.cff"); for (String string : list) { @@ -67,7 +67,7 @@ public void testIsRecognizedFormatReject() throws IOException, URISyntaxExceptio } @Test - public void testImportEntriesBasic() throws IOException, URISyntaxException { + public void importEntriesBasic() throws IOException, URISyntaxException { Path file = Path.of(CffImporterTest.class.getResource("CffImporterTestValid.cff").toURI()); List bibEntries = importer.importDatabase(file).getDatabase().getEntries(); BibEntry entry = bibEntries.getFirst(); @@ -78,7 +78,7 @@ public void testImportEntriesBasic() throws IOException, URISyntaxException { } @Test - public void testImportEntriesMultipleAuthors() throws IOException, URISyntaxException { + public void importEntriesMultipleAuthors() throws IOException, URISyntaxException { Path file = Path.of(CffImporterTest.class.getResource("CffImporterTestValidMultAuthors.cff").toURI()); List bibEntries = importer.importDatabase(file).getDatabase().getEntries(); BibEntry entry = bibEntries.getFirst(); @@ -89,7 +89,7 @@ public void testImportEntriesMultipleAuthors() throws IOException, URISyntaxExce } @Test - public void testImportEntriesSwhIdSelect1() throws IOException, URISyntaxException { + public void importEntriesSwhIdSelect1() throws IOException, URISyntaxException { Path file = Path.of(CffImporterTest.class.getResource("CffImporterTestValidSwhIdSelect1.cff").toURI()); List bibEntries = importer.importDatabase(file).getDatabase().getEntries(); BibEntry entry = bibEntries.getFirst(); @@ -100,7 +100,7 @@ public void testImportEntriesSwhIdSelect1() throws IOException, URISyntaxExcepti } @Test - public void testImportEntriesSwhIdSelect2() throws IOException, URISyntaxException { + public void importEntriesSwhIdSelect2() throws IOException, URISyntaxException { Path file = Path.of(CffImporterTest.class.getResource("CffImporterTestValidSwhIdSelect2.cff").toURI()); List bibEntries = importer.importDatabase(file).getDatabase().getEntries(); BibEntry entry = bibEntries.getFirst(); @@ -111,7 +111,7 @@ public void testImportEntriesSwhIdSelect2() throws IOException, URISyntaxExcepti } @Test - public void testImportEntriesDataset() throws IOException, URISyntaxException { + public void importEntriesDataset() throws IOException, URISyntaxException { Path file = Path.of(CffImporterTest.class.getResource("CffImporterTestDataset.cff").toURI()); List bibEntries = importer.importDatabase(file).getDatabase().getEntries(); BibEntry entry = bibEntries.getFirst(); @@ -123,7 +123,7 @@ public void testImportEntriesDataset() throws IOException, URISyntaxException { } @Test - public void testImportEntriesDoiSelect() throws IOException, URISyntaxException { + public void importEntriesDoiSelect() throws IOException, URISyntaxException { Path file = Path.of(CffImporterTest.class.getResource("CffImporterTestDoiSelect.cff").toURI()); List bibEntries = importer.importDatabase(file).getDatabase().getEntries(); BibEntry entry = bibEntries.getFirst(); @@ -134,7 +134,7 @@ public void testImportEntriesDoiSelect() throws IOException, URISyntaxException } @Test - public void testImportEntriesUnknownFields() throws IOException, URISyntaxException { + public void importEntriesUnknownFields() throws IOException, URISyntaxException { Path file = Path.of(CffImporterTest.class.getResource("CffImporterTestUnknownFields.cff").toURI()); List bibEntries = importer.importDatabase(file).getDatabase().getEntries(); BibEntry entry = bibEntries.getFirst(); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/CitaviXmlImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/CitaviXmlImporterFilesTest.java index 4f59c86b0d5..3b642e169f0 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/CitaviXmlImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/CitaviXmlImporterFilesTest.java @@ -24,19 +24,19 @@ private static Stream invalidFileNames() throws IOException { @ParameterizedTest @MethodSource("fileNames") - void testIsRecognizedFormat(String fileName) throws IOException { + void isRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsRecognizedFormat(citaviXmlImporter, fileName); } @ParameterizedTest @MethodSource("invalidFileNames") - void testIsNotRecognizedFormat(String fileName) throws IOException { + void isNotRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsNotRecognizedFormat(citaviXmlImporter, fileName); } @ParameterizedTest @MethodSource("fileNames") - void testImportEntries(String fileName) throws Exception { + void importEntries(String fileName) throws Exception { ImporterTestEngine.testImportEntries(citaviXmlImporter, fileName, FILE_ENDING); } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterFilesTest.java index c35b0c4c901..a5a70ac9436 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterFilesTest.java @@ -24,19 +24,19 @@ private static Stream nonCopacfileNames() throws IOException { @ParameterizedTest @MethodSource("fileNames") - public void testIsRecognizedFormat(String fileName) throws IOException { + public void isRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsRecognizedFormat(new CopacImporter(), fileName); } @ParameterizedTest @MethodSource("nonCopacfileNames") - public void testIsNotRecognizedFormat(String fileName) throws IOException { + public void isNotRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsNotRecognizedFormat(new CopacImporter(), fileName); } @ParameterizedTest @MethodSource("fileNames") - public void testImportEntries(String fileName) throws Exception { + public void importEntries(String fileName) throws Exception { ImporterTestEngine.testImportEntries(new CopacImporter(), fileName, FILE_ENDING); } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTest.java index 3ecf3760a49..82d85c03f5e 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/CopacImporterTest.java @@ -22,17 +22,17 @@ public void setUp() throws Exception { } @Test - public void testsGetExtensions() { + public void sGetExtensions() { assertEquals(StandardFileType.TXT, importer.getFileType()); } @Test - public void testGetDescription() { + public void getDescription() { assertEquals("Importer for COPAC format.", importer.getDescription()); } @Test - public void testImportEmptyEntries() throws Exception { + public void importEmptyEntries() throws Exception { Path path = Path.of(CopacImporterTest.class.getResource("Empty.txt").toURI()); List entries = importer.importDatabase(path).getDatabase().getEntries(); assertEquals(Collections.emptyList(), entries); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/CustomImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/CustomImporterTest.java index 52108a8097d..2c818fb6c37 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/CustomImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/CustomImporterTest.java @@ -21,28 +21,28 @@ public void setUp() throws Exception { } @Test - public void testGetName() { + public void getName() { assertEquals("Copac", importer.getName()); } @Test - public void testGetId() { + public void getId() { assertEquals("cpc", importer.getId()); } @Test - public void testGetClassName() { + public void getClassName() { assertEquals("org.jabref.logic.importer.fileformat.CopacImporter", importer.getClassName()); } @Test - public void testGetBasePath() { + public void getBasePath() { assertEquals(Path.of("src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java"), importer.getBasePath()); } @Test - public void testGetAsStringList() { + public void getAsStringList() { assertEquals(Arrays.asList("src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java", "org.jabref.logic.importer.fileformat.CopacImporter"), importer.getAsStringList()); } @@ -59,14 +59,14 @@ public void equalsIsBasedOnName() { } @Test - public void testCompareToSmaller() throws Exception { + public void compareToSmaller() throws Exception { CustomImporter ovidImporter = asCustomImporter(new OvidImporter()); assertTrue(importer.compareTo(ovidImporter) < 0); } @Test - public void testCompareToEven() throws Exception { + public void compareToEven() throws Exception { assertEquals(0, importer.compareTo(asCustomImporter(new CopacImporter()))); } @@ -76,7 +76,7 @@ public void testToString() { } @Test - public void testClassicConstructor() throws Exception { + public void classicConstructor() throws Exception { CustomImporter customImporter = new CustomImporter( "src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java", "org.jabref.logic.importer.fileformat.CopacImporter"); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java index f0891b0f36f..c249e7901d5 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/EndnoteImporterTest.java @@ -31,28 +31,28 @@ public void setUp() { } @Test - public void testGetFormatName() { + public void getFormatName() { assertEquals("Refer/Endnote", importer.getName()); } @Test - public void testGetCLIId() { + public void getCLIId() { assertEquals("refer", importer.getId()); } @Test - public void testsGetExtensions() { + public void sGetExtensions() { assertEquals(StandardFileType.ENDNOTE, importer.getFileType()); } @Test - public void testGetDescription() { + public void getDescription() { assertEquals("Importer for the Refer/Endnote format." + " Modified to use article number for pages if pages are missing.", importer.getDescription()); } @Test - public void testIsRecognizedFormat() throws IOException, URISyntaxException { + public void isRecognizedFormat() throws IOException, URISyntaxException { List list = Arrays.asList("Endnote.pattern.A.enw", "Endnote.pattern.E.enw", "Endnote.book.example.enw"); for (String string : list) { @@ -62,7 +62,7 @@ public void testIsRecognizedFormat() throws IOException, URISyntaxException { } @Test - public void testIsRecognizedFormatReject() throws IOException, URISyntaxException { + public void isRecognizedFormatReject() throws IOException, URISyntaxException { List list = Arrays.asList("IEEEImport1.txt", "IsiImporterTest1.isi", "IsiImporterTestInspec.isi", "IsiImporterTestWOS.isi", "IsiImporterTestMedline.isi", "RisImporterTest1.ris", "Endnote.pattern.no_enw", "empty.pdf", "annotated.pdf"); @@ -74,7 +74,7 @@ public void testIsRecognizedFormatReject() throws IOException, URISyntaxExceptio } @Test - public void testImportEntries0() throws IOException, URISyntaxException { + public void importEntries0() throws IOException, URISyntaxException { Path file = Path.of(EndnoteImporterTest.class.getResource("Endnote.entries.enw").toURI()); List bibEntries = importer.importDatabase(file).getDatabase().getEntries(); @@ -119,7 +119,7 @@ public void testImportEntries0() throws IOException, URISyntaxException { } @Test - public void testImportEntries1() throws IOException { + public void importEntries1() throws IOException { String medlineString = "%O Artn\\\\s testO\n%A testA,\n%E testE0, testE1"; List bibEntries = importer.importDatabase(new BufferedReader(new StringReader(medlineString))).getDatabase() .getEntries(); @@ -134,7 +134,7 @@ public void testImportEntries1() throws IOException { } @Test - public void testImportEntriesBookExample() throws IOException, URISyntaxException { + public void importEntriesBookExample() throws IOException, URISyntaxException { Path file = Path.of(EndnoteImporterTest.class.getResource("Endnote.book.example.enw").toURI()); List bibEntries = importer.importDatabase(file).getDatabase().getEntries(); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporterFilesTest.java index ec3e816ae03..4ad4c9a597f 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporterFilesTest.java @@ -37,19 +37,19 @@ void setUp() { @ParameterizedTest @MethodSource("fileNames") - void testIsRecognizedFormat(String fileName) throws IOException { + void isRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsRecognizedFormat(new EndnoteXmlImporter(importFormatPreferences), fileName); } @ParameterizedTest @MethodSource("invalidFileNames") - void testIsNotRecognizedFormat(String fileName) throws IOException { + void isNotRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsNotRecognizedFormat(new EndnoteXmlImporter(importFormatPreferences), fileName); } @ParameterizedTest @MethodSource("fileNames") - void testImportEntries(String fileName) throws Exception { + void importEntries(String fileName) throws Exception { ImporterTestEngine.testImportEntries(new EndnoteXmlImporter(importFormatPreferences), fileName, FILE_ENDING); } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java index 8cc5aade7df..e4abd486231 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java @@ -46,18 +46,18 @@ public void setUp() throws Exception { @ParameterizedTest @MethodSource("fileNames") - public void testIsRecognizedFormatAccept(String fileName) throws IOException { + public void isRecognizedFormatAccept(String fileName) throws IOException { ImporterTestEngine.testIsRecognizedFormat(importer, fileName); } @ParameterizedTest @MethodSource("nonInspecfileNames") - public void testIsRecognizedFormatReject(String fileName) throws IOException { + public void isRecognizedFormatReject(String fileName) throws IOException { ImporterTestEngine.testIsNotRecognizedFormat(importer, fileName); } @Test - public void testCompleteBibtexEntryOnJournalPaperImport() throws IOException, URISyntaxException { + public void completeBibtexEntryOnJournalPaperImport() throws IOException, URISyntaxException { BibEntry expectedEntry = new BibEntry(StandardEntryType.Article); expectedEntry.setField(StandardField.TITLE, "The SIS project : software reuse with a natural language approach"); expectedEntry.setField(StandardField.AUTHOR, "Prechelt, Lutz"); @@ -105,22 +105,22 @@ public void importMiscGivesMisc() throws IOException { } @Test - public void testGetFormatName() { + public void getFormatName() { assertEquals("INSPEC", importer.getName()); } @Test - public void testGetCLIId() { + public void getCLIId() { assertEquals("inspec", importer.getId()); } @Test - public void testsGetExtensions() { + public void sGetExtensions() { assertEquals(StandardFileType.TXT, importer.getFileType()); } @Test - public void testGetDescription() { + public void getDescription() { assertEquals("INSPEC format importer.", importer.getDescription()); } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java index b69442f64fe..29f86b5fed0 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java @@ -41,45 +41,45 @@ private static Stream invalidFileNames() throws IOException { } @Test - public void testParseMonthException() { + public void parseMonthException() { IsiImporter.parseMonth("20l06 06-07"); } @Test - public void testGetFormatName() { + public void getFormatName() { assertEquals("ISI", importer.getName()); } @Test - public void testGetCLIId() { + public void getCLIId() { assertEquals("isi", importer.getId()); } @Test - public void testsGetExtensions() { + public void sGetExtensions() { assertEquals(StandardFileType.ISI, importer.getFileType()); } @Test - public void testGetDescription() { + public void getDescription() { assertEquals("Importer for the ISI Web of Science, INSPEC and Medline format.", importer.getDescription()); } @ParameterizedTest @MethodSource("fileNames") - public void testIsRecognizedFormatAccepted(String fileName) throws IOException { + public void isRecognizedFormatAccepted(String fileName) throws IOException { ImporterTestEngine.testIsRecognizedFormat(importer, fileName); } @ParameterizedTest @MethodSource("invalidFileNames") - public void testIsRecognizedFormatRejected(String fileName) throws IOException { + public void isRecognizedFormatRejected(String fileName) throws IOException { ImporterTestEngine.testIsNotRecognizedFormat(importer, fileName); } @Test - public void testProcessSubSup() { + public void processSubSup() { HashMap subs = new HashMap<>(); subs.put(StandardField.TITLE, "/sub 3/"); @@ -124,7 +124,7 @@ public void testProcessSubSup() { } @Test - public void testImportEntries1() throws IOException, URISyntaxException { + public void importEntries1() throws IOException, URISyntaxException { Path file = Path.of(IsiImporterTest.class.getResource("IsiImporterTest1.isi").toURI()); List entries = importer.importDatabase(file).getDatabase().getEntries(); BibEntry entry = entries.getFirst(); @@ -145,7 +145,7 @@ public void testImportEntries1() throws IOException, URISyntaxException { } @Test - public void testImportEntries2() throws IOException, URISyntaxException { + public void importEntries2() throws IOException, URISyntaxException { Path file = Path.of(IsiImporterTest.class.getResource("IsiImporterTest2.isi").toURI()); List entries = importer.importDatabase(file).getDatabase().getEntries(); BibEntry entry = entries.getFirst(); @@ -162,7 +162,7 @@ public void testImportEntries2() throws IOException, URISyntaxException { } @Test - public void testImportEntriesINSPEC() throws IOException, URISyntaxException { + public void importEntriesINSPEC() throws IOException, URISyntaxException { Path file = Path.of(IsiImporterTest.class.getResource("IsiImporterTestInspec.isi").toURI()); List entries = importer.importDatabase(file).getDatabase().getEntries(); @@ -199,7 +199,7 @@ public void testImportEntriesINSPEC() throws IOException, URISyntaxException { } @Test - public void testImportEntriesWOS() throws IOException, URISyntaxException { + public void importEntriesWOS() throws IOException, URISyntaxException { Path file = Path.of(IsiImporterTest.class.getResource("IsiImporterTestWOS.isi").toURI()); List entries = importer.importDatabase(file).getDatabase().getEntries(); @@ -217,7 +217,7 @@ public void testImportEntriesWOS() throws IOException, URISyntaxException { } @Test - public void testIsiAuthorsConvert() { + public void isiAuthorsConvert() { assertEquals( "James Brown and James Marc Brown and Brown, J. M. and Brown, J. and Brown, J. M. and Brown, J.", IsiImporter.isiAuthorsConvert( @@ -230,7 +230,7 @@ public void testIsiAuthorsConvert() { } @Test - public void testMonthConvert() { + public void monthConvert() { assertEquals("#jun#", IsiImporter.parseMonth("06")); assertEquals("#jun#", IsiImporter.parseMonth("JUN")); assertEquals("#jun#", IsiImporter.parseMonth("jUn")); @@ -242,7 +242,7 @@ public void testMonthConvert() { } @Test - public void testIsiAuthorConvert() { + public void isiAuthorConvert() { assertEquals("James Brown", IsiImporter.isiAuthorConvert("James Brown")); assertEquals("James Marc Brown", IsiImporter.isiAuthorConvert("James Marc Brown")); assertEquals("Brown, J. M.", IsiImporter.isiAuthorConvert("Brown, J.M.")); @@ -255,7 +255,7 @@ public void testIsiAuthorConvert() { } @Test - public void testImportIEEEExport() throws IOException, URISyntaxException { + public void importIEEEExport() throws IOException, URISyntaxException { Path file = Path.of(IsiImporterTest.class.getResource("IEEEImport1.txt").toURI()); List entries = importer.importDatabase(file).getDatabase().getEntries(); BibEntry entry = entries.getFirst(); @@ -278,7 +278,7 @@ public void testImportIEEEExport() throws IOException, URISyntaxException { } @Test - public void testIEEEImport() throws IOException, URISyntaxException { + public void iEEEImport() throws IOException, URISyntaxException { Path file = Path.of(IsiImporterTest.class.getResource("IEEEImport1.txt").toURI()); List entries = importer.importDatabase(file).getDatabase().getEntries(); BibEntry entry = entries.getFirst(); @@ -302,7 +302,7 @@ public void testIEEEImport() throws IOException, URISyntaxException { } @Test - public void testImportEntriesMedline() throws IOException, URISyntaxException { + public void importEntriesMedline() throws IOException, URISyntaxException { Path file = Path.of(IsiImporterTest.class.getResource("IsiImporterTestMedline.isi").toURI()); List entries = importer.importDatabase(file).getDatabase().getEntries(); @@ -338,7 +338,7 @@ public void testImportEntriesMedline() throws IOException, URISyntaxException { } @Test - public void testImportEntriesEmpty() throws IOException, URISyntaxException { + public void importEntriesEmpty() throws IOException, URISyntaxException { Path file = Path.of(IsiImporterTest.class.getResource("IsiImporterTestEmpty.isi").toURI()); List entries = importer.importDatabase(file).getDatabase().getEntries(); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MarcXmlParserTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MarcXmlParserTest.java index 15a27f0cc9c..74aebd0592d 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MarcXmlParserTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MarcXmlParserTest.java @@ -35,7 +35,7 @@ private void doTest(String xmlName, String bibName) throws Exception { @ParameterizedTest @MethodSource("fileNames") - public void testImportEntries(String fileName) throws Exception { + public void importEntries(String fileName) throws Exception { String bibName = FileUtil.getBaseName(fileName) + ".bib"; doTest(fileName, bibName); } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterFilesTest.java index 949f02a9ab9..63bd1e165cc 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterFilesTest.java @@ -26,19 +26,19 @@ private static Stream invalidFileNames() throws IOException { @ParameterizedTest @MethodSource("fileNames") - public void testIsRecognizedFormat(String fileName) throws IOException { + public void isRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsRecognizedFormat(new MedlineImporter(), fileName); } @ParameterizedTest @MethodSource("invalidFileNames") - public void testIsNotRecognizedFormat(String fileName) throws IOException { + public void isNotRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsNotRecognizedFormat(new MedlineImporter(), fileName); } @ParameterizedTest @MethodSource("fileNames") - public void testImportEntries(String fileName) throws Exception { + public void importEntries(String fileName) throws Exception { ImporterTestEngine.testImportEntries(new MedlineImporter(), fileName, FILE_ENDING); } @@ -50,7 +50,7 @@ private static Stream malformedFileNames() throws IOException { @ParameterizedTest @MethodSource("malformedFileNames") - public void testImportMalfomedFiles(String fileName) throws IOException { + public void importMalfomedFiles(String fileName) throws IOException { ImporterTestEngine.testImportMalformedFiles(new MedlineImporter(), fileName); } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java index 79044243f87..1e8a2562d88 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java @@ -27,22 +27,22 @@ public void setUp() throws Exception { } @Test - public void testGetFormatName() { + public void getFormatName() { assertEquals("Medline/PubMed", importer.getName()); } @Test - public void testGetCLIId() { + public void getCLIId() { assertEquals("medline", importer.getId()); } @Test - public void testsGetExtensions() { + public void sGetExtensions() { assertEquals(StandardFileType.MEDLINE, importer.getFileType()); } @Test - public void testGetDescription() { + public void getDescription() { assertEquals("Importer for the Medline format.", importer.getDescription()); } } 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 998251d45a8..4e522c3b032 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java @@ -52,18 +52,18 @@ void setUp() { } @Test - void testsGetExtensions() { + void sGetExtensions() { assertEquals(StandardFileType.MEDLINE_PLAIN, importer.getFileType()); } @Test - void testGetDescription() { + void getDescription() { assertEquals("Importer for the MedlinePlain format.", importer.getDescription()); } @ParameterizedTest @MethodSource("fileNames") - void testIsRecognizedFormat(String fileName) throws Exception { + void isRecognizedFormat(String fileName) throws Exception { ImporterTestEngine.testIsRecognizedFormat(importer, fileName); } @@ -73,7 +73,7 @@ void doesNotRecognizeEmptyFiles() throws IOException { } @Test - void testImportMultipleEntriesInSingleFile() throws IOException, URISyntaxException { + void importMultipleEntriesInSingleFile() throws IOException, URISyntaxException { Path inputFile = Path.of(MedlinePlainImporter.class.getResource("MedlinePlainImporterTestMultipleEntries.txt").toURI()); List entries = importer.importDatabase(inputFile).getDatabase() @@ -121,7 +121,7 @@ void testImportMultipleEntriesInSingleFile() throws IOException, URISyntaxExcept } @Test - void testEmptyFileImport() throws IOException { + void emptyFileImport() throws IOException { List emptyEntries = importer.importDatabase(readerForString("")).getDatabase().getEntries(); assertEquals(Collections.emptyList(), emptyEntries); } @@ -134,7 +134,7 @@ void testEmptyFileImport() throws IOException { "MedlinePlainImporterTestDOI", "MedlinePlainImporterTestInproceeding" }) - void testImportSingleEntriesInSingleFiles(String testFile) throws IOException, URISyntaxException { + void importSingleEntriesInSingleFiles(String testFile) throws IOException, URISyntaxException { String medlineFile = testFile + ".txt"; String bibtexFile = testFile + ".bib"; assertImportOfMedlineFileEqualsBibtexFile(medlineFile, bibtexFile); @@ -152,7 +152,7 @@ private void assertImportOfMedlineFileEqualsBibtexFile(String medlineFile, Strin } @Test - void testMultiLineComments() throws IOException { + 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" @@ -171,7 +171,7 @@ void testMultiLineComments() throws IOException { } @Test - void testKeyWords() throws IOException { + void keyWords() throws IOException { try (BufferedReader reader = readerForString("PMID-22664795" + "\n" + "MH - Female" + "\n" + "OT - Male")) { List actualEntries = importer.importDatabase(reader).getDatabase().getEntries(); @@ -183,7 +183,7 @@ void testKeyWords() throws IOException { } @Test - void testWithNbibFile() throws IOException, URISyntaxException { + void withNbibFile() throws IOException, URISyntaxException { Path file = Path.of(MedlinePlainImporter.class.getResource("NbibImporterTest.nbib").toURI()); List entries = importer.importDatabase(file).getDatabase().getEntries(); @@ -192,7 +192,7 @@ void testWithNbibFile() throws IOException, URISyntaxException { } @Test - void testWithMultipleEntries() throws IOException, URISyntaxException { + void withMultipleEntries() throws IOException, URISyntaxException { Path file = Path.of(MedlinePlainImporter.class.getResource("MedlinePlainImporterStringOutOfBounds.txt").toURI()); List entries = importer.importDatabase(file).getDatabase().getEntries(); @@ -201,7 +201,7 @@ void testWithMultipleEntries() throws IOException, URISyntaxException { } @Test - void testInvalidFormat() throws URISyntaxException, IOException { + void invalidFormat() throws URISyntaxException, IOException { Path file = Path.of(MedlinePlainImporter.class.getResource("MedlinePlainImporterTestInvalidFormat.xml").toURI()); List entries = importer.importDatabase(file).getDatabase().getEntries(); @@ -210,7 +210,7 @@ void testInvalidFormat() throws URISyntaxException, IOException { } @Test - void testNullReader() throws IOException { + void nullReader() throws IOException { Executable fail = () -> { try (BufferedReader reader = null) { importer.importDatabase(reader); @@ -220,7 +220,7 @@ void testNullReader() throws IOException { } @Test - void testAllArticleTypes() throws IOException { + 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")) { @@ -235,12 +235,12 @@ void testAllArticleTypes() throws IOException { } @Test - void testGetFormatName() { + void getFormatName() { assertEquals("Medline/PubMed Plain", importer.getName()); } @Test - void testGetCLIId() { + void getCLIId() { assertEquals("medlineplain", importer.getId()); } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/ModsImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/ModsImporterFilesTest.java index 879e62469fc..f51f0ce7fdc 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/ModsImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/ModsImporterFilesTest.java @@ -32,13 +32,13 @@ void setUp() { @ParameterizedTest @MethodSource("fileNames") - void testIsRecognizedFormat(String fileName) throws IOException { + void isRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsRecognizedFormat(new ModsImporter(importFormatPreferences), fileName); } @ParameterizedTest @MethodSource("fileNames") - void testImportEntries(String fileName) throws Exception { + void importEntries(String fileName) throws Exception { ImporterTestEngine.testImportEntries(new ModsImporter(importFormatPreferences), fileName, FILE_ENDING); } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java index 65998e04981..2a51be11490 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java @@ -29,22 +29,22 @@ public void setUp() { } @Test - public void testGetDescription() { + public void getDescription() { assertEquals("Takes valid JSON documents from the Mr. DLib API and parses them into a BibEntry", importer.getDescription()); } @Test - public void testGetName() { + public void getName() { assertEquals("MrDLibImporter", importer.getName()); } @Test - public void testGetFileExtention() { + public void getFileExtention() { assertEquals(StandardFileType.JSON, importer.getFileType()); } @Test - public void testImportDatabaseIsYearSetCorrectly() throws IOException { + public void importDatabaseIsYearSetCorrectly() throws IOException { ParserResult parserResult = importer.importDatabase(input); List resultList = parserResult.getDatabase().getEntries(); @@ -54,7 +54,7 @@ public void testImportDatabaseIsYearSetCorrectly() throws IOException { } @Test - public void testImportDatabaseIsTitleSetCorrectly() throws IOException { + public void importDatabaseIsTitleSetCorrectly() throws IOException { ParserResult parserResult = importer.importDatabase(input); List resultList = parserResult.getDatabase().getEntries(); @@ -64,7 +64,7 @@ public void testImportDatabaseIsTitleSetCorrectly() throws IOException { } @Test - public void testImportDatabaseMin() throws IOException { + public void importDatabaseMin() throws IOException { ParserResult parserResult = importer.importDatabase(input); List resultList = parserResult.getDatabase().getEntries(); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterFilesTest.java index 2562c524858..a6cadfe9ed3 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterFilesTest.java @@ -24,19 +24,19 @@ private static Stream invalidFileNames() throws IOException { @ParameterizedTest @MethodSource("fileNames") - public void testIsRecognizedFormat(String fileName) throws IOException { + public void isRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsRecognizedFormat(new MsBibImporter(), fileName); } @ParameterizedTest @MethodSource("invalidFileNames") - public void testIsNotRecognizedFormat(String fileName) throws IOException { + public void isNotRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsNotRecognizedFormat(new MsBibImporter(), fileName); } @ParameterizedTest @MethodSource("fileNames") - public void testImportEntries(String fileName) throws Exception { + public void importEntries(String fileName) throws Exception { ImporterTestEngine.testImportEntries(new MsBibImporter(), fileName, FILE_ENDING); } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java index c87c3d77cc0..0d53a2f60b9 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java @@ -18,19 +18,19 @@ public class MsBibImporterTest { @Test - public void testsGetExtensions() { + public void sGetExtensions() { MsBibImporter importer = new MsBibImporter(); assertEquals(StandardFileType.XML, importer.getFileType()); } @Test - public void testGetDescription() { + public void getDescription() { MsBibImporter importer = new MsBibImporter(); assertEquals("Importer for the MS Office 2007 XML bibliography format.", importer.getDescription()); } @Test - public final void testIsNotRecognizedFormat() throws Exception { + public final void isNotRecognizedFormat() throws Exception { MsBibImporter testImporter = new MsBibImporter(); List notAccepted = Arrays.asList("CopacImporterTest1.txt", "IsiImporterTest1.isi", "IsiImporterTestInspec.isi", "emptyFile.xml", "IsiImporterTestWOS.isi"); @@ -41,7 +41,7 @@ public final void testIsNotRecognizedFormat() throws Exception { } @Test - public final void testImportEntriesEmpty() throws IOException, URISyntaxException { + public final void importEntriesEmpty() throws IOException, URISyntaxException { MsBibImporter testImporter = new MsBibImporter(); Path file = Path.of(MsBibImporter.class.getResource("EmptyMsBib_Test.xml").toURI()); List entries = testImporter.importDatabase(file).getDatabase().getEntries(); @@ -49,7 +49,7 @@ public final void testImportEntriesEmpty() throws IOException, URISyntaxExceptio } @Test - public final void testImportEntriesNotRecognizedFormat() throws IOException, URISyntaxException { + public final void importEntriesNotRecognizedFormat() throws IOException, URISyntaxException { MsBibImporter testImporter = new MsBibImporter(); Path file = Path.of(MsBibImporter.class.getResource("CopacImporterTest1.txt").toURI()); List entries = testImporter.importDatabase(file).getDatabase().getEntries(); @@ -57,13 +57,13 @@ public final void testImportEntriesNotRecognizedFormat() throws IOException, URI } @Test - public final void testGetFormatName() { + public final void getFormatName() { MsBibImporter testImporter = new MsBibImporter(); assertEquals("MSBib", testImporter.getName()); } @Test - public final void testGetCommandLineId() { + public final void getCommandLineId() { MsBibImporter testImporter = new MsBibImporter(); assertEquals("msbib", testImporter.getId()); } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java index e61188a3fff..4b680c0d7a0 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java @@ -48,46 +48,46 @@ public void setUp() { } @Test - public void testGetFormatName() { + public void getFormatName() { assertEquals("Ovid", importer.getName()); } @Test - public void testGetCLIId() { + public void getCLIId() { assertEquals("ovid", importer.getId()); } @Test - public void testsGetExtensions() { + public void sGetExtensions() { assertEquals(StandardFileType.TXT, importer.getFileType()); } @Test - public void testGetDescription() { + public void getDescription() { assertEquals("Imports an Ovid file.", importer.getDescription()); } @ParameterizedTest @MethodSource("fileNames") - public void testIsRecognizedFormatAccept(String fileName) throws IOException, URISyntaxException { + public void isRecognizedFormatAccept(String fileName) throws IOException, URISyntaxException { ImporterTestEngine.testIsRecognizedFormat(importer, fileName); } @ParameterizedTest @MethodSource("invalidFileNames") - public void testIsRecognizedFormatRejected(String fileName) throws IOException, URISyntaxException { + public void isRecognizedFormatRejected(String fileName) throws IOException, URISyntaxException { ImporterTestEngine.testIsNotRecognizedFormat(importer, fileName); } @Test - public void testImportEmpty() throws IOException, URISyntaxException { + public void importEmpty() throws IOException, URISyntaxException { Path file = Path.of(OvidImporter.class.getResource("Empty.txt").toURI()); List entries = importer.importDatabase(file).getDatabase().getEntries(); assertEquals(Collections.emptyList(), entries); } @Test - public void testImportEntries1() throws IOException, URISyntaxException { + public void importEntries1() throws IOException, URISyntaxException { Path file = Path.of(OvidImporter.class.getResource("OvidImporterTest1.txt").toURI()); List entries = importer.importDatabase(file).getDatabase().getEntries(); assertEquals(5, entries.size()); @@ -140,14 +140,14 @@ public void testImportEntries1() throws IOException, URISyntaxException { } @Test - public void testImportEntries2() throws IOException, URISyntaxException { + public void importEntries2() throws IOException, URISyntaxException { Path file = Path.of(OvidImporter.class.getResource("OvidImporterTest2Invalid.txt").toURI()); List entries = importer.importDatabase(file).getDatabase().getEntries(); assertEquals(Collections.emptyList(), entries); } @Test - public void testImportSingleEntries() throws IOException, URISyntaxException { + public void importSingleEntries() throws IOException, URISyntaxException { for (int n = 3; n <= 7; n++) { Path file = Path.of(OvidImporter.class.getResource("OvidImporterTest" + n + ".txt").toURI()); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterFilesTest.java index 39033ed6f68..326b5c0bd02 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterFilesTest.java @@ -20,14 +20,14 @@ private static Stream fileNames() throws IOException { @ParameterizedTest @MethodSource("fileNames") - void testIsRecognizedFormat(String fileName) throws IOException { + void isRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsRecognizedFormat(new PdfContentImporter(), fileName); } @ParameterizedTest @MethodSource("fileNames") @Disabled("bib file does not contain linked file") - void testImportEntries(String fileName) throws Exception { + void importEntries(String fileName) throws Exception { ImporterTestEngine.testImportEntries(new PdfContentImporter(), fileName, FILE_ENDING); } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java index e290c52b2a1..cc5baf59824 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java @@ -26,12 +26,12 @@ void setUp() { } @Test - void testsGetExtensions() { + void sGetExtensions() { assertEquals(StandardFileType.PDF, importer.getFileType()); } @Test - void testGetDescription() { + void getDescription() { assertEquals("PdfContentImporter parses data of the first page of the PDF and creates a BibTeX entry. Currently, Springer and IEEE formats are supported.", importer.getDescription()); } @@ -59,7 +59,7 @@ void importTwiceWorksAsExpected() throws Exception { } @Test - void testParsingEditorWithoutPagesorSeriesInformation() { + void parsingEditorWithoutPagesorSeriesInformation() { BibEntry entry = new BibEntry(StandardEntryType.InProceedings); entry.setField(StandardField.AUTHOR, "Anke Lüdeling and Merja Kytö (Eds.)"); entry.setField(StandardField.EDITOR, "Anke Lüdeling and Merja Kytö"); @@ -86,7 +86,7 @@ void testParsingEditorWithoutPagesorSeriesInformation() { } @Test - void testParsingWithoutActualDOINumber() { + void parsingWithoutActualDOINumber() { BibEntry entry = new BibEntry(StandardEntryType.InProceedings); entry.withField(StandardField.AUTHOR, "Link to record in KAR and http://kar.kent.ac.uk/51043/ and Document Version and UNSPECIFIED and Master of Research (MRes) thesis and University of Kent") .withField(StandardField.TITLE, "Kent Academic Repository Full text document (pdf) Citation for published version Smith, Lucy Anna (2014) Mortality in the Ornamental Fish Retail Sector: an Analysis of Stock Losses and Stakeholder Opinions. DOI") diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporterTest.java index bdd841c54bc..e7433323f1c 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporterTest.java @@ -32,12 +32,12 @@ void setUp() { } @Test - void testsGetExtensions() { + void sGetExtensions() { assertEquals(StandardFileType.PDF, importer.getFileType()); } @Test - void testGetDescription() { + void getDescription() { assertEquals("PdfEmbeddedBibFileImporter imports an embedded Bib-File from the PDF.", importer.getDescription()); } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfGrobidImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfGrobidImporterTest.java index b1f43a45d45..9e9b47b5b1a 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfGrobidImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfGrobidImporterTest.java @@ -42,12 +42,12 @@ public void setUp() { } @Test - public void testsGetExtensions() { + public void sGetExtensions() { assertEquals(StandardFileType.PDF, importer.getFileType()); } @Test - public void testImportEntries() throws URISyntaxException { + public void importEntries() throws URISyntaxException { Path file = Path.of(PdfGrobidImporterTest.class.getResource("LNCS-minimal.pdf").toURI()); List bibEntries = importer.importDatabase(file).getDatabase().getEntries(); @@ -59,19 +59,19 @@ public void testImportEntries() throws URISyntaxException { } @Test - public void testIsRecognizedFormat() throws IOException, URISyntaxException { + public void isRecognizedFormat() throws IOException, URISyntaxException { Path file = Path.of(PdfGrobidImporterTest.class.getResource("annotated.pdf").toURI()); assertTrue(importer.isRecognizedFormat(file)); } @Test - public void testIsRecognizedFormatReject() throws IOException, URISyntaxException { + public void isRecognizedFormatReject() throws IOException, URISyntaxException { Path file = Path.of(PdfGrobidImporterTest.class.getResource("BibtexImporter.examples.bib").toURI()); assertFalse(importer.isRecognizedFormat(file)); } @Test - public void testGetCommandLineId() { + public void getCommandLineId() { assertEquals("grobidPdf", importer.getId()); } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java index c66f2b01a9d..7cc2e714bb3 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java @@ -44,12 +44,12 @@ void setUp() { } @Test - void testsGetExtensions() { + void sGetExtensions() { assertEquals(StandardFileType.PDF, importer.getFileType()); } @Test - void testGetDescription() { + void getDescription() { assertEquals("PdfMergeMetadataImporter imports metadata from a PDF using multiple strategies and merging the result.", importer.getDescription()); } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporterTest.java index c7adc53f8d5..15fa9aabbda 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporterTest.java @@ -33,12 +33,12 @@ void setUp() { } @Test - void testsGetExtensions() { + void sGetExtensions() { assertEquals(StandardFileType.PDF, importer.getFileType()); } @Test - void testGetDescription() { + void getDescription() { assertEquals("PdfVerbatimBibTextImporter imports a verbatim BibTeX entry from the first page of the PDF.", importer.getDescription()); } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java index fcb76611462..2e097bd13eb 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java @@ -39,17 +39,17 @@ public void setUp() { } @Test - public void testGetFormatName() { + public void getFormatName() { assertEquals("XMP-annotated PDF", importer.getName()); } @Test - public void testsGetExtensions() { + public void sGetExtensions() { assertEquals(StandardFileType.PDF, importer.getFileType()); } @Test - public void testGetDescription() { + public void getDescription() { assertEquals("Wraps the XMPUtility function to be used as an Importer.", importer.getDescription()); } @@ -62,7 +62,7 @@ public void importEncryptedFileReturnsError() throws URISyntaxException { } @Test - public void testImportEntries() throws URISyntaxException { + public void importEntries() throws URISyntaxException { Path file = Path.of(PdfXmpImporterTest.class.getResource("annotated.pdf").toURI()); List bibEntries = importer.importDatabase(file).getDatabase().getEntries(); @@ -76,19 +76,19 @@ public void testImportEntries() throws URISyntaxException { } @Test - public void testIsRecognizedFormat() throws IOException, URISyntaxException { + public void isRecognizedFormat() throws IOException, URISyntaxException { Path file = Path.of(PdfXmpImporterTest.class.getResource("annotated.pdf").toURI()); assertTrue(importer.isRecognizedFormat(file)); } @ParameterizedTest @MethodSource("invalidFileNames") - public void testIsRecognizedFormatReject(String fileName) throws IOException, URISyntaxException { + public void isRecognizedFormatReject(String fileName) throws IOException, URISyntaxException { ImporterTestEngine.testIsNotRecognizedFormat(importer, fileName); } @Test - public void testGetCommandLineId() { + public void getCommandLineId() { assertEquals("xmp", importer.getId()); } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/RISImporterFilesTest.java b/src/test/java/org/jabref/logic/importer/fileformat/RISImporterFilesTest.java index cf7e9158f79..d343a3925bf 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/RISImporterFilesTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/RISImporterFilesTest.java @@ -18,13 +18,13 @@ private static Stream fileNames() throws IOException { @ParameterizedTest @MethodSource("fileNames") - void testIsRecognizedFormat(String fileName) throws IOException { + void isRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsRecognizedFormat(new RisImporter(), fileName); } @ParameterizedTest @MethodSource("fileNames") - void testImportEntries(String fileName) throws Exception { + void importEntries(String fileName) throws Exception { ImporterTestEngine.testImportEntries(new RisImporter(), fileName, FILE_ENDING); } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java index 11ad5bb9782..4f29d20567a 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java @@ -22,27 +22,27 @@ public void setUp() { } @Test - public void testGetFormatName() { + public void getFormatName() { assertEquals("RIS", importer.getName()); } @Test - public void testGetCLIId() { + public void getCLIId() { assertEquals("ris", importer.getId()); } @Test - public void testsGetExtensions() { + public void sGetExtensions() { assertEquals(StandardFileType.RIS, importer.getFileType()); } @Test - public void testGetDescription() { + public void getDescription() { assertEquals("Imports a Biblioscape Tag File.", importer.getDescription()); } @Test - public void testIfNotRecognizedFormat() throws IOException, URISyntaxException { + public void ifNotRecognizedFormat() throws IOException, URISyntaxException { Path file = Path.of(RISImporterTest.class.getResource("RisImporterCorrupted.ris").toURI()); assertFalse(importer.isRecognizedFormat(file)); } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java index 5130e8913fa..7768bbef2b2 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java @@ -44,39 +44,39 @@ private static Stream invalidFileNames() throws IOException { @ParameterizedTest @MethodSource("fileNames") - public void testIsRecognizedFormat(String fileName) throws IOException { + public void isRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsRecognizedFormat(testImporter, fileName); } @ParameterizedTest @MethodSource("invalidFileNames") - public void testIsNotRecognizedFormat(String fileName) throws IOException { + public void isNotRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsNotRecognizedFormat(testImporter, fileName); } @ParameterizedTest @MethodSource("fileNames") - public void testImportEntries(String fileName) throws Exception { + public void importEntries(String fileName) throws Exception { ImporterTestEngine.testImportEntries(testImporter, fileName, FILE_ENDING); } @Test - public final void testGetFormatName() { + public final void getFormatName() { assertEquals("REPEC New Economic Papers (NEP)", testImporter.getName()); } @Test - public final void testGetCliId() { + public final void getCliId() { assertEquals("repecnep", testImporter.getId()); } @Test - public void testGetExtension() { + public void getExtension() { assertEquals(StandardFileType.TXT, testImporter.getFileType()); } @Test - public final void testGetDescription() { + public final void getDescription() { assertEquals("Imports a New Economics Papers-Message from the REPEC-NEP Service.", testImporter.getDescription()); } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/SilverPlatterImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/SilverPlatterImporterTest.java index 5fdee2d9235..580b469f7e7 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/SilverPlatterImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/SilverPlatterImporterTest.java @@ -37,29 +37,29 @@ private static Stream invalidFileNames() throws IOException { @ParameterizedTest @MethodSource("fileNames") - void testIsRecognizedFormat(String fileName) throws IOException { + void isRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsRecognizedFormat(testImporter, fileName); } @ParameterizedTest @MethodSource("invalidFileNames") - void testIsNotRecognizedFormat(String fileName) throws IOException { + void isNotRecognizedFormat(String fileName) throws IOException { ImporterTestEngine.testIsNotRecognizedFormat(testImporter, fileName); } @ParameterizedTest @MethodSource("fileNames") - void testImportEntries(String fileName) throws Exception { + void importEntries(String fileName) throws Exception { ImporterTestEngine.testImportEntries(testImporter, fileName, FILE_ENDING); } @Test - void testsGetExtensions() { + void sGetExtensions() { assertEquals(StandardFileType.SILVER_PLATTER, testImporter.getFileType()); } @Test - void testGetDescription() { + void getDescription() { assertEquals("Imports a SilverPlatter exported file.", testImporter.getDescription()); } } diff --git a/src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java b/src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java index 061295491a5..886657e7125 100644 --- a/src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java +++ b/src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java @@ -70,7 +70,7 @@ void fromStringThrowsParseExceptionForNotEscapedGroupName() throws Exception { } @Test - void testImportSubGroups() throws Exception { + void importSubGroups() throws Exception { List orderedData = Arrays.asList("0 AllEntriesGroup:", "1 ExplicitGroup:1;0;", "2 ExplicitGroup:2;0;", "0 ExplicitGroup:3;0;"); diff --git a/src/test/java/org/jabref/logic/integrity/DoiDuplicationCheckerTest.java b/src/test/java/org/jabref/logic/integrity/DoiDuplicationCheckerTest.java index 5b877503674..c01f2c78702 100644 --- a/src/test/java/org/jabref/logic/integrity/DoiDuplicationCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/DoiDuplicationCheckerTest.java @@ -25,7 +25,7 @@ public class DoiDuplicationCheckerTest { private BibEntry doiC_entry1 = new BibEntry().withField(StandardField.DOI, doiC); @Test - public void testOnePairDuplicateDOI() { + public void onePairDuplicateDOI() { List entries = List.of(doiA_entry1, doiA_entry2, doiC_entry1); BibDatabase database = new BibDatabase(entries); List results = List.of(new IntegrityMessage(Localization.lang("Same DOI used in multiple entries"), doiA_entry1, StandardField.DOI), @@ -34,7 +34,7 @@ public void testOnePairDuplicateDOI() { } @Test - public void testMultiPairsDuplicateDOI() { + public void multiPairsDuplicateDOI() { List entries = List.of(doiA_entry1, doiA_entry2, doiB_entry1, doiB_entry2, doiC_entry1); BibDatabase database = new BibDatabase(entries); List results = List.of(new IntegrityMessage(Localization.lang("Same DOI used in multiple entries"), doiA_entry1, StandardField.DOI), @@ -45,7 +45,7 @@ public void testMultiPairsDuplicateDOI() { } @Test - public void testNoDuplicateDOI() { + public void noDuplicateDOI() { List entries = List.of(doiA_entry1, doiB_entry1, doiC_entry1); BibDatabase database = new BibDatabase(entries); assertEquals(Collections.emptyList(), checker.check(database)); diff --git a/src/test/java/org/jabref/logic/integrity/EntryLinkCheckerTest.java b/src/test/java/org/jabref/logic/integrity/EntryLinkCheckerTest.java index 344751c2576..e4885246c66 100644 --- a/src/test/java/org/jabref/logic/integrity/EntryLinkCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/EntryLinkCheckerTest.java @@ -29,23 +29,23 @@ void setUp() { } @Test - void testEntryLinkChecker() { + void entryLinkChecker() { assertThrows(NullPointerException.class, () -> new EntryLinkChecker(null)); } @Test - void testCheckNoFields() { + void checkNoFields() { assertEquals(Collections.emptyList(), checker.check(entry)); } @Test - void testCheckNonRelatedFieldsOnly() { + void checkNonRelatedFieldsOnly() { entry.setField(StandardField.YEAR, "2016"); assertEquals(Collections.emptyList(), checker.check(entry)); } @Test - void testCheckNonExistingCrossref() { + void checkNonExistingCrossref() { entry.setField(StandardField.CROSSREF, "banana"); List message = checker.check(entry); @@ -53,7 +53,7 @@ void testCheckNonExistingCrossref() { } @Test - void testCheckExistingCrossref() { + void checkExistingCrossref() { entry.setField(StandardField.CROSSREF, "banana"); BibEntry entry2 = new BibEntry(); @@ -65,7 +65,7 @@ void testCheckExistingCrossref() { } @Test - void testCheckExistingRelated() { + void checkExistingRelated() { entry.setField(StandardField.RELATED, "banana,pineapple"); BibEntry entry2 = new BibEntry(); @@ -81,7 +81,7 @@ void testCheckExistingRelated() { } @Test - void testCheckNonExistingRelated() { + void checkNonExistingRelated() { BibEntry entry1 = new BibEntry(); entry1.setField(StandardField.RELATED, "banana,pineapple,strawberry"); database.insertEntry(entry1); diff --git a/src/test/java/org/jabref/logic/integrity/HTMLCharacterCheckerTest.java b/src/test/java/org/jabref/logic/integrity/HTMLCharacterCheckerTest.java index f185132a29c..14fc2d15038 100644 --- a/src/test/java/org/jabref/logic/integrity/HTMLCharacterCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/HTMLCharacterCheckerTest.java @@ -22,7 +22,7 @@ public class HTMLCharacterCheckerTest { private final BibEntry entry = new BibEntry(); @Test - void testSettingNullThrowsNPE() { + void settingNullThrowsNPE() { assertThrows( NullPointerException.class, () -> entry.setField(StandardField.AUTHOR, null) diff --git a/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java b/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java index daaa371c3f7..d7229ac2062 100644 --- a/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java +++ b/src/test/java/org/jabref/logic/integrity/IntegrityCheckTest.java @@ -94,7 +94,7 @@ private static Stream provideIncorrectFormat() { } @Test - void testFileChecks() throws Exception { + void fileChecks() throws Exception { MetaData metaData = mock(MetaData.class); Mockito.when(metaData.getDefaultFileDirectory()).thenReturn(Optional.of(".")); Mockito.when(metaData.getUserFileDirectory(any(String.class))).thenReturn(Optional.empty()); @@ -120,7 +120,7 @@ void fileCheckFindsFilesRelativeToBibFile(@TempDir Path testFolder) throws Excep } @Test - void testEntryIsUnchangedAfterChecks() throws Exception { + void entryIsUnchangedAfterChecks() throws Exception { BibEntry entry = new BibEntry(); // populate with all known fields diff --git a/src/test/java/org/jabref/logic/integrity/YearCheckerTest.java b/src/test/java/org/jabref/logic/integrity/YearCheckerTest.java index dcd68676def..27c03259ed2 100644 --- a/src/test/java/org/jabref/logic/integrity/YearCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/YearCheckerTest.java @@ -87,7 +87,7 @@ void yearFieldDoesNotRemoveStringBeforeSpecialCharacters() { } @Test - void testEmptyValue() { + void emptyValue() { assertEquals(Optional.empty(), checker.checkValue("")); } } diff --git a/src/test/java/org/jabref/logic/journals/AbbreviationParserTest.java b/src/test/java/org/jabref/logic/journals/AbbreviationParserTest.java index 3237b60588a..aab33eb0082 100644 --- a/src/test/java/org/jabref/logic/journals/AbbreviationParserTest.java +++ b/src/test/java/org/jabref/logic/journals/AbbreviationParserTest.java @@ -25,7 +25,7 @@ void setup(@TempDir Path tempDir) { } @Test - void testReadingFileFromCSVWithSemicolon() throws Exception { + void readingFileFromCSVWithSemicolon() throws Exception { // String name, String abbreviation, String shortestUniqueAbbreviation String testAbbrev = "Long Name;L.N.;L.N."; try (BufferedWriter writer = Files.newBufferedWriter(csvFile, StandardCharsets.UTF_8)) { @@ -36,7 +36,7 @@ void testReadingFileFromCSVWithSemicolon() throws Exception { } @Test - void testReadingFileFromCSVWithComma() throws Exception { + void readingFileFromCSVWithComma() throws Exception { String testAbbrev = "Long Name,L.N.,L.N."; try (BufferedWriter writer = Files.newBufferedWriter(csvFile, StandardCharsets.UTF_8)) { writer.write(testAbbrev); diff --git a/src/test/java/org/jabref/logic/journals/AbbreviationTest.java b/src/test/java/org/jabref/logic/journals/AbbreviationTest.java index 423e235c0c2..1cd3bb5b4e1 100644 --- a/src/test/java/org/jabref/logic/journals/AbbreviationTest.java +++ b/src/test/java/org/jabref/logic/journals/AbbreviationTest.java @@ -8,7 +8,7 @@ class AbbreviationTest { @Test - void testAbbreviationsWithTrailingSpaces() { + void abbreviationsWithTrailingSpaces() { Abbreviation abbreviation = new Abbreviation("Long Name", "L. N."); assertEquals("Long Name", abbreviation.getName()); @@ -18,7 +18,7 @@ void testAbbreviationsWithTrailingSpaces() { } @Test - void testAbbreviationsWithTrailingSpacesWithShortestUniqueAbbreviation() { + void abbreviationsWithTrailingSpacesWithShortestUniqueAbbreviation() { Abbreviation abbreviation = new Abbreviation("Long Name", "L. N.", "LN"); assertEquals("Long Name", abbreviation.getName()); @@ -28,7 +28,7 @@ void testAbbreviationsWithTrailingSpacesWithShortestUniqueAbbreviation() { } @Test - void testAbbreviationsWithSemicolons() { + void abbreviationsWithSemicolons() { Abbreviation abbreviation = new Abbreviation("Long Name", "L. N.;LN;M"); assertEquals("Long Name", abbreviation.getName()); @@ -38,7 +38,7 @@ void testAbbreviationsWithSemicolons() { } @Test - void testAbbreviationsWithSemicolonsWithShortestUniqueAbbreviation() { + void abbreviationsWithSemicolonsWithShortestUniqueAbbreviation() { Abbreviation abbreviation = new Abbreviation("Long Name", "L. N.;LN;M", "LNLNM"); assertEquals("Long Name", abbreviation.getName()); @@ -48,7 +48,7 @@ void testAbbreviationsWithSemicolonsWithShortestUniqueAbbreviation() { } @Test - void testGetNextElement() { + void getNextElement() { Abbreviation abbreviation = new Abbreviation("Long Name", "L. N."); assertEquals("L. N.", abbreviation.getNext("Long Name")); @@ -57,7 +57,7 @@ void testGetNextElement() { } @Test - void testGetNextElementWithShortestUniqueAbbreviation() { + void getNextElementWithShortestUniqueAbbreviation() { Abbreviation abbreviation = new Abbreviation("Long Name", "L. N.", "LN"); assertEquals("L. N.", abbreviation.getNext("Long Name")); @@ -67,7 +67,7 @@ void testGetNextElementWithShortestUniqueAbbreviation() { } @Test - void testGetNextElementWithTrailingSpaces() { + void getNextElementWithTrailingSpaces() { Abbreviation abbreviation = new Abbreviation("Long Name", "L. N."); assertEquals("L. N.", abbreviation.getNext("Long Name")); @@ -76,7 +76,7 @@ void testGetNextElementWithTrailingSpaces() { } @Test - void testGetNextElementWithTrailingSpacesWithShortestUniqueAbbreviation() { + void getNextElementWithTrailingSpacesWithShortestUniqueAbbreviation() { Abbreviation abbreviation = new Abbreviation("Long Name", "L. N.", "LN"); assertEquals("L. N.", abbreviation.getNext("Long Name")); @@ -86,25 +86,25 @@ void testGetNextElementWithTrailingSpacesWithShortestUniqueAbbreviation() { } @Test - void testDefaultAndMedlineAbbreviationsAreSame() { + void defaultAndMedlineAbbreviationsAreSame() { Abbreviation abbreviation = new Abbreviation("Long Name", "L N"); assertEquals(abbreviation.getAbbreviation(), abbreviation.getDotlessAbbreviation()); } @Test - void testDefaultAndMedlineAbbreviationsAreSameWithShortestUniqueAbbreviation() { + void defaultAndMedlineAbbreviationsAreSameWithShortestUniqueAbbreviation() { Abbreviation abbreviation = new Abbreviation("Long Name", "L N", "LN"); assertEquals(abbreviation.getAbbreviation(), abbreviation.getDotlessAbbreviation()); } @Test - void testDefaultAndShortestUniqueAbbreviationsAreSame() { + void defaultAndShortestUniqueAbbreviationsAreSame() { Abbreviation abbreviation = new Abbreviation("Long Name", "L N"); assertEquals(abbreviation.getAbbreviation(), abbreviation.getShortestUniqueAbbreviation()); } @Test - void testEquals() { + void equals() { Abbreviation abbreviation = new Abbreviation("Long Name", "L N", "LN"); Abbreviation otherAbbreviation = new Abbreviation("Long Name", "L N", "LN"); assertEquals(abbreviation, otherAbbreviation); diff --git a/src/test/java/org/jabref/logic/journals/JournalAbbreviationRepositoryTest.java b/src/test/java/org/jabref/logic/journals/JournalAbbreviationRepositoryTest.java index 442e9d3a3c1..66614ce76f5 100644 --- a/src/test/java/org/jabref/logic/journals/JournalAbbreviationRepositoryTest.java +++ b/src/test/java/org/jabref/logic/journals/JournalAbbreviationRepositoryTest.java @@ -93,35 +93,35 @@ void oneElementWithShortestUniqueAbbreviation() { } @Test - void testDuplicates() { + void duplicates() { repository.addCustomAbbreviation(new Abbreviation("Long Name", "L. N.")); repository.addCustomAbbreviation(new Abbreviation("Long Name", "L. N.")); assertEquals(1, repository.getCustomAbbreviations().size()); } @Test - void testDuplicatesWithShortestUniqueAbbreviation() { + void duplicatesWithShortestUniqueAbbreviation() { repository.addCustomAbbreviation(new Abbreviation("Long Name", "L. N.", "LN")); repository.addCustomAbbreviation(new Abbreviation("Long Name", "L. N.", "LN")); assertEquals(1, repository.getCustomAbbreviations().size()); } @Test - void testDuplicatesIsoOnly() { + void duplicatesIsoOnly() { repository.addCustomAbbreviation(new Abbreviation("Old Long Name", "L. N.")); repository.addCustomAbbreviation(new Abbreviation("New Long Name", "L. N.")); assertEquals(2, repository.getCustomAbbreviations().size()); } @Test - void testDuplicatesIsoOnlyWithShortestUniqueAbbreviation() { + void duplicatesIsoOnlyWithShortestUniqueAbbreviation() { repository.addCustomAbbreviation(new Abbreviation("Old Long Name", "L. N.", "LN")); repository.addCustomAbbreviation(new Abbreviation("New Long Name", "L. N.", "LN")); assertEquals(2, repository.getCustomAbbreviations().size()); } @Test - void testDuplicateKeys() { + void duplicateKeys() { Abbreviation abbreviationOne = new Abbreviation("Long Name", "L. N."); repository.addCustomAbbreviation(abbreviationOne); assertEquals(Set.of(abbreviationOne), repository.getCustomAbbreviations()); @@ -137,7 +137,7 @@ void testDuplicateKeys() { } @Test - void testDuplicateKeysWithShortestUniqueAbbreviation() { + void duplicateKeysWithShortestUniqueAbbreviation() { Abbreviation abbreviationOne = new Abbreviation("Long Name", "L. N.", "LN"); repository.addCustomAbbreviation(abbreviationOne); assertEquals(Set.of(abbreviationOne), repository.getCustomAbbreviations()); @@ -165,7 +165,7 @@ void getFromAbbreviatedName() { } @Test - void testAbbreviationsWithEscapedAmpersand() { + void abbreviationsWithEscapedAmpersand() { assertEquals(new Abbreviation("ACS Applied Materials & Interfaces", "ACS Appl. Mater. Interfaces"), repository.get("ACS Applied Materials & Interfaces").get()); assertEquals(new Abbreviation("ACS Applied Materials & Interfaces", "ACS Appl. Mater. Interfaces"), repository.get("ACS Applied Materials \\& Interfaces").get()); assertEquals(new Abbreviation("Antioxidants & Redox Signaling", "Antioxid. Redox Sign."), repository.get("Antioxidants & Redox Signaling").get()); @@ -177,7 +177,7 @@ void testAbbreviationsWithEscapedAmpersand() { } @Test - void testJournalAbbreviationWithEscapedAmpersand() { + void journalAbbreviationWithEscapedAmpersand() { UndoableAbbreviator undoableAbbreviator = new UndoableAbbreviator(repository, AbbreviationType.DEFAULT, false); BibEntry entryWithEscapedAmpersandInJournal = new BibEntry(StandardEntryType.Article); @@ -190,7 +190,7 @@ void testJournalAbbreviationWithEscapedAmpersand() { } @Test - void testJournalUnabbreviate() { + void journalUnabbreviate() { BibEntry abbreviatedJournalEntry = new BibEntry(StandardEntryType.Article); abbreviatedJournalEntry.setField(StandardField.JOURNAL, "ACS Appl. Mater. Interfaces"); @@ -201,7 +201,7 @@ void testJournalUnabbreviate() { } @Test - void testJournalAbbreviateWithoutEscapedAmpersand() { + void journalAbbreviateWithoutEscapedAmpersand() { UndoableAbbreviator undoableAbbreviator = new UndoableAbbreviator(repository, AbbreviationType.DEFAULT, false); BibEntry entryWithoutEscapedAmpersandInJournal = new BibEntry(StandardEntryType.Article) @@ -214,7 +214,7 @@ void testJournalAbbreviateWithoutEscapedAmpersand() { } @Test - void testJournalAbbreviateWithEmptyFJournal() { + void journalAbbreviateWithEmptyFJournal() { UndoableAbbreviator undoableAbbreviator = new UndoableAbbreviator(repository, AbbreviationType.DEFAULT, true); BibEntry entryWithoutEscapedAmpersandInJournal = new BibEntry(StandardEntryType.Article) @@ -229,7 +229,7 @@ void testJournalAbbreviateWithEmptyFJournal() { } @Test - void testUnabbreviateWithJournalExistsAndFJournalNot() { + void unabbreviateWithJournalExistsAndFJournalNot() { BibEntry abbreviatedJournalEntry = new BibEntry(StandardEntryType.Article) .withField(StandardField.JOURNAL, "ACS Appl. Mater. Interfaces"); @@ -240,7 +240,7 @@ void testUnabbreviateWithJournalExistsAndFJournalNot() { } @Test - void testUnabbreviateWithJournalExistsAndFJournalExists() { + void unabbreviateWithJournalExistsAndFJournalExists() { BibEntry abbreviatedJournalEntry = new BibEntry(StandardEntryType.Article) .withField(StandardField.JOURNAL, "ACS Appl. Mater. Interfaces") .withField(AMSField.FJOURNAL, "ACS Applied Materials & Interfaces"); @@ -252,7 +252,7 @@ void testUnabbreviateWithJournalExistsAndFJournalExists() { } @Test - void testJournalDotlessAbbreviation() { + void journalDotlessAbbreviation() { BibEntry abbreviatedJournalEntry = new BibEntry(StandardEntryType.Article) .withField(StandardField.JOURNAL, "ACS Appl Mater Interfaces"); @@ -263,7 +263,7 @@ void testJournalDotlessAbbreviation() { } @Test - void testJournalDotlessAbbreviationWithCurlyBraces() { + void journalDotlessAbbreviationWithCurlyBraces() { BibEntry abbreviatedJournalEntry = new BibEntry(StandardEntryType.Article) .withField(StandardField.JOURNAL, "{ACS Appl Mater Interfaces}"); @@ -277,7 +277,7 @@ void testJournalDotlessAbbreviationWithCurlyBraces() { * Tests Issue 9475 */ @Test - void testTitleEmbeddedWithCurlyBracesHavingNoChangesKeepsBraces() { + void titleEmbeddedWithCurlyBracesHavingNoChangesKeepsBraces() { BibEntry abbreviatedJournalEntry = new BibEntry(StandardEntryType.InCollection) .withField(StandardField.JOURNAL, "{The Visualization Handbook}"); @@ -292,7 +292,7 @@ void testTitleEmbeddedWithCurlyBracesHavingNoChangesKeepsBraces() { * Tests Issue 9503 */ @Test - void testTitleWithNestedCurlyBracesHavingNoChangesKeepsBraces() { + void titleWithNestedCurlyBracesHavingNoChangesKeepsBraces() { BibEntry abbreviatedJournalEntry = new BibEntry(StandardEntryType.InProceedings) .withField(StandardField.BOOKTITLE, "2015 {IEEE} International Conference on Digital Signal Processing, {DSP} 2015, Singapore, July 21-24, 2015"); @@ -304,7 +304,7 @@ void testTitleWithNestedCurlyBracesHavingNoChangesKeepsBraces() { } @Test - void testDotlessForPhysRevB() { + void dotlessForPhysRevB() { BibEntry abbreviatedJournalEntry = new BibEntry(StandardEntryType.Article) .withField(StandardField.JOURNAL, "Phys Rev B"); diff --git a/src/test/java/org/jabref/logic/l10n/JavaLocalizationEntryParserTest.java b/src/test/java/org/jabref/logic/l10n/JavaLocalizationEntryParserTest.java index 803dec5df84..91c434cc406 100644 --- a/src/test/java/org/jabref/logic/l10n/JavaLocalizationEntryParserTest.java +++ b/src/test/java/org/jabref/logic/l10n/JavaLocalizationEntryParserTest.java @@ -67,20 +67,20 @@ public static Stream causesRuntimeExceptions() { @ParameterizedTest @MethodSource("singleLineChecks") - public void testLocalizationKeyParsing(String code, String expectedLanguageKeys) { - testLocalizationKeyParsing(code, List.of(expectedLanguageKeys)); + public void localizationKeyParsing(String code, String expectedLanguageKeys) { + localizationKeyParsing(code, List.of(expectedLanguageKeys)); } @ParameterizedTest @MethodSource("multiLineChecks") - public void testLocalizationKeyParsing(String code, List expectedLanguageKeys) { + public void localizationKeyParsing(String code, List expectedLanguageKeys) { List languageKeysInString = JavaLocalizationEntryParser.getLanguageKeysInString(code, LocalizationBundleForTest.LANG); assertEquals(expectedLanguageKeys, languageKeysInString); } @ParameterizedTest @MethodSource("singleLineParameterChecks") - public void testLocalizationParameterParsing(String code, String expectedParameter) { + public void localizationParameterParsing(String code, String expectedParameter) { List languageKeysInString = JavaLocalizationEntryParser.getLocalizationParameter(code, LocalizationBundleForTest.LANG); assertEquals(List.of(expectedParameter), languageKeysInString); } diff --git a/src/test/java/org/jabref/logic/l10n/LocalizationKeyParamsTest.java b/src/test/java/org/jabref/logic/l10n/LocalizationKeyParamsTest.java index cd7fcd49964..93c48520f1a 100644 --- a/src/test/java/org/jabref/logic/l10n/LocalizationKeyParamsTest.java +++ b/src/test/java/org/jabref/logic/l10n/LocalizationKeyParamsTest.java @@ -14,7 +14,7 @@ public class LocalizationKeyParamsTest { @ParameterizedTest @MethodSource("provideTestData") - public void testReplacePlaceholders(String expected, LocalizationKeyParams input) { + public void replacePlaceholders(String expected, LocalizationKeyParams input) { assertEquals(expected, input.replacePlaceholders()); } @@ -29,7 +29,7 @@ private static Stream provideTestData() { } @Test - public void testTooManyParams() { + public void tooManyParams() { assertThrows(IllegalStateException.class, () -> new LocalizationKeyParams("", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0")); } } diff --git a/src/test/java/org/jabref/logic/l10n/LocalizationTest.java b/src/test/java/org/jabref/logic/l10n/LocalizationTest.java index 596139f8b5d..c373608566c 100644 --- a/src/test/java/org/jabref/logic/l10n/LocalizationTest.java +++ b/src/test/java/org/jabref/logic/l10n/LocalizationTest.java @@ -24,26 +24,26 @@ void restoreDefaultLocale() { } @Test - void testSetKnownLanguage() { + void setKnownLanguage() { Locale.setDefault(Locale.CHINA); Localization.setLanguage(Language.ENGLISH); assertEquals("en", Locale.getDefault().toString()); } @Test - void testKnownTranslationWithGroups() { + void knownTranslationWithGroups() { Localization.setLanguage(Language.ENGLISH); assertEquals("Groups", Localization.lang("Groups")); } @Test - void testKnownEnglishTranslationOfUndo() { + void knownEnglishTranslationOfUndo() { Localization.setLanguage(Language.ENGLISH); assertEquals("Undo", Localization.lang("Undo")); } @Test - void testKnownGermanTranslation() { + void knownGermanTranslation() { Localization.setLanguage(Language.GERMAN); assertEquals("Zeige Einstellungen", Localization.lang("Show preferences")); } @@ -55,19 +55,19 @@ void newLineIsAvailableAndKeptUnescaped() { } @Test - void testKnownTranslationWithCountryModifier() { + void knownTranslationWithCountryModifier() { Localization.setLanguage(Language.BRAZILIAN_PORTUGUESE); assertEquals("Grupos", Localization.lang("Groups")); } @Test - void testUnknownTranslation() { + void unknownTranslation() { Localization.setLanguage(Language.ENGLISH); assertEquals("WHATEVER", Localization.lang("WHATEVER")); } @Test - void testUnsetLanguageTranslation() { + void unsetLanguageTranslation() { assertEquals("Groups", Localization.lang("Groups")); } } diff --git a/src/test/java/org/jabref/logic/layout/LayoutEntryTest.java b/src/test/java/org/jabref/logic/layout/LayoutEntryTest.java index 5b910a2f2e8..952cbcf33e7 100644 --- a/src/test/java/org/jabref/logic/layout/LayoutEntryTest.java +++ b/src/test/java/org/jabref/logic/layout/LayoutEntryTest.java @@ -69,7 +69,7 @@ public String layout(String layoutFile, BibEntry entry) throws IOException { } @Test - public void testParseMethodCalls() { + public void parseMethodCalls() { assertEquals(1, LayoutEntry.parseMethodsCalls("bla").size()); assertEquals("bla", (LayoutEntry.parseMethodsCalls("bla").get(0)).get(0)); diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorAbbreviatorTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorAbbreviatorTest.java index 10fd71c68c5..674e0185ed1 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorAbbreviatorTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorAbbreviatorTest.java @@ -12,7 +12,7 @@ public class AuthorAbbreviatorTest { @Test - public void testFormat() { + public void format() { LayoutFormatter a = new AuthorLastFirstAbbreviator(); LayoutFormatter b = new AuthorAbbreviator(); diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacerTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacerTest.java index 317400fbad3..c568fa4a729 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacerTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorAndToSemicolonReplacerTest.java @@ -23,7 +23,7 @@ private static Stream data() { @ParameterizedTest @MethodSource("data") - void testFormat(String input, String expected) { + void format(String input, String expected) { LayoutFormatter a = new AuthorAndToSemicolonReplacer(); assertEquals(expected, a.format(input)); diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacerTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacerTest.java index 0bdb1740918..b16f1066a98 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacerTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorAndsCommaReplacerTest.java @@ -12,7 +12,7 @@ public class AuthorAndsCommaReplacerTest { * Test method for {@link org.jabref.logic.layout.format.AuthorAndsCommaReplacer#format(java.lang.String)}. */ @Test - public void testFormat() { + public void format() { LayoutFormatter a = new AuthorAndsCommaReplacer(); // Empty case diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorAndsReplacerTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorAndsReplacerTest.java index 9c2bcb40c2c..37dc63b3882 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorAndsReplacerTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorAndsReplacerTest.java @@ -12,7 +12,7 @@ public class AuthorAndsReplacerTest { * Test method for {@link org.jabref.logic.layout.format.AuthorAndsReplacer#format(java.lang.String)}. */ @Test - public void testFormat() { + public void format() { LayoutFormatter a = new AuthorAndsReplacer(); // Empty case diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommasTest.java index b4f6f544589..24da76e2576 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastCommasTest.java @@ -9,7 +9,7 @@ public class AuthorFirstAbbrLastCommasTest { @Test - public void testFormat() { + public void format() { LayoutFormatter a = new AuthorFirstAbbrLastCommas(); // Empty case diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommasTest.java index f35de4b55ac..c3986b0488b 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorFirstAbbrLastOxfordCommasTest.java @@ -12,7 +12,7 @@ public class AuthorFirstAbbrLastOxfordCommasTest { * Test method for {@link org.jabref.logic.layout.format.AuthorFirstAbbrLastOxfordCommas#format(java.lang.String)}. */ @Test - public void testFormat() { + public void format() { LayoutFormatter a = new AuthorFirstAbbrLastOxfordCommas(); // Empty case diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstCommasTest.java index 1972b6b781e..19fe91f9429 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstCommasTest.java @@ -10,7 +10,7 @@ public class AuthorFirstFirstCommasTest { * Test method for {@link org.jabref.logic.layout.format.AuthorFirstFirstCommas#format(java.lang.String)}. */ @Test - public void testFormat() { + public void format() { assertEquals("John von Neumann, John Smith and Peter Black Brown, Jr", new AuthorFirstFirstCommas() .format("von Neumann,,John and John Smith and Black Brown, Jr, Peter")); diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstTest.java index d71647dd45e..777a626c89e 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorFirstFirstTest.java @@ -10,7 +10,7 @@ public class AuthorFirstFirstTest { * Test method for {@link org.jabref.logic.layout.format.AuthorFirstFirst#format(java.lang.String)}. */ @Test - public void testFormat() { + public void format() { assertEquals("John von Neumann and John Smith and Peter Black Brown, Jr", new AuthorFirstFirst() .format("von Neumann,,John and John Smith and Black Brown, Jr, Peter")); diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommasTest.java index 14c31580339..d596168fd52 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorFirstLastOxfordCommasTest.java @@ -12,7 +12,7 @@ public class AuthorFirstLastOxfordCommasTest { * Test method for {@link org.jabref.logic.layout.format.AuthorFirstLastOxfordCommas#format(java.lang.String)}. */ @Test - public void testFormat() { + public void format() { LayoutFormatter a = new AuthorFirstLastOxfordCommas(); // Empty case diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLF_FFAbbrTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorLF_FFAbbrTest.java index 937f7e0a71a..dd79e0550d5 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorLF_FFAbbrTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorLF_FFAbbrTest.java @@ -10,7 +10,7 @@ public class AuthorLF_FFAbbrTest { * Test method for {@link org.jabref.logic.layout.format.AuthorLF_FFAbbr#format(java.lang.String)}. */ @Test - public void testFormat() { + public void format() { assertEquals("von Neumann, J. and J. Smith and P. Black Brown, Jr", new AuthorLF_FFAbbr() .format("von Neumann,,John and John Smith and Black Brown, Jr, Peter")); diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLF_FFTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorLF_FFTest.java index c3bd13219bc..ee89752cc08 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorLF_FFTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorLF_FFTest.java @@ -10,7 +10,7 @@ public class AuthorLF_FFTest { * Test method for {@link org.jabref.logic.layout.format.AuthorLF_FF#format(java.lang.String)}. */ @Test - public void testFormat() { + public void format() { assertEquals("von Neumann, John and John Smith and Peter Black Brown, Jr", new AuthorLF_FF() .format("von Neumann,,John and John Smith and Black Brown, Jr, Peter")); diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommasTest.java index e49653a18c2..0d9936b84db 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrCommasTest.java @@ -12,7 +12,7 @@ public class AuthorLastFirstAbbrCommasTest { * Test method for {@link org.jabref.logic.layout.format.AuthorLastFirstAbbrCommas#format(java.lang.String)}. */ @Test - public void testFormat() { + public void format() { LayoutFormatter a = new AuthorLastFirstAbbrCommas(); // Empty case diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommasTest.java index 21a8e6a195d..21177f9b2bb 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbrOxfordCommasTest.java @@ -12,7 +12,7 @@ public class AuthorLastFirstAbbrOxfordCommasTest { * Test method for {@link org.jabref.logic.layout.format.AuthorLastFirstAbbrOxfordCommas#format(java.lang.String)}. */ @Test - public void testFormat() { + public void format() { LayoutFormatter a = new AuthorLastFirstAbbrOxfordCommas(); // Empty case diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbreviatorTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbreviatorTest.java index c5c97e87bd8..42ea2e8db89 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbreviatorTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstAbbreviatorTest.java @@ -15,7 +15,7 @@ class AuthorLastFirstAbbreviatorTest { * Ex: Lastname, Name */ @Test - void testOneAuthorSimpleName() { + void oneAuthorSimpleName() { assertEquals("Lastname, N.", abbreviate("Lastname, Name")); } @@ -25,7 +25,7 @@ void testOneAuthorSimpleName() { * Ex: Lastname, Name Middlename */ @Test - void testOneAuthorCommonName() { + void oneAuthorCommonName() { assertEquals("Lastname, N. M.", abbreviate("Lastname, Name Middlename")); } @@ -35,7 +35,7 @@ void testOneAuthorCommonName() { * Ex: Lastname, Name Middlename */ @Test - void testTwoAuthorsCommonName() { + void twoAuthorsCommonName() { String result = abbreviate("Lastname, Name Middlename and Sobrenome, Nome Nomedomeio"); String expectedResult = "Lastname, N. M. and Sobrenome, N. N."; @@ -43,12 +43,12 @@ void testTwoAuthorsCommonName() { } @Test - void testJrAuthor() { + void jrAuthor() { assertEquals("Other, Jr., A. N.", abbreviate("Other, Jr., Anthony N.")); } @Test - void testFormat() { + void format() { assertEquals("", abbreviate("")); assertEquals("Someone, V. S.", abbreviate("Someone, Van Something")); assertEquals("Smith, J.", abbreviate("Smith, John")); diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstCommasTest.java index 35d262ccffd..8486aea1cec 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstCommasTest.java @@ -12,7 +12,7 @@ public class AuthorLastFirstCommasTest { * Test method for {@link org.jabref.logic.layout.format.AuthorLastFirstCommas#format(java.lang.String)}. */ @Test - public void testFormat() { + public void format() { LayoutFormatter a = new AuthorLastFirstCommas(); // Empty case diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommasTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommasTest.java index e3beacbd4b4..62fb0608231 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommasTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstOxfordCommasTest.java @@ -12,7 +12,7 @@ public class AuthorLastFirstOxfordCommasTest { * Test method for {@link org.jabref.logic.layout.format.AuthorLastFirstOxfordCommas#format(java.lang.String)}. */ @Test - public void testFormat() { + public void format() { LayoutFormatter a = new AuthorLastFirstOxfordCommas(); // Empty case diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstTest.java index 8d26609ee87..9b3510a2afa 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorLastFirstTest.java @@ -9,7 +9,7 @@ public class AuthorLastFirstTest { @Test - public void testFormat() { + public void format() { LayoutFormatter a = new AuthorLastFirst(); // Empty case diff --git a/src/test/java/org/jabref/logic/layout/format/AuthorsTest.java b/src/test/java/org/jabref/logic/layout/format/AuthorsTest.java index 8a3e22410c3..9c216793ee8 100644 --- a/src/test/java/org/jabref/logic/layout/format/AuthorsTest.java +++ b/src/test/java/org/jabref/logic/layout/format/AuthorsTest.java @@ -13,128 +13,128 @@ public class AuthorsTest { private ParamLayoutFormatter authorsLayoutFormatter = new Authors(); @Test - public void testStandardUsage() { + public void standardUsage() { assertEquals("B. C. Bruce, C. Manson and J. Jumper", authorsLayoutFormatter.format("Bob Croydon Bruce and Charles Manson and Jolly Jumper")); } @Test - public void testStandardUsageOne() { + public void standardUsageOne() { authorsLayoutFormatter.setArgument("fullname, LastFirst, Comma, Comma"); assertEquals("Bruce, Bob Croydon, Jumper, Jolly", authorsLayoutFormatter.format("Bob Croydon Bruce and Jolly Jumper")); } @Test - public void testStandardUsageTwo() { + public void standardUsageTwo() { authorsLayoutFormatter.setArgument("initials"); assertEquals("B. C. Bruce and J. Jumper", authorsLayoutFormatter.format("Bob Croydon Bruce and Jolly Jumper")); } @Test - public void testStandardUsageThree() { + public void standardUsageThree() { authorsLayoutFormatter.setArgument("fullname, LastFirst, Comma"); assertEquals("Bruce, Bob Croydon, Manson, Charles and Jumper, Jolly", authorsLayoutFormatter.format("Bob Croydon Bruce and Charles Manson and Jolly Jumper")); } @Test - public void testStandardUsageFour() { + public void standardUsageFour() { authorsLayoutFormatter.setArgument("fullname, LastFirst, Comma, 2"); assertEquals("Bruce, Bob Croydon et al.", authorsLayoutFormatter.format("Bob Croydon Bruce and Charles Manson and Jolly Jumper")); } @Test - public void testStandardUsageFive() { + public void standardUsageFive() { authorsLayoutFormatter.setArgument("fullname, LastFirst, Comma, 3"); assertEquals("Bruce, Bob Croydon et al.", authorsLayoutFormatter.format("Bob Croydon Bruce and Charles Manson and Jolly Jumper and Chuck Chuckles")); } @Test - public void testStandardUsageSix() { + public void standardUsageSix() { authorsLayoutFormatter.setArgument("fullname, LastFirst, Comma, 3, 2"); assertEquals("Bruce, Bob Croydon, Manson, Charles et al.", authorsLayoutFormatter.format("Bob Croydon Bruce and Charles Manson and Jolly Jumper and Chuck Chuckles")); } @Test - public void testSpecialEtAl() { + public void specialEtAl() { authorsLayoutFormatter.setArgument("fullname, LastFirst, Comma, 3, etal= and a few more"); assertEquals("Bruce, Bob Croydon and a few more", authorsLayoutFormatter.format("Bob Croydon Bruce and Charles Manson and Jolly Jumper and Chuck Chuckles")); } @Test - public void testStandardUsageNull() { + public void standardUsageNull() { assertEquals("", authorsLayoutFormatter.format(null)); } @Test - public void testStandardOxford() { + public void standardOxford() { authorsLayoutFormatter.setArgument("Oxford"); assertEquals("B. C. Bruce, C. Manson, and J. Jumper", authorsLayoutFormatter.format("Bob Croydon Bruce and Charles Manson and Jolly Jumper")); } @Test - public void testStandardOxfordFullName() { + public void standardOxfordFullName() { authorsLayoutFormatter.setArgument("FullName,Oxford"); assertEquals("Bob Croydon Bruce, Charles Manson, and Jolly Jumper", authorsLayoutFormatter.format("Bruce, Bob Croydon and Charles Manson and Jolly Jumper")); } @Test - public void testStandardCommaFullName() { + public void standardCommaFullName() { authorsLayoutFormatter.setArgument("FullName,Comma,Comma"); assertEquals("Bob Croydon Bruce, Charles Manson, Jolly Jumper", authorsLayoutFormatter.format("Bruce, Bob Croydon and Charles Manson and Jolly Jumper")); } @Test - public void testStandardAmpFullName() { + public void standardAmpFullName() { authorsLayoutFormatter.setArgument("FullName,Amp"); assertEquals("Bob Croydon Bruce, Charles Manson & Jolly Jumper", authorsLayoutFormatter.format("Bruce, Bob Croydon and Charles Manson and Jolly Jumper")); } @Test - public void testLastName() { + public void lastName() { authorsLayoutFormatter.setArgument("LastName"); assertEquals("Bruce, von Manson and Jumper", authorsLayoutFormatter.format("Bruce, Bob Croydon and Charles von Manson and Jolly Jumper")); } @Test - public void testMiddleInitial() { + public void middleInitial() { authorsLayoutFormatter.setArgument("MiddleInitial"); assertEquals("Bob C. Bruce, Charles K. von Manson and Jolly Jumper", authorsLayoutFormatter.format("Bruce, Bob Croydon and Charles Kermit von Manson and Jumper, Jolly")); } @Test - public void testNoPeriod() { + public void noPeriod() { authorsLayoutFormatter.setArgument("NoPeriod"); assertEquals("B C Bruce, C K von Manson and J Jumper", authorsLayoutFormatter.format("Bruce, Bob Croydon and Charles Kermit von Manson and Jumper, Jolly")); } @Test - public void testEtAl() { + public void etAl() { authorsLayoutFormatter.setArgument("2,1"); assertEquals("B. C. Bruce et al.", authorsLayoutFormatter.format("Bruce, Bob Croydon and Charles Kermit von Manson and Jumper, Jolly")); } @Test - public void testEtAlNotEnoughAuthors() { + public void etAlNotEnoughAuthors() { authorsLayoutFormatter.setArgument("2,1"); assertEquals("B. C. Bruce and C. K. von Manson", authorsLayoutFormatter.format("Bruce, Bob Croydon and Charles Kermit von Manson")); } @Test - public void testEmptyEtAl() { + public void emptyEtAl() { authorsLayoutFormatter.setArgument("fullname, LastFirst, Comma, 3, etal="); assertEquals("Bruce, Bob Croydon", authorsLayoutFormatter.format("Bob Croydon Bruce and Charles Manson and Jolly Jumper and Chuck Chuckles")); @@ -146,7 +146,7 @@ public void testEmptyEtAl() { "LastFirst, 'Bruce, B. C., Manson, C., Jumper, J. and Chuckles, C.'", // LastFirst "LastFirstFirstFirst, 'Bruce, B. C., C. Manson, J. Jumper and C. Chuckles'" // LastFirstFirstFirst }) - public void testAuthorOrder(String arg, String expectedResult) { + public void authorOrder(String arg, String expectedResult) { authorsLayoutFormatter.setArgument(arg); String formattedStr = authorsLayoutFormatter.format("Bob Croydon Bruce and Charles Manson and Jolly Jumper and Chuck Chuckles"); assertEquals(expectedResult, formattedStr); @@ -161,7 +161,7 @@ public void testAuthorOrder(String arg, String expectedResult) { "LastName, 'Bruce, Manson, Jumper and Chuckles'", // LastName "InitialsNoSpace, 'B.C. Bruce, C. Manson, J. Jumper and C. Chuckles'" // InitialsNoSpace }) - public void testAuthorABRV(String arg, String expectedResult) { + public void authorABRV(String arg, String expectedResult) { authorsLayoutFormatter.setArgument(arg); String formattedStr = authorsLayoutFormatter.format("Bob Croydon Bruce and Charles Manson and Jolly Jumper and Chuck Chuckles"); assertEquals(expectedResult, formattedStr); @@ -174,7 +174,7 @@ public void testAuthorABRV(String arg, String expectedResult) { "NoComma, 'B. C. Bruce, C. Manson, J. Jumper and C. Chuckles'", // NoComma "NoPeriod, 'B C Bruce, C Manson, J Jumper and C Chuckles'" // NoPeriod }) - public void testAuthorPUNC(String arg, String expectedResult) { + public void authorPUNC(String arg, String expectedResult) { authorsLayoutFormatter.setArgument(arg); String formattedStr = authorsLayoutFormatter.format("Bob Croydon Bruce and Charles Manson and Jolly Jumper and Chuck Chuckles"); assertEquals(expectedResult, formattedStr); @@ -196,7 +196,7 @@ public void testAuthorPUNC(String arg, String expectedResult) { "'Comma, Colon', 'B. C. Bruce, C. Manson, J. Jumper: C. Chuckles'", // Comma Colon "'Comma, Semicolon', 'B. C. Bruce, C. Manson, J. Jumper; C. Chuckles'", // Comma Semicolon }) - public void testAuthorSEPARATORS(String arg, String expectedResult) { + public void authorSEPARATORS(String arg, String expectedResult) { authorsLayoutFormatter.setArgument(arg); String formattedStr = authorsLayoutFormatter.format("Bob Croydon Bruce and Charles Manson and Jolly Jumper and Chuck Chuckles"); assertEquals(expectedResult, formattedStr); diff --git a/src/test/java/org/jabref/logic/layout/format/CompositeFormatTest.java b/src/test/java/org/jabref/logic/layout/format/CompositeFormatTest.java index 9b0c6d49a2f..90b63437464 100644 --- a/src/test/java/org/jabref/logic/layout/format/CompositeFormatTest.java +++ b/src/test/java/org/jabref/logic/layout/format/CompositeFormatTest.java @@ -9,13 +9,13 @@ public class CompositeFormatTest { @Test - public void testEmptyComposite() { + public void emptyComposite() { LayoutFormatter f = new CompositeFormat(); assertEquals("No Change", f.format("No Change")); } @Test - public void testArrayComposite() { + public void arrayComposite() { LayoutFormatter f = new CompositeFormat(new LayoutFormatter[]{fieldText -> fieldText + fieldText, fieldText -> "A" + fieldText, fieldText -> "B" + fieldText}); @@ -23,7 +23,7 @@ public void testArrayComposite() { } @Test - public void testDoubleComposite() { + public void doubleComposite() { LayoutFormatter f = new CompositeFormat(new AuthorOrgSci(), new NoSpaceBetweenAbbreviations()); LayoutFormatter first = new AuthorOrgSci(); LayoutFormatter second = new NoSpaceBetweenAbbreviations(); diff --git a/src/test/java/org/jabref/logic/layout/format/DOIStripTest.java b/src/test/java/org/jabref/logic/layout/format/DOIStripTest.java index b8576d4e783..938058c6c97 100644 --- a/src/test/java/org/jabref/logic/layout/format/DOIStripTest.java +++ b/src/test/java/org/jabref/logic/layout/format/DOIStripTest.java @@ -16,7 +16,7 @@ public class DOIStripTest { @ParameterizedTest @MethodSource("provideDOI") - public void testFormatDOIStrip(String formattedDOI, String originalDOI) { + public void formatDOIStrip(String formattedDOI, String originalDOI) { assertEquals(formattedDOI, layoutFormatter.format(originalDOI)); } diff --git a/src/test/java/org/jabref/logic/layout/format/DateFormatterTest.java b/src/test/java/org/jabref/logic/layout/format/DateFormatterTest.java index d5eda7aa69a..97856adc1cc 100644 --- a/src/test/java/org/jabref/logic/layout/format/DateFormatterTest.java +++ b/src/test/java/org/jabref/logic/layout/format/DateFormatterTest.java @@ -19,12 +19,12 @@ public void setUp() { } @Test - public void testDefaultFormat() { + public void defaultFormat() { assertEquals("2016-07-15", formatter.format("2016-07-15")); } @Test - public void testRequestedFormat() { + public void requestedFormat() { formatter.setArgument("MM/yyyy"); assertEquals("07/2016", formatter.format("2016-07-15")); } @@ -37,7 +37,7 @@ public void testRequestedFormat() { "yyyy.MM.dd, 2016-07-15, 2016.07.15", // yyyy.MM.dd "yyyy/MM, 2016-07-15, 2016/07", // yyyy/MM }) - public void testOtherFormats(String formatArg, String input, String expectedResult) { + public void otherFormats(String formatArg, String input, String expectedResult) { formatter.setArgument(formatArg); String formattedStr = formatter.format(input); assertEquals(expectedResult, formattedStr); diff --git a/src/test/java/org/jabref/logic/layout/format/EntryTypeFormatterTest.java b/src/test/java/org/jabref/logic/layout/format/EntryTypeFormatterTest.java index 8fca35e0b3a..28a57e10d0b 100644 --- a/src/test/java/org/jabref/logic/layout/format/EntryTypeFormatterTest.java +++ b/src/test/java/org/jabref/logic/layout/format/EntryTypeFormatterTest.java @@ -14,7 +14,7 @@ public class EntryTypeFormatterTest { @ParameterizedTest @MethodSource("formatTests") - void testCorrectFormat(String expectedString, String inputString) { + void correctFormat(String expectedString, String inputString) { assertEquals(expectedString, formatter.format(inputString)); } diff --git a/src/test/java/org/jabref/logic/layout/format/HTMLCharsTest.java b/src/test/java/org/jabref/logic/layout/format/HTMLCharsTest.java index a8bc004a2e8..a31c04c7205 100644 --- a/src/test/java/org/jabref/logic/layout/format/HTMLCharsTest.java +++ b/src/test/java/org/jabref/logic/layout/format/HTMLCharsTest.java @@ -44,7 +44,7 @@ private static Stream provideBasicFormattingData() { @ParameterizedTest @MethodSource("provideBasicFormattingData") - void testBasicFormat(String expected, String input) { + void basicFormat(String expected, String input) { assertEquals(expected, layout.format(input)); } @@ -73,7 +73,7 @@ private static Stream provideLaTeXHighlightingFormattingData() { @ParameterizedTest @MethodSource("provideLaTeXHighlightingFormattingData") - void testLaTeXHighlighting(String expected, String input) { + void laTeXHighlighting(String expected, String input) { assertEquals(expected, layout.format(input)); } @@ -87,7 +87,7 @@ private static Stream provideEquationTestData() { @ParameterizedTest @MethodSource("provideEquationTestData") - void testEquations(String expected, String input) { + void equations(String expected, String input) { assertEquals(expected, layout.format(input)); } @@ -100,7 +100,7 @@ private static Stream provideNewLineTestData() { @ParameterizedTest @MethodSource("provideNewLineTestData") - void testNewLine(String expected, String input) { + void newLine(String expected, String input) { assertEquals(expected, layout.format(input)); } @@ -109,7 +109,7 @@ void testNewLine(String expected, String input) { */ @Test - void testQuoteSingle() { + void quoteSingle() { assertEquals("'", layout.format("{\\textquotesingle}")); } @@ -141,7 +141,7 @@ private static Stream provideHTMLEntityFormattingData() { @ParameterizedTest @MethodSource("provideHTMLEntityFormattingData") - void testHTMLEntityFormatting(String expected, String input) { + void hTMLEntityFormatting(String expected, String input) { assertEquals(expected, layout.format(input)); } } diff --git a/src/test/java/org/jabref/logic/layout/format/HTMLParagraphsTest.java b/src/test/java/org/jabref/logic/layout/format/HTMLParagraphsTest.java index 26391ed935d..3fd4fbd9a7c 100644 --- a/src/test/java/org/jabref/logic/layout/format/HTMLParagraphsTest.java +++ b/src/test/java/org/jabref/logic/layout/format/HTMLParagraphsTest.java @@ -16,7 +16,7 @@ public class HTMLParagraphsTest { @ParameterizedTest @MethodSource("htmlFormatTests") - void testCorrectFormat(String expectedString, String inputString) { + void correctFormat(String expectedString, String inputString) { assertEquals(expectedString, htmlFormatter.format(inputString)); } diff --git a/src/test/java/org/jabref/logic/layout/format/IfPluralTest.java b/src/test/java/org/jabref/logic/layout/format/IfPluralTest.java index bb5dbbaceff..233b7ce0f4a 100644 --- a/src/test/java/org/jabref/logic/layout/format/IfPluralTest.java +++ b/src/test/java/org/jabref/logic/layout/format/IfPluralTest.java @@ -9,41 +9,41 @@ public class IfPluralTest { @Test - public void testStandardUsageOneEditor() { + public void standardUsageOneEditor() { ParamLayoutFormatter a = new IfPlural(); a.setArgument("Eds.,Ed."); assertEquals("Ed.", a.format("Bob Bruce")); } @Test - public void testStandardUsageTwoEditors() { + public void standardUsageTwoEditors() { ParamLayoutFormatter a = new IfPlural(); a.setArgument("Eds.,Ed."); assertEquals("Eds.", a.format("Bob Bruce and Jolly Jumper")); } @Test - public void testFormatNull() { + public void formatNull() { ParamLayoutFormatter a = new IfPlural(); a.setArgument("Eds.,Ed."); assertEquals("", a.format(null)); } @Test - public void testFormatEmpty() { + public void formatEmpty() { ParamLayoutFormatter a = new IfPlural(); a.setArgument("Eds.,Ed."); assertEquals("", a.format("")); } @Test - public void testNoArgumentSet() { + public void noArgumentSet() { ParamLayoutFormatter a = new IfPlural(); assertEquals("", a.format("Bob Bruce and Jolly Jumper")); } @Test - public void testNoProperArgument() { + public void noProperArgument() { ParamLayoutFormatter a = new IfPlural(); a.setArgument("Eds."); assertEquals("", a.format("Bob Bruce and Jolly Jumper")); diff --git a/src/test/java/org/jabref/logic/layout/format/LatexToUnicodeFormatterTest.java b/src/test/java/org/jabref/logic/layout/format/LatexToUnicodeFormatterTest.java index f48963ff923..b1f0ad184f3 100644 --- a/src/test/java/org/jabref/logic/layout/format/LatexToUnicodeFormatterTest.java +++ b/src/test/java/org/jabref/logic/layout/format/LatexToUnicodeFormatterTest.java @@ -10,12 +10,12 @@ class LatexToUnicodeFormatterTest { final LatexToUnicodeFormatter formatter = new LatexToUnicodeFormatter(); @Test - void testPlainFormat() { + void plainFormat() { assertEquals("aaa", formatter.format("aaa")); } @Test - void testFormatUmlaut() { + void formatUmlaut() { assertEquals("ä", formatter.format("{\\\"{a}}")); assertEquals("Ä", formatter.format("{\\\"{A}}")); } @@ -26,23 +26,23 @@ void preserveUnknownCommand() { } @Test - void testFormatTextit() { + void formatTextit() { // See #1464 assertEquals("\uD835\uDC61\uD835\uDC52\uD835\uDC65\uD835\uDC61", formatter.format("\\textit{text}")); } @Test - void testEscapedDollarSign() { + void escapedDollarSign() { assertEquals("$", formatter.format("\\$")); } @Test - void testEquationsSingleSymbol() { + void equationsSingleSymbol() { assertEquals("σ", formatter.format("$\\sigma$")); } @Test - void testEquationsMoreComplicatedFormatting() { + void equationsMoreComplicatedFormatting() { assertEquals("A 32 mA ΣΔ-modulator", formatter.format("A 32~{mA} {$\\Sigma\\Delta$}-modulator")); } @@ -52,56 +52,56 @@ void formatExample() { } @Test - void testChi() { + void chi() { // See #1464 assertEquals("χ", formatter.format("$\\chi$")); } @Test - void testSWithCaron() { + void sWithCaron() { // Bug #1264 assertEquals("Š", formatter.format("{\\v{S}}")); } @Test - void testIWithDiaresis() { + void iWithDiaresis() { assertEquals("ï", formatter.format("\\\"{i}")); } @Test - void testIWithDiaresisAndEscapedI() { + void iWithDiaresisAndEscapedI() { // this might look strange in the test, but is actually a correct translation and renders identically to the above example in the UI assertEquals("ı̈", formatter.format("\\\"{\\i}")); } @Test - void testIWithDiaresisAndUnnecessaryBraces() { + void iWithDiaresisAndUnnecessaryBraces() { assertEquals("ï", formatter.format("{\\\"{i}}")); } @Test - void testUpperCaseIWithDiaresis() { + void upperCaseIWithDiaresis() { assertEquals("Ï", formatter.format("\\\"{I}")); } @Test - void testPolishName() { + void polishName() { assertEquals("Łęski", formatter.format("\\L\\k{e}ski")); } @Test - void testDoubleCombiningAccents() { + void doubleCombiningAccents() { assertEquals("ώ", formatter.format("$\\acute{\\omega}$")); } @Test - void testCombiningAccentsCase1() { + void combiningAccentsCase1() { assertEquals("ḩ", formatter.format("{\\c{h}}")); } @Disabled("This is not a standard LaTeX command. It is debatable why we should convert this.") @Test - void testCombiningAccentsCase2() { + void combiningAccentsCase2() { assertEquals("a͍", formatter.format("\\spreadlips{a}")); } @@ -121,70 +121,70 @@ void keepUnknownCommandWithEmptyArgument() { } @Test - void testTildeN() { + void tildeN() { assertEquals("Montaña", formatter.format("Monta\\~{n}a")); } @Test - void testAcuteNLongVersion() { + void acuteNLongVersion() { assertEquals("Maliński", formatter.format("Mali\\'{n}ski")); assertEquals("MaliŃski", formatter.format("Mali\\'{N}ski")); } @Test - void testAcuteNShortVersion() { + void acuteNShortVersion() { assertEquals("Maliński", formatter.format("Mali\\'nski")); assertEquals("MaliŃski", formatter.format("Mali\\'Nski")); } @Test - void testApostrophN() { + void apostrophN() { assertEquals("Mali'nski", formatter.format("Mali'nski")); assertEquals("Mali'Nski", formatter.format("Mali'Nski")); } @Test - void testApostrophO() { + void apostrophO() { assertEquals("L'oscillation", formatter.format("L'oscillation")); } @Test - void testApostrophC() { + void apostrophC() { assertEquals("O'Connor", formatter.format("O'Connor")); } @Test - void testPreservationOfSingleUnderscore() { + void preservationOfSingleUnderscore() { assertEquals("Lorem ipsum_lorem ipsum", formatter.format("Lorem ipsum_lorem ipsum")); } @Test - void testConversionOfUnderscoreWithBraces() { + void conversionOfUnderscoreWithBraces() { assertEquals("Lorem ipsum_(lorem ipsum)", formatter.format("Lorem ipsum_{lorem ipsum}")); } @Test - void testConversionOfOrdinal1st() { + void conversionOfOrdinal1st() { assertEquals("1ˢᵗ", formatter.format("1\\textsuperscript{st}")); } @Test - void testConversionOfOrdinal2nd() { + void conversionOfOrdinal2nd() { assertEquals("2ⁿᵈ", formatter.format("2\\textsuperscript{nd}")); } @Test - void testConversionOfOrdinal3rd() { + void conversionOfOrdinal3rd() { assertEquals("3ʳᵈ", formatter.format("3\\textsuperscript{rd}")); } @Test - void testConversionOfOrdinal4th() { + void conversionOfOrdinal4th() { assertEquals("4ᵗʰ", formatter.format("4\\textsuperscript{th}")); } @Test - void testConversionOfOrdinal9th() { + void conversionOfOrdinal9th() { assertEquals("9ᵗʰ", formatter.format("9\\textsuperscript{th}")); } } diff --git a/src/test/java/org/jabref/logic/layout/format/NameFormatterTest.java b/src/test/java/org/jabref/logic/layout/format/NameFormatterTest.java index 5a4b1b6581b..0065ba901fd 100644 --- a/src/test/java/org/jabref/logic/layout/format/NameFormatterTest.java +++ b/src/test/java/org/jabref/logic/layout/format/NameFormatterTest.java @@ -7,7 +7,7 @@ public class NameFormatterTest { @Test - public void testFormatStringStringBibtexEntry() { + public void formatStringStringBibtexEntry() { NameFormatter l = new NameFormatter(); assertEquals("Doe", l.format("Joe Doe", "1@*@{ll}")); @@ -30,7 +30,7 @@ public void testFormatStringStringBibtexEntry() { } @Test - public void testFormat() { + public void format() { NameFormatter a = new NameFormatter(); // Empty case diff --git a/src/test/java/org/jabref/logic/layout/format/OrdinalTest.java b/src/test/java/org/jabref/logic/layout/format/OrdinalTest.java index af73ab217be..525f99cf554 100644 --- a/src/test/java/org/jabref/logic/layout/format/OrdinalTest.java +++ b/src/test/java/org/jabref/logic/layout/format/OrdinalTest.java @@ -8,7 +8,7 @@ public class OrdinalTest { @Test - public void testEmpty() { + public void empty() { assertEquals("", new Ordinal().format("")); } @@ -18,7 +18,7 @@ public void testNull() { } @Test - public void testSingleDigit() { + public void singleDigit() { assertEquals("1st", new Ordinal().format("1")); assertEquals("2nd", new Ordinal().format("2")); assertEquals("3rd", new Ordinal().format("3")); @@ -26,28 +26,28 @@ public void testSingleDigit() { } @Test - public void testMultiDigits() { + public void multiDigits() { assertEquals("11th", new Ordinal().format("11")); assertEquals("111th", new Ordinal().format("111")); assertEquals("21st", new Ordinal().format("21")); } @Test - public void testAlreadyOrdinals() { + public void alreadyOrdinals() { assertEquals("1st", new Ordinal().format("1st")); assertEquals("111th", new Ordinal().format("111th")); assertEquals("22nd", new Ordinal().format("22nd")); } @Test - public void testFullSentence() { + public void fullSentence() { assertEquals("1st edn.", new Ordinal().format("1 edn.")); assertEquals("1st edition", new Ordinal().format("1st edition")); assertEquals("The 2nd conference on 3rd.14th", new Ordinal().format("The 2 conference on 3.14")); } @Test - public void testLetters() { + public void letters() { assertEquals("abCD eFg", new Ordinal().format("abCD eFg")); } } diff --git a/src/test/java/org/jabref/logic/layout/format/RTFCharsTest.java b/src/test/java/org/jabref/logic/layout/format/RTFCharsTest.java index 3e65598c117..b3af415daa7 100644 --- a/src/test/java/org/jabref/logic/layout/format/RTFCharsTest.java +++ b/src/test/java/org/jabref/logic/layout/format/RTFCharsTest.java @@ -24,7 +24,7 @@ void tearDown() { } @Test - void testBasicFormat() { + void basicFormat() { assertEquals("", formatter.format("")); assertEquals("hallo", formatter.format("hallo")); @@ -37,7 +37,7 @@ void testBasicFormat() { } @Test - void testLaTeXHighlighting() { + void laTeXHighlighting() { assertEquals("{\\i hallo}", formatter.format("\\emph{hallo}")); assertEquals("{\\i hallo}", formatter.format("{\\emph hallo}")); assertEquals("An article title with {\\i a book title} emphasized", formatter.format("An article title with \\emph{a book title} emphasized")); @@ -50,18 +50,18 @@ void testLaTeXHighlighting() { } @Test - void testComplicated() { + void complicated() { assertEquals("R\\u233eflexions sur le timing de la quantit\\u233e {\\u230ae} should be \\u230ae", formatter.format("Réflexions sur le timing de la quantité {\\ae} should be æ")); } @Test - void testComplicated2() { + void complicated2() { assertEquals("h\\'e1ll{\\u339oe}", formatter.format("h\\'all{\\oe}")); } @Test - void testComplicated3() { + void complicated3() { assertEquals("Le c\\u339oeur d\\u233e\\u231cu mais l'\\u226ame plut\\u244ot na\\u239ive, Lou\\u255ys r" + "\\u234eva de crapa\\u252?ter en cano\\u235e au del\\u224a des \\u238iles, pr\\u232es du m\\u228alstr" + "\\u246om o\\u249u br\\u251ulent les nov\\u230ae.", formatter.format("Le cœur déçu mais l'âme plutôt " + @@ -69,7 +69,7 @@ void testComplicated3() { } @Test - void testComplicated4() { + void complicated4() { assertEquals("l'\\u238ile exigu\\u235e\n" + " O\\u249u l'ob\\u232ese jury m\\u251ur\n" + " F\\u234ete l'ha\\u239i volap\\u252?k,\n" + @@ -82,19 +82,19 @@ void testComplicated4() { } @Test - void testComplicated5() { + void complicated5() { assertEquals("\\u193Arv\\u237izt\\u369?r\\u337? t\\u252?k\\u246orf\\u250ur\\u243og\\u233ep", formatter.format("Árvíztűrő tükörfúrógép")); } @Test - void testComplicated6() { + void complicated6() { assertEquals("Pchn\\u261a\\u263c w t\\u281e \\u322l\\u243od\\u378z je\\u380za lub o\\u347sm skrzy\\u324n fig", formatter.format("Pchnąć w tę łódź jeża lub ośm skrzyń fig")); } @Test - void testSpecialCharacters() { + void specialCharacters() { assertEquals("\\'f3", formatter.format("\\'{o}")); // ó assertEquals("\\'f2", formatter.format("\\`{o}")); // ò assertEquals("\\'f4", formatter.format("\\^{o}")); // ô @@ -180,13 +180,13 @@ void testSpecialCharacters() { "ß, \\u223ss", // ss "¡, \\u161!" // ! }) - public void testMoreSpecialCharacters(String specialChar, String expectedResult) { + public void moreSpecialCharacters(String specialChar, String expectedResult) { String formattedStr = formatter.format(specialChar); assertEquals(expectedResult, formattedStr); } @Test - void testRTFCharacters() { + void rtfCharacters() { assertEquals("\\'e0", formatter.format("\\`{a}")); assertEquals("\\'e8", formatter.format("\\`{e}")); assertEquals("\\'ec", formatter.format("\\`{i}")); @@ -215,7 +215,7 @@ void testRTFCharacters() { } @Test - void testRTFCharactersCapital() { + void rTFCharactersCapital() { assertEquals("\\'c0", formatter.format("\\`A")); assertEquals("\\'c8", formatter.format("\\`E")); assertEquals("\\'cc", formatter.format("\\`I")); diff --git a/src/test/java/org/jabref/logic/layout/format/RemoveWhitespaceTest.java b/src/test/java/org/jabref/logic/layout/format/RemoveWhitespaceTest.java index 96e92bbac0b..66b76d65f07 100644 --- a/src/test/java/org/jabref/logic/layout/format/RemoveWhitespaceTest.java +++ b/src/test/java/org/jabref/logic/layout/format/RemoveWhitespaceTest.java @@ -8,27 +8,27 @@ public class RemoveWhitespaceTest { @Test - public void testEmptyExpectEmpty() { + public void emptyExpectEmpty() { assertEquals("", new RemoveWhitespace().format("")); } @Test - public void testNullExpectNull() { + public void nullExpectNull() { assertNull(new RemoveWhitespace().format(null)); } @Test - public void testNormal() { + public void normal() { assertEquals("abcd EFG", new RemoveWhitespace().format("abcd EFG")); } @Test - public void testTab() { + public void tab() { assertEquals("abcd EFG", new RemoveWhitespace().format("abcd\t EFG")); } @Test - public void testNewLineCombo() { + public void newLineCombo() { assertEquals("abcd EFG", new RemoveWhitespace().format("abcd\r E\nFG\r\n")); } } diff --git a/src/test/java/org/jabref/logic/layout/format/ReplaceTest.java b/src/test/java/org/jabref/logic/layout/format/ReplaceTest.java index 31bc81144f5..4f605f9b15a 100644 --- a/src/test/java/org/jabref/logic/layout/format/ReplaceTest.java +++ b/src/test/java/org/jabref/logic/layout/format/ReplaceTest.java @@ -10,41 +10,41 @@ public class ReplaceTest { @Test - public void testSimpleText() { + public void simpleText() { ParamLayoutFormatter a = new Replace(); a.setArgument("Bob,Ben"); assertEquals("Ben Bruce", a.format("Bob Bruce")); } @Test - public void testSimpleTextNoHit() { + public void simpleTextNoHit() { ParamLayoutFormatter a = new Replace(); a.setArgument("Bob,Ben"); assertEquals("Jolly Jumper", a.format("Jolly Jumper")); } @Test - public void testFormatNull() { + public void formatNull() { ParamLayoutFormatter a = new Replace(); a.setArgument("Eds.,Ed."); assertNull(a.format(null)); } @Test - public void testFormatEmpty() { + public void formatEmpty() { ParamLayoutFormatter a = new Replace(); a.setArgument("Eds.,Ed."); assertEquals("", a.format("")); } @Test - public void testNoArgumentSet() { + public void noArgumentSet() { ParamLayoutFormatter a = new Replace(); assertEquals("Bob Bruce and Jolly Jumper", a.format("Bob Bruce and Jolly Jumper")); } @Test - public void testNoProperArgument() { + public void noProperArgument() { ParamLayoutFormatter a = new Replace(); a.setArgument("Eds."); assertEquals("Bob Bruce and Jolly Jumper", a.format("Bob Bruce and Jolly Jumper")); diff --git a/src/test/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatterTest.java b/src/test/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatterTest.java index 987fc22153c..8f971c65c1e 100644 --- a/src/test/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatterTest.java +++ b/src/test/java/org/jabref/logic/layout/format/ReplaceUnicodeLigaturesFormatterTest.java @@ -15,24 +15,24 @@ public void setUp() { } @Test - public void testPlainFormat() { + public void plainFormat() { assertEquals("lorem ipsum", formatter.format("lorem ipsum")); } @Test - public void testSingleLigatures() { + public void singleLigatures() { assertEquals("AA", formatter.format("\uA732")); assertEquals("fi", formatter.format("fi")); assertEquals("et", formatter.format("\uD83D\uDE70")); } @Test - public void testLigatureSequence() { + public void ligatureSequence() { assertEquals("aefffflstue", formatter.format("æfffflstᵫ")); } @Test - public void testSampleInput() { + public void sampleInput() { assertEquals("AEneas", formatter.format("Æneas")); } } diff --git a/src/test/java/org/jabref/logic/layout/format/RisKeywordsTest.java b/src/test/java/org/jabref/logic/layout/format/RisKeywordsTest.java index 863683620fa..55f9dc5bfff 100644 --- a/src/test/java/org/jabref/logic/layout/format/RisKeywordsTest.java +++ b/src/test/java/org/jabref/logic/layout/format/RisKeywordsTest.java @@ -9,7 +9,7 @@ public class RisKeywordsTest { @Test - public void testEmpty() { + public void empty() { assertEquals("", new RisKeywords().format("")); } @@ -19,17 +19,17 @@ public void testNull() { } @Test - public void testSingleKeyword() { + public void singleKeyword() { assertEquals("KW - abcd", new RisKeywords().format("abcd")); } @Test - public void testTwoKeywords() { + public void twoKeywords() { assertEquals("KW - abcd" + OS.NEWLINE + "KW - efg", new RisKeywords().format("abcd, efg")); } @Test - public void testMultipleKeywords() { + public void multipleKeywords() { assertEquals("KW - abcd" + OS.NEWLINE + "KW - efg" + OS.NEWLINE + "KW - hij" + OS.NEWLINE + "KW - klm", new RisKeywords().format("abcd, efg, hij, klm")); } diff --git a/src/test/java/org/jabref/logic/layout/format/RisMonthTest.java b/src/test/java/org/jabref/logic/layout/format/RisMonthTest.java index a323dcd1d2e..49299e5c5a6 100644 --- a/src/test/java/org/jabref/logic/layout/format/RisMonthTest.java +++ b/src/test/java/org/jabref/logic/layout/format/RisMonthTest.java @@ -9,7 +9,7 @@ public class RisMonthTest { @Test - public void testEmpty() { + public void empty() { assertEquals("", new RisMonth().format("")); } @@ -33,13 +33,13 @@ public void testNull() { "nov, 11", // nov "dec, 12", // dec }) - public void testValidMonth(String input, String expectedResult) { + public void validMonth(String input, String expectedResult) { String formattedStr = new RisMonth().format(input); assertEquals(expectedResult, formattedStr); } @Test - public void testInvalidMonth() { + public void invalidMonth() { assertEquals("abcd", new RisMonth().format("abcd")); } } diff --git a/src/test/java/org/jabref/logic/layout/format/WrapFileLinksTest.java b/src/test/java/org/jabref/logic/layout/format/WrapFileLinksTest.java index faf60d71945..a09d2e78fde 100644 --- a/src/test/java/org/jabref/logic/layout/format/WrapFileLinksTest.java +++ b/src/test/java/org/jabref/logic/layout/format/WrapFileLinksTest.java @@ -21,7 +21,7 @@ void setUp() { } @Test - void testEmpty() { + void empty() { assertEquals("", formatter.format("")); } @@ -31,72 +31,72 @@ void testNull() { } @Test - void testNoFormatSetNonEmptyString() { + void noFormatSetNonEmptyString() { assertThrows(NullPointerException.class, () -> formatter.format("test.pdf")); } @Test - void testFileExtension() { + void fileExtension() { formatter.setArgument("\\x"); assertEquals("pdf", formatter.format("test.pdf")); } @Test - void testFileExtensionNoExtension() { + void fileExtensionNoExtension() { formatter.setArgument("\\x"); assertEquals("", formatter.format("test")); } @Test - void testPlainTextString() { + void plainTextString() { formatter.setArgument("x"); assertEquals("x", formatter.format("test.pdf")); } @Test - void testDescription() { + void description() { formatter.setArgument("\\d"); assertEquals("Test file", formatter.format("Test file:test.pdf:PDF")); } @Test - void testDescriptionNoDescription() { + void descriptionNoDescription() { formatter.setArgument("\\d"); assertEquals("", formatter.format("test.pdf")); } @Test - void testType() { + void type() { formatter.setArgument("\\f"); assertEquals("PDF", formatter.format("Test file:test.pdf:PDF")); } @Test - void testTypeNoType() { + void typeNoType() { formatter.setArgument("\\f"); assertEquals("", formatter.format("test.pdf")); } @Test - void testIterator() { + void iterator() { formatter.setArgument("\\i"); assertEquals("1", formatter.format("Test file:test.pdf:PDF")); } @Test - void testIteratorTwoItems() { + void iteratorTwoItems() { formatter.setArgument("\\i\n"); assertEquals("1\n2\n", formatter.format("Test file:test.pdf:PDF;test2.pdf")); } @Test - void testEndingBracket() { + void endingBracket() { formatter.setArgument("(\\d)"); assertEquals("(Test file)", formatter.format("Test file:test.pdf:PDF")); } @Test - void testPath() throws IOException { + void path() throws IOException { formatter = new WrapFileLinks(Collections.singletonList(Path.of("src/test/resources/pdfs/")), ""); formatter.setArgument("\\p"); assertEquals(new File("src/test/resources/pdfs/encrypted.pdf").getCanonicalPath(), @@ -104,7 +104,7 @@ void testPath() throws IOException { } @Test - void testPathFallBackToGeneratedDir() throws IOException { + void pathFallBackToGeneratedDir() throws IOException { formatter = new WrapFileLinks(Collections.emptyList(), "src/test/resources/pdfs/"); formatter.setArgument("\\p"); assertEquals(new File("src/test/resources/pdfs/encrypted.pdf").getCanonicalPath(), @@ -112,14 +112,14 @@ void testPathFallBackToGeneratedDir() throws IOException { } @Test - void testPathReturnsRelativePathIfNotFound() { + void pathReturnsRelativePathIfNotFound() { formatter = new WrapFileLinks(Collections.singletonList(Path.of("src/test/resources/pdfs/")), ""); formatter.setArgument("\\p"); assertEquals("test.pdf", formatter.format("Preferences:test.pdf:PDF")); } @Test - void testRelativePath() { + void relativePath() { formatter.setArgument("\\r"); assertEquals("test.pdf", formatter.format("Test file:test.pdf:PDF")); } diff --git a/src/test/java/org/jabref/logic/msbib/MsBibAuthorTest.java b/src/test/java/org/jabref/logic/msbib/MsBibAuthorTest.java index 2ccef4f8722..703a74d0201 100644 --- a/src/test/java/org/jabref/logic/msbib/MsBibAuthorTest.java +++ b/src/test/java/org/jabref/logic/msbib/MsBibAuthorTest.java @@ -10,42 +10,42 @@ public class MsBibAuthorTest { @Test - public void testGetFirstName() { + public void getFirstName() { Author author = new Author("Gustav Peter Johann", null, null, "Bach", null); MsBibAuthor msBibAuthor = new MsBibAuthor(author); assertEquals("Gustav", msBibAuthor.getFirstName()); } @Test - public void testGetMiddleName() { + public void getMiddleName() { Author author = new Author("Gustav Peter Johann", null, null, "Bach", null); MsBibAuthor msBibAuthor = new MsBibAuthor(author); assertEquals("Peter Johann", msBibAuthor.getMiddleName()); } @Test - public void testGetNoMiddleName() { + public void getNoMiddleName() { Author author = new Author("Gustav", null, null, "Bach", null); MsBibAuthor msBibAuthor = new MsBibAuthor(author); assertNull(msBibAuthor.getMiddleName()); } @Test - public void testGetNoFirstName() { + public void getNoFirstName() { Author author = new Author(null, null, null, "Bach", null); MsBibAuthor msBibAuthor = new MsBibAuthor(author); assertNull(msBibAuthor.getMiddleName()); } @Test - public void testGetLastName() { + public void getLastName() { Author author = new Author("Gustav Peter Johann", null, null, "Bach", null); MsBibAuthor msBibAuthor = new MsBibAuthor(author); assertEquals("Bach", msBibAuthor.getLastName()); } @Test - public void testGetVonAndLastName() { + public void getVonAndLastName() { Author author = new Author("John", null, "von", "Neumann", null); MsBibAuthor msBibAuthor = new MsBibAuthor(author); assertEquals("von Neumann", msBibAuthor.getLastName()); diff --git a/src/test/java/org/jabref/logic/msbib/MsBibMappingTest.java b/src/test/java/org/jabref/logic/msbib/MsBibMappingTest.java index c5884d8e43b..bb2462bbbdf 100644 --- a/src/test/java/org/jabref/logic/msbib/MsBibMappingTest.java +++ b/src/test/java/org/jabref/logic/msbib/MsBibMappingTest.java @@ -6,25 +6,25 @@ public class MsBibMappingTest { @Test - public void testGetLanguage() { + public void getLanguage() { String lang = MSBibMapping.getLanguage(1609); assertEquals("basque", lang); } @Test - public void testGetLCID() { + public void getLCID() { int lcid = MSBibMapping.getLCID("basque"); assertEquals(1609, lcid); } @Test - public void testGetInvalidLanguage() { + public void getInvalidLanguage() { String lang = MSBibMapping.getLanguage(1234567); assertEquals("english", lang); } @Test - public void testInvalidLCID() { + public void invalidLCID() { int lcid = MSBibMapping.getLCID("not a language"); assertEquals(1033, lcid); } diff --git a/src/test/java/org/jabref/logic/net/ProxyTest.java b/src/test/java/org/jabref/logic/net/ProxyTest.java index 20f904441cb..800cd40e8e5 100644 --- a/src/test/java/org/jabref/logic/net/ProxyTest.java +++ b/src/test/java/org/jabref/logic/net/ProxyTest.java @@ -11,7 +11,7 @@ public class ProxyTest { * even though it's no longer stored in register. */ @Test - public void testProxyPreferencesStorePassword() { + public void proxyPreferencesStorePassword() { // mock data boolean useProxy = true; String hostname = "testName"; diff --git a/src/test/java/org/jabref/logic/net/URLDownloadTest.java b/src/test/java/org/jabref/logic/net/URLDownloadTest.java index 858bf839d35..6815900691d 100644 --- a/src/test/java/org/jabref/logic/net/URLDownloadTest.java +++ b/src/test/java/org/jabref/logic/net/URLDownloadTest.java @@ -28,21 +28,21 @@ public class URLDownloadTest { private static final Logger LOGGER = LoggerFactory.getLogger(URLDownloadTest.class); @Test - public void testStringDownloadWithSetEncoding() throws IOException { + public void stringDownloadWithSetEncoding() throws IOException { URLDownload dl = new URLDownload(new URL("http://www.google.com")); assertTrue(dl.asString().contains("Google"), "google.com should contain google"); } @Test - public void testStringDownload() throws IOException { + public void stringDownload() throws IOException { URLDownload dl = new URLDownload(new URL("http://www.google.com")); assertTrue(dl.asString(StandardCharsets.UTF_8).contains("Google"), "google.com should contain google"); } @Test - public void testFileDownload() throws IOException { + public void fileDownload() throws IOException { File destination = File.createTempFile("jabref-test", ".html"); try { URLDownload dl = new URLDownload(new URL("http://www.google.com")); @@ -57,7 +57,7 @@ public void testFileDownload() throws IOException { } @Test - public void testDetermineMimeType() throws IOException { + public void determineMimeType() throws IOException { URLDownload dl = new URLDownload(new URL("http://www.google.com")); assertTrue(dl.getMimeType().startsWith("text/html")); @@ -105,14 +105,14 @@ public void downloadOfHttpsSucceeds() throws IOException { } @Test - public void testCheckConnectionSuccess() throws MalformedURLException { + public void checkConnectionSuccess() throws MalformedURLException { URLDownload google = new URLDownload(new URL("http://www.google.com")); assertTrue(google.canBeReached()); } @Test - public void testCheckConnectionFail() throws MalformedURLException { + public void checkConnectionFail() throws MalformedURLException { URLDownload nonsense = new URLDownload(new URL("http://nonsenseadddress")); assertThrows(UnirestException.class, nonsense::canBeReached); diff --git a/src/test/java/org/jabref/logic/openoffice/style/OOBibStyleTest.java b/src/test/java/org/jabref/logic/openoffice/style/OOBibStyleTest.java index 0f76f68d714..0f8ca79b160 100644 --- a/src/test/java/org/jabref/logic/openoffice/style/OOBibStyleTest.java +++ b/src/test/java/org/jabref/logic/openoffice/style/OOBibStyleTest.java @@ -41,7 +41,7 @@ class OOBibStyleTest { private final JournalAbbreviationRepository abbreviationRepository = mock(JournalAbbreviationRepository.class); @Test - void testAuthorYear() throws IOException { + void authorYear() throws IOException { OOBibStyle style = new OOBibStyle(StyleLoader.DEFAULT_AUTHORYEAR_STYLE_PATH, layoutFormatterPreferences, abbreviationRepository); assertTrue(style.isValid()); assertTrue(style.isInternalStyle()); @@ -54,7 +54,7 @@ void testAuthorYear() throws IOException { } @Test - void testAuthorYearAsFile() throws URISyntaxException, IOException { + void authorYearAsFile() throws URISyntaxException, IOException { Path defFile = Path.of(OOBibStyleTest.class.getResource(StyleLoader.DEFAULT_AUTHORYEAR_STYLE_PATH).toURI()); OOBibStyle style = new OOBibStyle(defFile, layoutFormatterPreferences, abbreviationRepository); @@ -69,7 +69,7 @@ void testAuthorYearAsFile() throws URISyntaxException, IOException { } @Test - void testNumerical() throws IOException { + void numerical() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -160,7 +160,7 @@ static String getCitationMarker2b(OOBibStyle style, */ @Test - void testGetNumCitationMarker() throws IOException { + void getNumCitationMarker() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -180,7 +180,7 @@ void testGetNumCitationMarker() throws IOException { } @Test - void testGetNumCitationMarkerUndefined() throws IOException { + void getNumCitationMarkerUndefined() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -230,7 +230,7 @@ void testGetNumCitationMarkerUndefined() throws IOException { } @Test - void testGetCitProperty() throws IOException { + void getCitProperty() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -251,7 +251,7 @@ void testGetCitProperty() throws IOException { } @Test - void testGetCitationMarker() throws IOException { + void getCitationMarker() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -293,7 +293,7 @@ void testGetCitationMarker() throws IOException { } @Test - void testLayout() throws IOException { + void layout() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -323,7 +323,7 @@ void testLayout() throws IOException { } @Test - void testInstitutionAuthor() throws IOException { + void institutionAuthor() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -344,7 +344,7 @@ void testInstitutionAuthor() throws IOException { } @Test - void testVonAuthor() throws IOException { + void vonAuthor() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -365,7 +365,7 @@ void testVonAuthor() throws IOException { } @Test - void testInstitutionAuthorMarker() throws IOException { + void institutionAuthorMarker() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -391,7 +391,7 @@ void testInstitutionAuthorMarker() throws IOException { } @Test - void testVonAuthorMarker() throws IOException { + void vonAuthorMarker() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -414,7 +414,7 @@ void testVonAuthorMarker() throws IOException { } @Test - void testNullAuthorMarker() throws IOException { + void nullAuthorMarker() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -435,7 +435,7 @@ void testNullAuthorMarker() throws IOException { } @Test - void testNullYearMarker() throws IOException { + void nullYearMarker() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -456,7 +456,7 @@ void testNullYearMarker() throws IOException { } @Test - void testEmptyEntryMarker() throws IOException { + void emptyEntryMarker() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -476,7 +476,7 @@ void testEmptyEntryMarker() throws IOException { } @Test - void testGetCitationMarkerInParenthesisUniquefiers() throws IOException { + void getCitationMarkerInParenthesisUniquefiers() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -520,7 +520,7 @@ void testGetCitationMarkerInParenthesisUniquefiers() throws IOException { } @Test - void testGetCitationMarkerInTextUniquefiers() throws IOException { + void getCitationMarkerInTextUniquefiers() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -564,7 +564,7 @@ void testGetCitationMarkerInTextUniquefiers() throws IOException { } @Test - void testGetCitationMarkerInParenthesisUniquefiersThreeSameAuthor() throws IOException { + void getCitationMarkerInParenthesisUniquefiersThreeSameAuthor() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -607,7 +607,7 @@ void testGetCitationMarkerInParenthesisUniquefiersThreeSameAuthor() throws IOExc } @Test - void testGetCitationMarkerInTextUniquefiersThreeSameAuthor() throws IOException { + void getCitationMarkerInTextUniquefiersThreeSameAuthor() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -651,7 +651,7 @@ void testGetCitationMarkerInTextUniquefiersThreeSameAuthor() throws IOException @Test // TODO: equals only work when initialized from file, not from reader - void testEquals() throws IOException { + void equals() throws IOException { OOBibStyle style1 = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -665,7 +665,7 @@ void testEquals() throws IOException { @Test // TODO: equals only work when initialized from file, not from reader - void testNotEquals() throws IOException { + void notEquals() throws IOException { OOBibStyle style1 = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -678,7 +678,7 @@ void testNotEquals() throws IOException { } @Test - void testCompareToEqual() throws IOException { + void compareToEqual() throws IOException { OOBibStyle style1 = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -691,7 +691,7 @@ void testCompareToEqual() throws IOException { } @Test - void testCompareToNotEqual() throws IOException { + void compareToNotEqual() throws IOException { OOBibStyle style1 = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, @@ -705,7 +705,7 @@ void testCompareToNotEqual() throws IOException { } @Test - void testEmptyStringPropertyAndOxfordComma() throws Exception { + void emptyStringPropertyAndOxfordComma() throws Exception { OOBibStyle style = new OOBibStyle("test.jstyle", layoutFormatterPreferences, abbreviationRepository); Map entryDBMap = new HashMap<>(); List entries = new ArrayList<>(); @@ -725,13 +725,13 @@ void testEmptyStringPropertyAndOxfordComma() throws Exception { } @Test - void testIsValidWithDefaultSectionAtTheStart() throws Exception { + void isValidWithDefaultSectionAtTheStart() throws Exception { OOBibStyle style = new OOBibStyle("testWithDefaultAtFirstLIne.jstyle", layoutFormatterPreferences, abbreviationRepository); assertTrue(style.isValid()); } @Test - void testGetCitationMarkerJoinFirst() throws IOException { + void getCitationMarkerJoinFirst() throws IOException { OOBibStyle style = new OOBibStyle( StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH, layoutFormatterPreferences, diff --git a/src/test/java/org/jabref/logic/openoffice/style/OOPreFormatterTest.java b/src/test/java/org/jabref/logic/openoffice/style/OOPreFormatterTest.java index 0478089a8dc..3c4d828dbec 100644 --- a/src/test/java/org/jabref/logic/openoffice/style/OOPreFormatterTest.java +++ b/src/test/java/org/jabref/logic/openoffice/style/OOPreFormatterTest.java @@ -7,7 +7,7 @@ public class OOPreFormatterTest { @Test - public void testPlainFormat() { + public void plainFormat() { assertEquals("aaa", new OOPreFormatter().format("aaa")); assertEquals("$", new OOPreFormatter().format("\\$")); assertEquals("%", new OOPreFormatter().format("\\%")); @@ -15,14 +15,14 @@ public void testPlainFormat() { } @Test - public void testFormatAccents() { + public void formatAccents() { assertEquals("ä", new OOPreFormatter().format("{\\\"{a}}")); assertEquals("Ä", new OOPreFormatter().format("{\\\"{A}}")); assertEquals("Ç", new OOPreFormatter().format("{\\c{C}}")); } @Test - public void testSpecialCommands() { + public void specialCommands() { assertEquals("å", new OOPreFormatter().format("{\\aa}")); assertEquals("bb", new OOPreFormatter().format("{\\bb}")); assertEquals("å a", new OOPreFormatter().format("\\aa a")); @@ -32,24 +32,24 @@ public void testSpecialCommands() { } @Test - public void testUnsupportedSpecialCommands() { + public void unsupportedSpecialCommands() { assertEquals("ftmch", new OOPreFormatter().format("\\ftmch")); assertEquals("ftmch", new OOPreFormatter().format("{\\ftmch}")); assertEquals("ftmchaaa", new OOPreFormatter().format("{\\ftmch\\aaa}")); } @Test - public void testEquations() { + public void equations() { assertEquals("Σ", new OOPreFormatter().format("$\\Sigma$")); } @Test - public void testFormatStripLatexCommands() { + public void formatStripLatexCommands() { assertEquals("-", new OOPreFormatter().format("\\mbox{-}")); } @Test - public void testFormatting() { + public void formatting() { assertEquals("kkk", new OOPreFormatter().format("\\textit{kkk}")); assertEquals("kkk", new OOPreFormatter().format("{\\it kkk}")); assertEquals("kkk", new OOPreFormatter().format("\\emph{kkk}")); diff --git a/src/test/java/org/jabref/logic/openoffice/style/StyleLoaderTest.java b/src/test/java/org/jabref/logic/openoffice/style/StyleLoaderTest.java index 6644c3e8277..6f7d2f48ed2 100644 --- a/src/test/java/org/jabref/logic/openoffice/style/StyleLoaderTest.java +++ b/src/test/java/org/jabref/logic/openoffice/style/StyleLoaderTest.java @@ -55,7 +55,7 @@ public void throwNPEWithNullAbbreviationRepository() { } @Test - public void testGetStylesWithEmptyExternal() { + public void getStylesWithEmptyExternal() { preferences.setExternalStyles(Collections.emptyList()); loader = new StyleLoader(preferences, layoutPreferences, abbreviationRepository); @@ -63,7 +63,7 @@ public void testGetStylesWithEmptyExternal() { } @Test - public void testAddStyleLeadsToOneMoreStyle() throws URISyntaxException { + public void addStyleLeadsToOneMoreStyle() throws URISyntaxException { preferences.setExternalStyles(Collections.emptyList()); loader = new StyleLoader(preferences, layoutPreferences, abbreviationRepository); @@ -74,7 +74,7 @@ public void testAddStyleLeadsToOneMoreStyle() throws URISyntaxException { } @Test - public void testAddInvalidStyleLeadsToNoMoreStyle() { + public void addInvalidStyleLeadsToNoMoreStyle() { preferences.setExternalStyles(Collections.emptyList()); loader = new StyleLoader(preferences, layoutPreferences, abbreviationRepository); int beforeAdding = loader.getStyles().size(); @@ -83,7 +83,7 @@ public void testAddInvalidStyleLeadsToNoMoreStyle() { } @Test - public void testInitalizeWithOneExternalFile() throws URISyntaxException { + public void initalizeWithOneExternalFile() throws URISyntaxException { String filename = Path.of(StyleLoader.class.getResource(StyleLoader.DEFAULT_AUTHORYEAR_STYLE_PATH).toURI()) .toFile().getPath(); when(preferences.getExternalStyles()).thenReturn(FXCollections.singletonObservableList(filename)); @@ -92,7 +92,7 @@ public void testInitalizeWithOneExternalFile() throws URISyntaxException { } @Test - public void testInitalizeWithIncorrectExternalFile() { + public void initalizeWithIncorrectExternalFile() { preferences.setExternalStyles(Collections.singletonList("DefinitelyNotAValidFileNameOrWeAreExtremelyUnlucky")); loader = new StyleLoader(preferences, layoutPreferences, abbreviationRepository); @@ -100,7 +100,7 @@ public void testInitalizeWithIncorrectExternalFile() { } @Test - public void testInitalizeWithOneExternalFileRemoveStyle() throws URISyntaxException { + public void initalizeWithOneExternalFileRemoveStyle() throws URISyntaxException { String filename = Path.of(StyleLoader.class.getResource(StyleLoader.DEFAULT_AUTHORYEAR_STYLE_PATH).toURI()) .toFile().getPath(); when(preferences.getExternalStyles()).thenReturn(FXCollections.singletonObservableList(filename)); @@ -121,7 +121,7 @@ public void testInitalizeWithOneExternalFileRemoveStyle() throws URISyntaxExcept } @Test - public void testInitalizeWithOneExternalFileRemoveStyleUpdatesPreferences() throws URISyntaxException { + public void initalizeWithOneExternalFileRemoveStyleUpdatesPreferences() throws URISyntaxException { String filename = Path.of(StyleLoader.class.getResource(StyleLoader.DEFAULT_AUTHORYEAR_STYLE_PATH).toURI()) .toFile().getPath(); when(preferences.getExternalStyles()).thenReturn(FXCollections.singletonObservableList(filename)); @@ -142,7 +142,7 @@ public void testInitalizeWithOneExternalFileRemoveStyleUpdatesPreferences() thro } @Test - public void testAddSameStyleTwiceLeadsToOneMoreStyle() throws URISyntaxException { + public void addSameStyleTwiceLeadsToOneMoreStyle() throws URISyntaxException { preferences.setExternalStyles(Collections.emptyList()); loader = new StyleLoader(preferences, layoutPreferences, abbreviationRepository); int beforeAdding = loader.getStyles().size(); @@ -154,13 +154,13 @@ public void testAddSameStyleTwiceLeadsToOneMoreStyle() throws URISyntaxException } @Test - public void testAddNullStyleThrowsNPE() { + public void addNullStyleThrowsNPE() { loader = new StyleLoader(preferences, layoutPreferences, abbreviationRepository); assertThrows(NullPointerException.class, () -> loader.addStyleIfValid(null)); } @Test - public void testGetDefaultUsedStyleWhenEmpty() { + public void getDefaultUsedStyleWhenEmpty() { when(preferences.getCurrentStyle()).thenReturn(StyleLoader.DEFAULT_AUTHORYEAR_STYLE_PATH); preferences.clearCurrentStyle(); loader = new StyleLoader(preferences, layoutPreferences, abbreviationRepository); @@ -171,7 +171,7 @@ public void testGetDefaultUsedStyleWhenEmpty() { } @Test - public void testGetStoredUsedStyle() { + public void getStoredUsedStyle() { when(preferences.getCurrentStyle()).thenReturn(StyleLoader.DEFAULT_NUMERICAL_STYLE_PATH); loader = new StyleLoader(preferences, layoutPreferences, abbreviationRepository); OOBibStyle style = loader.getUsedStyle(); @@ -181,7 +181,7 @@ public void testGetStoredUsedStyle() { } @Test - public void testGetDefaultUsedStyleWhenIncorrect() { + public void getDefaultUsedStyleWhenIncorrect() { when(preferences.getCurrentStyle()).thenReturn("ljlkjlkjnljnvdlsjniuhwelfhuewfhlkuewhfuwhelu"); loader = new StyleLoader(preferences, layoutPreferences, abbreviationRepository); OOBibStyle style = loader.getUsedStyle(); @@ -190,7 +190,7 @@ public void testGetDefaultUsedStyleWhenIncorrect() { } @Test - public void testRemoveInternalStyleReturnsFalseAndDoNotRemove() { + public void removeInternalStyleReturnsFalseAndDoNotRemove() { preferences.setExternalStyles(Collections.emptyList()); loader = new StyleLoader(preferences, layoutPreferences, abbreviationRepository); diff --git a/src/test/java/org/jabref/logic/protectedterms/ProtectedTermsListTest.java b/src/test/java/org/jabref/logic/protectedterms/ProtectedTermsListTest.java index 54109db5c86..1637ae4e874 100644 --- a/src/test/java/org/jabref/logic/protectedterms/ProtectedTermsListTest.java +++ b/src/test/java/org/jabref/logic/protectedterms/ProtectedTermsListTest.java @@ -30,70 +30,70 @@ public void setUp(@TempDir Path temporaryFolder) throws IOException { } @Test - public void testProtectedTermsListStringListOfStringStringBoolean() { + public void protectedTermsListStringListOfStringStringBoolean() { assertTrue(internalList.isInternalList()); } @Test - public void testProtectedTermsListStringListOfStringString() { + public void protectedTermsListStringListOfStringString() { assertFalse(externalList.isInternalList()); } @Test - public void testGetDescription() { + public void getDescription() { assertEquals("Name", internalList.getDescription()); } @Test - public void testGetTermList() { + public void getTermList() { assertEquals(Arrays.asList("AAA", "BBB"), internalList.getTermList()); } @Test - public void testGetLocation() { + public void getLocation() { assertEquals("location", internalList.getLocation()); } @Test - public void testGetTermListing() { + public void getTermListing() { assertEquals("AAA\nBBB", internalList.getTermListing()); } @Test - public void testCompareTo() { + public void compareTo() { assertEquals(-2, internalList.compareTo(externalList)); } @Test - public void testSetEnabledIsEnabled() { + public void setEnabledIsEnabled() { assertFalse(internalList.isEnabled()); internalList.setEnabled(true); assertTrue(internalList.isEnabled()); } @Test - public void testNotEnabledByDefault() { + public void notEnabledByDefault() { assertFalse(internalList.isEnabled()); } @Test - public void testCanNotAddTermToInternalList() { + public void canNotAddTermToInternalList() { assertFalse(internalList.addProtectedTerm("CCC")); } @Test - public void testTermNotAddedToInternalList() { + public void termNotAddedToInternalList() { internalList.addProtectedTerm("CCC"); assertFalse(internalList.getTermList().contains("CCC")); } @Test - public void testCanAddTermToExternalList() { + public void canAddTermToExternalList() { assertTrue(externalList.addProtectedTerm("CCC")); } @Test - public void testTermAddedToExternalList() { + public void termAddedToExternalList() { externalList.addProtectedTerm("CCC"); assertTrue(externalList.getTermList().contains("CCC")); } diff --git a/src/test/java/org/jabref/logic/protectedterms/ProtectedTermsLoaderTest.java b/src/test/java/org/jabref/logic/protectedterms/ProtectedTermsLoaderTest.java index 2b25939e788..3b7a267ccc3 100644 --- a/src/test/java/org/jabref/logic/protectedterms/ProtectedTermsLoaderTest.java +++ b/src/test/java/org/jabref/logic/protectedterms/ProtectedTermsLoaderTest.java @@ -27,7 +27,7 @@ void setUp() { } @Test - void testGetProtectedTerms() throws URISyntaxException { + void getProtectedTerms() throws URISyntaxException { List backupList = new ArrayList<>(loader.getProtectedTermsLists()); for (ProtectedTermsList list : backupList) { @@ -42,7 +42,7 @@ void testGetProtectedTerms() throws URISyntaxException { } @Test - void testAddProtectedTermsListFromFile() throws URISyntaxException { + void addProtectedTermsListFromFile() throws URISyntaxException { String filename = Path.of(ProtectedTermsLoader.class.getResource("/org/jabref/logic/protectedterms/namedterms.terms") .toURI()) .toFile().getPath(); @@ -52,7 +52,7 @@ void testAddProtectedTermsListFromFile() throws URISyntaxException { } @Test - void testReadProtectedTermsListFromFileReadsDescription() throws URISyntaxException { + void readProtectedTermsListFromFileReadsDescription() throws URISyntaxException { Path file = Path.of( ProtectedTermsLoader.class.getResource("/org/jabref/logic/protectedterms/namedterms.terms") .toURI()); @@ -62,7 +62,7 @@ void testReadProtectedTermsListFromFileReadsDescription() throws URISyntaxExcept } @Test - void testReadProtectedTermsListFromFileDisabledWorks() throws URISyntaxException { + void readProtectedTermsListFromFileDisabledWorks() throws URISyntaxException { Path file = Path.of(ProtectedTermsLoader.class.getResource("/org/jabref/logic/protectedterms/namedterms.terms") .toURI()); @@ -71,7 +71,7 @@ void testReadProtectedTermsListFromFileDisabledWorks() throws URISyntaxException } @Test - void testReadProtectedTermsListFromFileEnabledWorks() throws URISyntaxException { + void readProtectedTermsListFromFileEnabledWorks() throws URISyntaxException { Path file = Path.of(ProtectedTermsLoader.class.getResource("/org/jabref/logic/protectedterms/namedterms.terms") .toURI()); @@ -80,7 +80,7 @@ void testReadProtectedTermsListFromFileEnabledWorks() throws URISyntaxException } @Test - void testReadProtectedTermsListFromFileIsNotInternalList() throws URISyntaxException { + void readProtectedTermsListFromFileIsNotInternalList() throws URISyntaxException { Path file = Path.of(ProtectedTermsLoader.class.getResource("/org/jabref/logic/protectedterms/namedterms.terms") .toURI()); @@ -89,7 +89,7 @@ void testReadProtectedTermsListFromFileIsNotInternalList() throws URISyntaxExcep } @Test - void testReadProtectedTermsListFromFileNoDescriptionGivesDefaultDescription() + void readProtectedTermsListFromFileNoDescriptionGivesDefaultDescription() throws URISyntaxException { Path file = Path.of( ProtectedTermsLoader.class.getResource("/org/jabref/logic/protectedterms/unnamedterms.terms") @@ -100,7 +100,7 @@ void testReadProtectedTermsListFromFileNoDescriptionGivesDefaultDescription() } @Test - void testNewListsAreIncluded() { + void newListsAreIncluded() { ProtectedTermsLoader localLoader = new ProtectedTermsLoader(new ProtectedTermsPreferences( Collections.emptyList(), Collections.emptyList(), @@ -110,7 +110,7 @@ void testNewListsAreIncluded() { } @Test - void testNewListsAreEnabled() { + void newListsAreEnabled() { ProtectedTermsLoader localLoader = new ProtectedTermsLoader(new ProtectedTermsPreferences( Collections.emptyList(), Collections.emptyList(), @@ -122,7 +122,7 @@ void testNewListsAreEnabled() { } @Test - void testInitalizedAllInternalDisabled() { + void initalizedAllInternalDisabled() { ProtectedTermsLoader localLoader = new ProtectedTermsLoader(new ProtectedTermsPreferences( Collections.emptyList(), Collections.emptyList(), @@ -134,7 +134,7 @@ void testInitalizedAllInternalDisabled() { } @Test - void testUnknownExternalFileWillNotLoad() { + void unknownExternalFileWillNotLoad() { ProtectedTermsLoader localLoader = new ProtectedTermsLoader(new ProtectedTermsPreferences( ProtectedTermsLoader.getInternalLists(), Collections.singletonList("someUnlikelyNameThatNeverWillExist"), @@ -144,7 +144,7 @@ void testUnknownExternalFileWillNotLoad() { } @Test - void testAllDisabledNoWords() { + void allDisabledNoWords() { ProtectedTermsLoader localLoader = new ProtectedTermsLoader(new ProtectedTermsPreferences( Collections.emptyList(), Collections.emptyList(), @@ -154,7 +154,7 @@ void testAllDisabledNoWords() { } @Test - void testDoNotLoadTheSameInternalListTwice() { + void doNotLoadTheSameInternalListTwice() { ProtectedTermsLoader localLoader = new ProtectedTermsLoader( new ProtectedTermsPreferences( ProtectedTermsLoader.getInternalLists(), @@ -165,7 +165,7 @@ void testDoNotLoadTheSameInternalListTwice() { } @Test - void testAddNewTermListAddsList(@TempDir Path tempDir) { + void addNewTermListAddsList(@TempDir Path tempDir) { ProtectedTermsLoader localLoader = new ProtectedTermsLoader(new ProtectedTermsPreferences( Collections.emptyList(), Collections.emptyList(), @@ -176,7 +176,7 @@ void testAddNewTermListAddsList(@TempDir Path tempDir) { } @Test - void testAddNewTermListNewListInList(@TempDir Path tempDir) { + void addNewTermListNewListInList(@TempDir Path tempDir) { ProtectedTermsLoader localLoader = new ProtectedTermsLoader( new ProtectedTermsPreferences( Collections.emptyList(), @@ -190,7 +190,7 @@ void testAddNewTermListNewListInList(@TempDir Path tempDir) { } @Test - void testRemoveTermList(@TempDir Path tempDir) { + void removeTermList(@TempDir Path tempDir) { ProtectedTermsLoader localLoader = new ProtectedTermsLoader( new ProtectedTermsPreferences( Collections.emptyList(), @@ -202,7 +202,7 @@ void testRemoveTermList(@TempDir Path tempDir) { } @Test - void testRemoveTermListReduceTheCount(@TempDir Path tempDir) { + void removeTermListReduceTheCount(@TempDir Path tempDir) { ProtectedTermsLoader localLoader = new ProtectedTermsLoader(new ProtectedTermsPreferences( Collections.emptyList(), Collections.emptyList(), @@ -214,7 +214,7 @@ void testRemoveTermListReduceTheCount(@TempDir Path tempDir) { } @Test - void testAddNewTermListSetsCorrectDescription(@TempDir Path tempDir) { + void addNewTermListSetsCorrectDescription(@TempDir Path tempDir) { ProtectedTermsLoader localLoader = new ProtectedTermsLoader(new ProtectedTermsPreferences( Collections.emptyList(), Collections.emptyList(), diff --git a/src/test/java/org/jabref/logic/remote/RemotePreferencesTest.java b/src/test/java/org/jabref/logic/remote/RemotePreferencesTest.java index a1a5aab1a72..079c09eb79a 100644 --- a/src/test/java/org/jabref/logic/remote/RemotePreferencesTest.java +++ b/src/test/java/org/jabref/logic/remote/RemotePreferencesTest.java @@ -17,34 +17,34 @@ public void setUp() { } @Test - public void testGetPort() { + public void getPort() { assertEquals(1000, preferences.getPort()); } @Test - public void testSetPort() { + public void setPort() { preferences.setPort(2000); assertEquals(2000, preferences.getPort()); } @Test - public void testUseRemoteServer() { + public void useRemoteServer() { assertTrue(preferences.useRemoteServer()); } @Test - public void testSetUseRemoteServer() { + public void setUseRemoteServer() { preferences.setUseRemoteServer(false); assertFalse(preferences.useRemoteServer()); } @Test - public void testIsDifferentPortTrue() { + public void isDifferentPortTrue() { assertTrue(preferences.isDifferentPort(2000)); } @Test - public void testIsDifferentPortFalse() { + public void isDifferentPortFalse() { assertFalse(preferences.isDifferentPort(1000)); } } diff --git a/src/test/java/org/jabref/logic/remote/RemoteSetupTest.java b/src/test/java/org/jabref/logic/remote/RemoteSetupTest.java index 8a76fe4c3ae..17ecff835f9 100644 --- a/src/test/java/org/jabref/logic/remote/RemoteSetupTest.java +++ b/src/test/java/org/jabref/logic/remote/RemoteSetupTest.java @@ -34,7 +34,7 @@ void setUp() { } @Test - void testGoodCase() { + void goodCase() { final int port = 34567; final String[] message = new String[]{"MYMESSAGE"}; @@ -50,7 +50,7 @@ void testGoodCase() { } @Test - void testGoodCaseWithAllLifecycleMethods() { + void goodCaseWithAllLifecycleMethods() { final int port = 34567; final String[] message = new String[]{"MYMESSAGE"}; @@ -76,7 +76,7 @@ void testGoodCaseWithAllLifecycleMethods() { } @Test - void testPortAlreadyInUse() throws IOException { + void portAlreadyInUse() throws IOException { assumeFalse(OS.OS_X); final int port = 34567; @@ -94,7 +94,7 @@ void testPortAlreadyInUse() throws IOException { } @Test - void testClientTimeout() { + void clientTimeout() { final int port = 34567; final String message = "MYMESSAGE"; diff --git a/src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java b/src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java index fa38b68cc03..4c5856c15b4 100644 --- a/src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java +++ b/src/test/java/org/jabref/logic/search/DatabaseSearcherTest.java @@ -27,26 +27,26 @@ public void setUp() { } @Test - public void testNoMatchesFromEmptyDatabase() { + public void noMatchesFromEmptyDatabase() { List matches = new DatabaseSearcher(new SearchQuery("whatever", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE, SearchRules.SearchFlags.REGULAR_EXPRESSION)), database).getMatches(); assertEquals(Collections.emptyList(), matches); } @Test - public void testNoMatchesFromEmptyDatabaseWithInvalidSearchExpression() { + public void noMatchesFromEmptyDatabaseWithInvalidSearchExpression() { List matches = new DatabaseSearcher(INVALID_SEARCH_QUERY, database).getMatches(); assertEquals(Collections.emptyList(), matches); } @Test - public void testGetDatabaseFromMatchesDatabaseWithEmptyEntries() { + public void getDatabaseFromMatchesDatabaseWithEmptyEntries() { database.insertEntry(new BibEntry()); List matches = new DatabaseSearcher(new SearchQuery("whatever", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE, SearchRules.SearchFlags.REGULAR_EXPRESSION)), database).getMatches(); assertEquals(Collections.emptyList(), matches); } @Test - public void testNoMatchesFromDatabaseWithArticleTypeEntry() { + public void noMatchesFromDatabaseWithArticleTypeEntry() { BibEntry entry = new BibEntry(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "harrer"); database.insertEntry(entry); @@ -55,7 +55,7 @@ public void testNoMatchesFromDatabaseWithArticleTypeEntry() { } @Test - public void testCorrectMatchFromDatabaseWithArticleTypeEntry() { + public void correctMatchFromDatabaseWithArticleTypeEntry() { BibEntry entry = new BibEntry(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "harrer"); database.insertEntry(entry); @@ -64,14 +64,14 @@ public void testCorrectMatchFromDatabaseWithArticleTypeEntry() { } @Test - public void testNoMatchesFromEmptyDatabaseWithInvalidQuery() { + public void noMatchesFromEmptyDatabaseWithInvalidQuery() { SearchQuery query = new SearchQuery("asdf[", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE, SearchRules.SearchFlags.REGULAR_EXPRESSION)); DatabaseSearcher databaseSearcher = new DatabaseSearcher(query, database); assertEquals(Collections.emptyList(), databaseSearcher.getMatches()); } @Test - public void testCorrectMatchFromDatabaseWithIncollectionTypeEntry() { + public void correctMatchFromDatabaseWithIncollectionTypeEntry() { BibEntry entry = new BibEntry(StandardEntryType.InCollection); entry.setField(StandardField.AUTHOR, "tonho"); database.insertEntry(entry); @@ -83,7 +83,7 @@ public void testCorrectMatchFromDatabaseWithIncollectionTypeEntry() { } @Test - public void testNoMatchesFromDatabaseWithTwoEntries() { + public void noMatchesFromDatabaseWithTwoEntries() { BibEntry entry = new BibEntry(); database.insertEntry(entry); @@ -98,7 +98,7 @@ public void testNoMatchesFromDatabaseWithTwoEntries() { } @Test - public void testNoMatchesFromDabaseWithIncollectionTypeEntry() { + public void noMatchesFromDabaseWithIncollectionTypeEntry() { BibEntry entry = new BibEntry(StandardEntryType.InCollection); entry.setField(StandardField.AUTHOR, "tonho"); database.insertEntry(entry); @@ -110,7 +110,7 @@ public void testNoMatchesFromDabaseWithIncollectionTypeEntry() { } @Test - public void testNoMatchFromDatabaseWithEmptyEntry() { + public void noMatchFromDatabaseWithEmptyEntry() { BibEntry entry = new BibEntry(); database.insertEntry(entry); diff --git a/src/test/java/org/jabref/logic/search/SearchQueryTest.java b/src/test/java/org/jabref/logic/search/SearchQueryTest.java index 399c89089e6..3461ebc76b8 100644 --- a/src/test/java/org/jabref/logic/search/SearchQueryTest.java +++ b/src/test/java/org/jabref/logic/search/SearchQueryTest.java @@ -25,21 +25,21 @@ public void testToString() { } @Test - public void testIsContainsBasedSearch() { + public void isContainsBasedSearch() { assertTrue(new SearchQuery("asdf", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE)).isContainsBasedSearch()); assertTrue(new SearchQuery("asdf", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE, SearchRules.SearchFlags.REGULAR_EXPRESSION)).isContainsBasedSearch()); assertFalse(new SearchQuery("author=asdf", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE)).isContainsBasedSearch()); } @Test - public void testIsGrammarBasedSearch() { + public void isGrammarBasedSearch() { assertFalse(new SearchQuery("asdf", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE)).isGrammarBasedSearch()); assertFalse(new SearchQuery("asdf", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE, SearchRules.SearchFlags.REGULAR_EXPRESSION)).isGrammarBasedSearch()); assertTrue(new SearchQuery("author=asdf", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE)).isGrammarBasedSearch()); } @Test - public void testGrammarSearch() { + public void grammarSearch() { BibEntry entry = new BibEntry(); entry.addKeyword("one two", ','); SearchQuery searchQuery = new SearchQuery("keywords=\"one two\"", EnumSet.noneOf(SearchFlags.class)); @@ -47,7 +47,7 @@ public void testGrammarSearch() { } @Test - public void testGrammarSearchFullEntryLastCharMissing() { + public void grammarSearchFullEntryLastCharMissing() { BibEntry entry = new BibEntry(); entry.setField(StandardField.TITLE, "systematic revie"); SearchQuery searchQuery = new SearchQuery("title=\"systematic review\"", EnumSet.noneOf(SearchFlags.class)); @@ -55,7 +55,7 @@ public void testGrammarSearchFullEntryLastCharMissing() { } @Test - public void testGrammarSearchFullEntry() { + public void grammarSearchFullEntry() { BibEntry entry = new BibEntry(); entry.setField(StandardField.TITLE, "systematic review"); SearchQuery searchQuery = new SearchQuery("title=\"systematic review\"", EnumSet.noneOf(SearchFlags.class)); @@ -63,7 +63,7 @@ public void testGrammarSearchFullEntry() { } @Test - public void testSearchingForOpenBraketInBooktitle() { + public void searchingForOpenBraketInBooktitle() { BibEntry e = new BibEntry(StandardEntryType.InProceedings); e.setField(StandardField.BOOKTITLE, "Super Conference (SC)"); @@ -72,7 +72,7 @@ public void testSearchingForOpenBraketInBooktitle() { } @Test - public void testSearchMatchesSingleKeywordNotPart() { + public void searchMatchesSingleKeywordNotPart() { BibEntry e = new BibEntry(StandardEntryType.InProceedings); e.setField(StandardField.KEYWORDS, "banana, pineapple, orange"); @@ -81,7 +81,7 @@ public void testSearchMatchesSingleKeywordNotPart() { } @Test - public void testSearchMatchesSingleKeyword() { + public void searchMatchesSingleKeyword() { BibEntry e = new BibEntry(StandardEntryType.InProceedings); e.setField(StandardField.KEYWORDS, "banana, pineapple, orange"); @@ -90,7 +90,7 @@ public void testSearchMatchesSingleKeyword() { } @Test - public void testSearchAllFields() { + public void searchAllFields() { BibEntry e = new BibEntry(StandardEntryType.InProceedings); e.setField(StandardField.TITLE, "Fruity features"); e.setField(StandardField.KEYWORDS, "banana, pineapple, orange"); @@ -100,7 +100,7 @@ public void testSearchAllFields() { } @Test - public void testSearchAllFieldsNotForSpecificField() { + public void searchAllFieldsNotForSpecificField() { BibEntry e = new BibEntry(StandardEntryType.InProceedings); e.setField(StandardField.TITLE, "Fruity features"); e.setField(StandardField.KEYWORDS, "banana, pineapple, orange"); @@ -110,7 +110,7 @@ public void testSearchAllFieldsNotForSpecificField() { } @Test - public void testSearchAllFieldsAndSpecificField() { + public void searchAllFieldsAndSpecificField() { BibEntry e = new BibEntry(StandardEntryType.InProceedings); e.setField(StandardField.TITLE, "Fruity features"); e.setField(StandardField.KEYWORDS, "banana, pineapple, orange"); @@ -120,7 +120,7 @@ public void testSearchAllFieldsAndSpecificField() { } @Test - public void testIsMatch() { + public void isMatch() { BibEntry entry = new BibEntry(); entry.setType(StandardEntryType.Article); entry.setField(StandardField.AUTHOR, "asdf"); @@ -131,52 +131,52 @@ public void testIsMatch() { } @Test - public void testIsValidQueryNotAsRegEx() { + public void isValidQueryNotAsRegEx() { assertTrue(new SearchQuery("asdf", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE)).isValid()); } @Test - public void testIsValidQueryContainsBracketNotAsRegEx() { + public void isValidQueryContainsBracketNotAsRegEx() { assertTrue(new SearchQuery("asdf[", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE)).isValid()); } @Test - public void testIsNotValidQueryContainsBracketNotAsRegEx() { + public void isNotValidQueryContainsBracketNotAsRegEx() { assertTrue(new SearchQuery("asdf[", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE, SearchRules.SearchFlags.REGULAR_EXPRESSION)).isValid()); } @Test - public void testIsValidQueryAsRegEx() { + public void isValidQueryAsRegEx() { assertTrue(new SearchQuery("asdf", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE, SearchRules.SearchFlags.REGULAR_EXPRESSION)).isValid()); } @Test - public void testIsValidQueryWithNumbersAsRegEx() { + public void isValidQueryWithNumbersAsRegEx() { assertTrue(new SearchQuery("123", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE, SearchRules.SearchFlags.REGULAR_EXPRESSION)).isValid()); } @Test - public void testIsValidQueryContainsBracketAsRegEx() { + public void isValidQueryContainsBracketAsRegEx() { assertTrue(new SearchQuery("asdf[", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE, SearchRules.SearchFlags.REGULAR_EXPRESSION)).isValid()); } @Test - public void testIsValidQueryWithEqualSignAsRegEx() { + public void isValidQueryWithEqualSignAsRegEx() { assertTrue(new SearchQuery("author=asdf", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE, SearchRules.SearchFlags.REGULAR_EXPRESSION)).isValid()); } @Test - public void testIsValidQueryWithNumbersAndEqualSignAsRegEx() { + public void isValidQueryWithNumbersAndEqualSignAsRegEx() { assertTrue(new SearchQuery("author=123", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE, SearchRules.SearchFlags.REGULAR_EXPRESSION)).isValid()); } @Test - public void testIsValidQueryWithEqualSignNotAsRegEx() { + public void isValidQueryWithEqualSignNotAsRegEx() { assertTrue(new SearchQuery("author=asdf", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE)).isValid()); } @Test - public void testIsValidQueryWithNumbersAndEqualSignNotAsRegEx() { + public void isValidQueryWithNumbersAndEqualSignNotAsRegEx() { assertTrue(new SearchQuery("author=123", EnumSet.of(SearchRules.SearchFlags.CASE_SENSITIVE)).isValid()); } @@ -191,7 +191,7 @@ public void isMatchedForNormalAndFieldBasedSearchMixed() { } @Test - public void testSimpleTerm() { + public void simpleTerm() { String query = "progress"; SearchQuery result = new SearchQuery(query, EnumSet.noneOf(SearchFlags.class)); @@ -199,7 +199,7 @@ public void testSimpleTerm() { } @Test - public void testGetPattern() { + public void getPattern() { String query = "progress"; SearchQuery result = new SearchQuery(query, EnumSet.noneOf(SearchFlags.class)); Pattern pattern = Pattern.compile("(\\Qprogress\\E)"); @@ -208,7 +208,7 @@ public void testGetPattern() { } @Test - public void testGetRegexpPattern() { + public void getRegexpPattern() { String queryText = "[a-c]\\d* \\d*"; SearchQuery regexQuery = new SearchQuery(queryText, EnumSet.of(SearchRules.SearchFlags.REGULAR_EXPRESSION)); Pattern pattern = Pattern.compile("([a-c]\\d* \\d*)"); @@ -216,7 +216,7 @@ public void testGetRegexpPattern() { } @Test - public void testGetRegexpJavascriptPattern() { + public void getRegexpJavascriptPattern() { String queryText = "[a-c]\\d* \\d*"; SearchQuery regexQuery = new SearchQuery(queryText, EnumSet.of(SearchRules.SearchFlags.REGULAR_EXPRESSION)); Pattern pattern = Pattern.compile("([a-c]\\d* \\d*)"); @@ -224,7 +224,7 @@ public void testGetRegexpJavascriptPattern() { } @Test - public void testEscapingInPattern() { + public void escapingInPattern() { // first word contain all java special regex characters String queryText = "<([{\\\\^-=$!|]})?*+.> word1 word2."; SearchQuery textQueryWithSpecialChars = new SearchQuery(queryText, EnumSet.noneOf(SearchFlags.class)); @@ -233,7 +233,7 @@ public void testEscapingInPattern() { } @Test - public void testEscapingInJavascriptPattern() { + public void escapingInJavascriptPattern() { // first word contain all javascript special regex characters that should be escaped individually in text based search String queryText = "([{\\\\^$|]})?*+./ word1 word2."; SearchQuery textQueryWithSpecialChars = new SearchQuery(queryText, EnumSet.noneOf(SearchFlags.class)); diff --git a/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java b/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java index e429134839c..db423c31de9 100644 --- a/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java +++ b/src/test/java/org/jabref/logic/shared/DBMSProcessorTest.java @@ -66,7 +66,7 @@ void databaseIntegrityBrokenAfterClearedTables() throws SQLException { } @Test - void testInsertEntry() throws SQLException { + void insertEntry() throws SQLException { BibEntry expectedEntry = getBibEntryExample(); dbmsProcessor.insertEntry(expectedEntry); @@ -97,7 +97,7 @@ void testInsertEntry() throws SQLException { } @Test - void testInsertEntryWithEmptyFields() throws SQLException { + void insertEntryWithEmptyFields() throws SQLException { BibEntry expectedEntry = new BibEntry(StandardEntryType.Article); dbmsProcessor.insertEntry(expectedEntry); @@ -126,7 +126,7 @@ private static BibEntry getBibEntryExample() { } @Test - void testUpdateEntry() throws Exception { + void updateEntry() throws Exception { BibEntry expectedEntry = getBibEntryExample(); dbmsProcessor.insertEntry(expectedEntry); @@ -141,7 +141,7 @@ void testUpdateEntry() throws Exception { } @Test - void testUpdateEmptyEntry() throws Exception { + void updateEmptyEntry() throws Exception { BibEntry expectedEntry = new BibEntry(StandardEntryType.Article); dbmsProcessor.insertEntry(expectedEntry); @@ -155,7 +155,7 @@ void testUpdateEmptyEntry() throws Exception { } @Test - void testGetEntriesByIdList() throws Exception { + void getEntriesByIdList() throws Exception { BibEntry firstEntry = getBibEntryExample(); firstEntry.setField(InternalField.INTERNAL_ID_FIELD, "00001"); BibEntry secondEntry = getBibEntryExample(); @@ -170,7 +170,7 @@ void testGetEntriesByIdList() throws Exception { } @Test - void testUpdateNewerEntry() { + void updateNewerEntry() { BibEntry bibEntry = getBibEntryExample(); dbmsProcessor.insertEntry(bibEntry); @@ -183,7 +183,7 @@ void testUpdateNewerEntry() { } @Test - void testUpdateEqualEntry() throws OfflineLockException, SQLException { + void updateEqualEntry() throws OfflineLockException, SQLException { BibEntry expectedBibEntry = getBibEntryExample(); dbmsProcessor.insertEntry(expectedBibEntry); @@ -198,7 +198,7 @@ void testUpdateEqualEntry() throws OfflineLockException, SQLException { } @Test - void testRemoveAllEntries() throws SQLException { + void removeAllEntries() throws SQLException { BibEntry firstEntry = getBibEntryExample(); BibEntry secondEntry = getBibEntryExample2(); List entriesToRemove = Arrays.asList(firstEntry, secondEntry); @@ -212,7 +212,7 @@ void testRemoveAllEntries() throws SQLException { } @Test - void testRemoveSomeEntries() throws SQLException { + void removeSomeEntries() throws SQLException { BibEntry firstEntry = getBibEntryExample(); BibEntry secondEntry = getBibEntryExample2(); BibEntry thirdEntry = getBibEntryExample3(); @@ -233,7 +233,7 @@ void testRemoveSomeEntries() throws SQLException { } @Test - void testRemoveSingleEntry() throws SQLException { + void removeSingleEntry() throws SQLException { BibEntry entryToRemove = getBibEntryExample(); dbmsProcessor.insertEntry(entryToRemove); dbmsProcessor.removeEntries(Collections.singletonList(entryToRemove)); @@ -244,12 +244,12 @@ void testRemoveSingleEntry() throws SQLException { } @Test - void testRemoveEntriesOnNullThrows() { + void removeEntriesOnNullThrows() { assertThrows(NullPointerException.class, () -> dbmsProcessor.removeEntries(null)); } @Test - void testRemoveEmptyEntryList() throws SQLException { + void removeEmptyEntryList() throws SQLException { dbmsProcessor.removeEntries(Collections.emptyList()); try (ResultSet entryResultSet = selectFrom("ENTRY", dbmsConnection, dbmsProcessor)) { @@ -258,7 +258,7 @@ void testRemoveEmptyEntryList() throws SQLException { } @Test - void testGetSharedEntries() { + void getSharedEntries() { BibEntry bibEntry = getBibEntryExampleWithEmptyFields(); dbmsProcessor.insertEntry(bibEntry); @@ -269,7 +269,7 @@ void testGetSharedEntries() { } @Test - void testGetSharedEntry() { + void getSharedEntry() { BibEntry expectedBibEntry = getBibEntryExampleWithEmptyFields(); dbmsProcessor.insertEntry(expectedBibEntry); @@ -280,13 +280,13 @@ void testGetSharedEntry() { } @Test - void testGetNotExistingSharedEntry() { + void getNotExistingSharedEntry() { Optional actualBibEntryOptional = dbmsProcessor.getSharedEntry(1); assertFalse(actualBibEntryOptional.isPresent()); } @Test - void testGetSharedIDVersionMapping() throws OfflineLockException, SQLException { + void getSharedIDVersionMapping() throws OfflineLockException, SQLException { BibEntry firstEntry = getBibEntryExample(); BibEntry secondEntry = getBibEntryExample(); @@ -304,7 +304,7 @@ void testGetSharedIDVersionMapping() throws OfflineLockException, SQLException { } @Test - void testGetSharedMetaData() { + void getSharedMetaData() { insertMetaData("databaseType", "bibtex;", dbmsConnection, dbmsProcessor); insertMetaData("protectedFlag", "true;", dbmsConnection, dbmsProcessor); insertMetaData("saveActions", "enabled;\nauthor[capitalize,html_to_latex]\ntitle[title_case]\n;", dbmsConnection, dbmsProcessor); @@ -318,7 +318,7 @@ void testGetSharedMetaData() { } @Test - void testSetSharedMetaData() throws SQLException { + void setSharedMetaData() throws SQLException { Map expectedMetaData = getMetaDataExample(); dbmsProcessor.setSharedMetaData(expectedMetaData); @@ -367,7 +367,7 @@ private static BibEntry getBibEntryExample3() { } @Test - void testInsertMultipleEntries() throws SQLException { + void insertMultipleEntries() throws SQLException { List entries = new ArrayList<>(); for (int i = 0; i < 5; i++) { entries.add(new BibEntry(StandardEntryType.Article).withField(StandardField.JOURNAL, "journal " + i) diff --git a/src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java b/src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java index d22b1ea1f62..2701f6ac33c 100644 --- a/src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java +++ b/src/test/java/org/jabref/logic/shared/DBMSSynchronizerTest.java @@ -73,7 +73,7 @@ public void clear() { } @Test - public void testEntryAddedEventListener() throws Exception { + public void entryAddedEventListener() throws Exception { BibEntry expectedEntry = createExampleBibEntry(1); BibEntry furtherEntry = createExampleBibEntry(1); @@ -118,7 +118,7 @@ public void oneLocalAndOneSharedFieldChangeIsSynchronizedCorrectly() throws Exce } @Test - public void testEntriesRemovedEventListener() throws Exception { + public void entriesRemovedEventListener() throws Exception { BibEntry bibEntry = createExampleBibEntry(1); bibDatabase.insertEntry(bibEntry); @@ -140,7 +140,7 @@ public void testEntriesRemovedEventListener() throws Exception { } @Test - public void testMetaDataChangedEventListener() throws Exception { + public void metaDataChangedEventListener() throws Exception { MetaData testMetaData = new MetaData(); testMetaData.registerListener(dbmsSynchronizer); dbmsSynchronizer.setMetaData(testMetaData); @@ -154,7 +154,7 @@ public void testMetaDataChangedEventListener() throws Exception { } @Test - public void testInitializeDatabases() throws Exception { + public void initializeDatabases() throws Exception { dbmsSynchronizer.initializeDatabases(); assertTrue(dbmsProcessor.checkBaseIntegrity()); dbmsSynchronizer.initializeDatabases(); @@ -162,7 +162,7 @@ public void testInitializeDatabases() throws Exception { } @Test - public void testSynchronizeLocalDatabaseWithEntryRemoval() throws Exception { + public void synchronizeLocalDatabaseWithEntryRemoval() throws Exception { List expectedBibEntries = Arrays.asList(createExampleBibEntry(1), createExampleBibEntry(2)); dbmsProcessor.insertEntry(expectedBibEntries.getFirst()); @@ -184,7 +184,7 @@ public void testSynchronizeLocalDatabaseWithEntryRemoval() throws Exception { } @Test - public void testSynchronizeLocalDatabaseWithEntryUpdate() throws Exception { + public void synchronizeLocalDatabaseWithEntryUpdate() throws Exception { BibEntry bibEntry = createExampleBibEntry(1); bibDatabase.insertEntry(bibEntry); assertEquals(List.of(bibEntry), bibDatabase.getEntries()); @@ -220,7 +220,7 @@ public void updateEntryDoesNotModifyLocalDatabase() throws Exception { } @Test - public void testApplyMetaData() throws Exception { + public void applyMetaData() throws Exception { BibEntry bibEntry = createExampleBibEntry(1); bibDatabase.insertEntry(bibEntry); diff --git a/src/test/java/org/jabref/logic/texparser/DefaultTexParserTest.java b/src/test/java/org/jabref/logic/texparser/DefaultTexParserTest.java index ab41c9967e6..c8a2608c2ef 100644 --- a/src/test/java/org/jabref/logic/texparser/DefaultTexParserTest.java +++ b/src/test/java/org/jabref/logic/texparser/DefaultTexParserTest.java @@ -37,7 +37,7 @@ private void testNonMatchCite(String citeString) { } @Test - public void testCiteCommands() { + public void citeCommands() { testMatchCite(UNRESOLVED, "\\cite[pre][post]{UnresolvedKey}"); testMatchCite(UNRESOLVED, "\\cite*{UnresolvedKey}"); testMatchCite(UNRESOLVED, "\\parencite[post]{UnresolvedKey}"); @@ -55,7 +55,7 @@ public void testCiteCommands() { } @Test - public void testTwoCitationsSameLine() { + public void twoCitationsSameLine() { String citeString = "\\citep{Einstein1920c} and \\citep{Einstein1920a}"; LatexParserResult latexParserResult = new DefaultLatexParser().parse(citeString); @@ -68,7 +68,7 @@ public void testTwoCitationsSameLine() { } @Test - public void testFileEncodingUtf8() throws URISyntaxException { + public void fileEncodingUtf8() throws URISyntaxException { Path texFile = Path.of(DefaultTexParserTest.class.getResource("utf-8.tex").toURI()); LatexParserResult parserResult = new DefaultLatexParser().parse(texFile); @@ -81,7 +81,7 @@ public void testFileEncodingUtf8() throws URISyntaxException { } @Test - public void testFileEncodingIso88591() throws URISyntaxException { + public void fileEncodingIso88591() throws URISyntaxException { Path texFile = Path.of(DefaultTexParserTest.class.getResource("iso-8859-1.tex").toURI()); LatexParserResult parserResult = new DefaultLatexParser().parse(texFile); @@ -96,7 +96,7 @@ public void testFileEncodingIso88591() throws URISyntaxException { } @Test - public void testFileEncodingIso885915() throws URISyntaxException { + public void fileEncodingIso885915() throws URISyntaxException { Path texFile = Path.of(DefaultTexParserTest.class.getResource("iso-8859-15.tex").toURI()); LatexParserResult parserResult = new DefaultLatexParser().parse(texFile); @@ -111,7 +111,7 @@ public void testFileEncodingIso885915() throws URISyntaxException { } @Test - public void testFileEncodingForThreeFiles() throws URISyntaxException { + public void fileEncodingForThreeFiles() throws URISyntaxException { Path texFile = Path.of(DefaultTexParserTest.class.getResource("utf-8.tex").toURI()); Path texFile2 = Path.of(DefaultTexParserTest.class.getResource("iso-8859-1.tex").toURI()); Path texFile3 = Path.of(DefaultTexParserTest.class.getResource("iso-8859-15.tex").toURI()); @@ -132,7 +132,7 @@ public void testFileEncodingForThreeFiles() throws URISyntaxException { } @Test - public void testSingleFile() throws URISyntaxException { + public void singleFile() throws URISyntaxException { Path texFile = Path.of(DefaultTexParserTest.class.getResource("paper.tex").toURI()); LatexParserResult parserResult = new DefaultLatexParser().parse(texFile); @@ -149,7 +149,7 @@ public void testSingleFile() throws URISyntaxException { } @Test - public void testTwoFiles() throws URISyntaxException { + public void twoFiles() throws URISyntaxException { Path texFile = Path.of(DefaultTexParserTest.class.getResource("paper.tex").toURI()); Path texFile2 = Path.of(DefaultTexParserTest.class.getResource("paper2.tex").toURI()); @@ -171,7 +171,7 @@ public void testTwoFiles() throws URISyntaxException { } @Test - public void testDuplicateFiles() throws URISyntaxException { + public void duplicateFiles() throws URISyntaxException { Path texFile = Path.of(DefaultTexParserTest.class.getResource("paper.tex").toURI()); LatexParserResult parserResult = new DefaultLatexParser().parse(Arrays.asList(texFile, texFile)); @@ -188,7 +188,7 @@ public void testDuplicateFiles() throws URISyntaxException { } @Test - public void testUnknownKey() throws URISyntaxException { + public void unknownKey() throws URISyntaxException { Path texFile = Path.of(DefaultTexParserTest.class.getResource("unknown_key.tex").toURI()); LatexParserResult parserResult = new DefaultLatexParser().parse(texFile); @@ -204,7 +204,7 @@ public void testUnknownKey() throws URISyntaxException { } @Test - public void testFileNotFound() { + public void fileNotFound() { Path texFile = Path.of("file_not_found.tex"); LatexParserResult parserResult = new DefaultLatexParser().parse(texFile); @@ -216,7 +216,7 @@ public void testFileNotFound() { } @Test - public void testNestedFiles() throws URISyntaxException { + public void nestedFiles() throws URISyntaxException { Path texFile = Path.of(DefaultTexParserTest.class.getResource("nested.tex").toURI()); Path texFile2 = Path.of(DefaultTexParserTest.class.getResource("nested2.tex").toURI()); Path texFile3 = Path.of(DefaultTexParserTest.class.getResource("paper.tex").toURI()); diff --git a/src/test/java/org/jabref/logic/texparser/LatexParserTest.java b/src/test/java/org/jabref/logic/texparser/LatexParserTest.java index b4e6edb131f..135d907f874 100644 --- a/src/test/java/org/jabref/logic/texparser/LatexParserTest.java +++ b/src/test/java/org/jabref/logic/texparser/LatexParserTest.java @@ -89,7 +89,7 @@ void setUp() { } @Test - public void testSameFileDifferentDatabases() throws URISyntaxException { + public void sameFileDifferentDatabases() throws URISyntaxException { Path texFile = Path.of(LatexParserTest.class.getResource("paper.tex").toURI()); LatexParserResult parserResult = new DefaultLatexParser().parse(texFile); @@ -117,7 +117,7 @@ public void testSameFileDifferentDatabases() throws URISyntaxException { } @Test - public void testTwoFilesDifferentDatabases() throws URISyntaxException { + public void twoFilesDifferentDatabases() throws URISyntaxException { Path texFile = Path.of(LatexParserTest.class.getResource("paper.tex").toURI()); Path texFile2 = Path.of(LatexParserTest.class.getResource("paper2.tex").toURI()); diff --git a/src/test/java/org/jabref/logic/texparser/TexBibEntriesResolverTest.java b/src/test/java/org/jabref/logic/texparser/TexBibEntriesResolverTest.java index e7c5a943f04..a39da7fe0a2 100644 --- a/src/test/java/org/jabref/logic/texparser/TexBibEntriesResolverTest.java +++ b/src/test/java/org/jabref/logic/texparser/TexBibEntriesResolverTest.java @@ -98,7 +98,7 @@ void setUp() { } @Test - public void testSingleFile() throws URISyntaxException { + public void singleFile() throws URISyntaxException { Path texFile = Path.of(TexBibEntriesResolverTest.class.getResource("paper.tex").toURI()); LatexParserResult parserResult = new DefaultLatexParser().parse(texFile); @@ -109,7 +109,7 @@ public void testSingleFile() throws URISyntaxException { } @Test - public void testTwoFiles() throws URISyntaxException { + public void twoFiles() throws URISyntaxException { Path texFile = Path.of(TexBibEntriesResolverTest.class.getResource("paper.tex").toURI()); Path texFile2 = Path.of(TexBibEntriesResolverTest.class.getResource("paper2.tex").toURI()); LatexParserResult parserResult = new DefaultLatexParser().parse(Arrays.asList(texFile, texFile2)); @@ -121,7 +121,7 @@ public void testTwoFiles() throws URISyntaxException { } @Test - public void testDuplicateFiles() throws URISyntaxException { + public void duplicateFiles() throws URISyntaxException { Path texFile = Path.of(TexBibEntriesResolverTest.class.getResource("paper.tex").toURI()); LatexParserResult parserResult = new DefaultLatexParser().parse(texFile); @@ -132,7 +132,7 @@ public void testDuplicateFiles() throws URISyntaxException { } @Test - public void testUnknownKey() throws URISyntaxException { + public void unknownKey() throws URISyntaxException { Path texFile = Path.of(TexBibEntriesResolverTest.class.getResource("unknown_key.tex").toURI()); LatexParserResult parserResult = new DefaultLatexParser().parse(texFile); @@ -143,7 +143,7 @@ public void testUnknownKey() throws URISyntaxException { } @Test - public void testNestedFiles() throws URISyntaxException { + public void nestedFiles() throws URISyntaxException { Path texFile = Path.of(TexBibEntriesResolverTest.class.getResource("nested.tex").toURI()); LatexParserResult parserResult = new DefaultLatexParser().parse(texFile); @@ -154,7 +154,7 @@ public void testNestedFiles() throws URISyntaxException { } @Test - public void testCrossRef() throws URISyntaxException { + public void crossRef() throws URISyntaxException { Path texFile = Path.of(TexBibEntriesResolverTest.class.getResource("crossref.tex").toURI()); LatexParserResult parserResult = new DefaultLatexParser().parse(texFile); diff --git a/src/test/java/org/jabref/logic/util/BuildInfoTest.java b/src/test/java/org/jabref/logic/util/BuildInfoTest.java index ed057a09344..148c27b9863 100644 --- a/src/test/java/org/jabref/logic/util/BuildInfoTest.java +++ b/src/test/java/org/jabref/logic/util/BuildInfoTest.java @@ -8,13 +8,13 @@ public class BuildInfoTest { @Test - public void testDefaults() { + public void defaults() { BuildInfo buildInfo = new BuildInfo("asdf"); assertEquals("UNKNOWN", buildInfo.version.getFullVersion()); } @Test - public void testFileImport() { + public void fileImport() { BuildInfo buildInfo = new BuildInfo("/org/jabref/util/build.properties"); assertEquals("42", buildInfo.version.getFullVersion()); } diff --git a/src/test/java/org/jabref/logic/util/FileNameCleanerTest.java b/src/test/java/org/jabref/logic/util/FileNameCleanerTest.java index 14911166b4c..a77ae65cda8 100644 --- a/src/test/java/org/jabref/logic/util/FileNameCleanerTest.java +++ b/src/test/java/org/jabref/logic/util/FileNameCleanerTest.java @@ -9,28 +9,28 @@ public class FileNameCleanerTest { @Test - public void testCleanFileName() { + public void cleanFileName() { assertEquals("legalFilename.txt", FileNameCleaner.cleanFileName("legalFilename.txt")); assertEquals("illegalFilename______.txt", FileNameCleaner.cleanFileName("illegalFilename/?*<>|.txt")); assertEquals("illegalFileName_.txt", FileNameCleaner.cleanFileName("illegalFileName{.txt")); } @Test - public void testCleanDirectoryName() { + public void cleanDirectoryName() { assertEquals("legalFilename.txt", FileNameCleaner.cleanDirectoryName("legalFilename.txt")); assertEquals("subdir/legalFilename.txt", FileNameCleaner.cleanDirectoryName("subdir/legalFilename.txt")); assertEquals("illegalFilename/_____.txt", FileNameCleaner.cleanDirectoryName("illegalFilename/?*<>|.txt")); } @Test - public void testCleanDirectoryNameForWindows() { + public void cleanDirectoryNameForWindows() { assertEquals("legalFilename.txt", FileNameCleaner.cleanDirectoryName("legalFilename.txt")); assertEquals("subdir\\legalFilename.txt", FileNameCleaner.cleanDirectoryName("subdir\\legalFilename.txt")); assertEquals("illegalFilename\\_____.txt", FileNameCleaner.cleanDirectoryName("illegalFilename\\?*<>|.txt")); } @Test - public void testCleanCurlyBracesAsWell() { + public void cleanCurlyBracesAsWell() { assertEquals("The Evolution of Sentiment_ Analysis_A Review of Research Topics, Venues, and Top Cited Papers.PDF", FileNameCleaner.cleanFileName("The Evolution of Sentiment} Analysis}A Review of Research Topics, Venues, and Top Cited Papers.PDF")); } } diff --git a/src/test/java/org/jabref/logic/util/UpdateFieldTest.java b/src/test/java/org/jabref/logic/util/UpdateFieldTest.java index 5012e054f75..bd23b4cee01 100644 --- a/src/test/java/org/jabref/logic/util/UpdateFieldTest.java +++ b/src/test/java/org/jabref/logic/util/UpdateFieldTest.java @@ -31,34 +31,34 @@ public void setUp() throws Exception { } @Test - public void testUpdateFieldWorksEmptyField() { + public void updateFieldWorksEmptyField() { assertFalse(entry.hasField(StandardField.YEAR)); UpdateField.updateField(entry, StandardField.YEAR, "2016"); assertEquals(Optional.of("2016"), entry.getField(StandardField.YEAR)); } @Test - public void testUpdateFieldWorksNonEmptyField() { + public void updateFieldWorksNonEmptyField() { entry.setField(StandardField.YEAR, "2015"); UpdateField.updateField(entry, StandardField.YEAR, "2016"); assertEquals(Optional.of("2016"), entry.getField(StandardField.YEAR)); } @Test - public void testUpdateFieldHasChanged() { + public void updateFieldHasChanged() { assertFalse(entry.hasChanged()); UpdateField.updateField(entry, StandardField.YEAR, "2016"); assertTrue(entry.hasChanged()); } @Test - public void testUpdateFieldValidFieldChange() { + public void updateFieldValidFieldChange() { Optional change = UpdateField.updateField(entry, StandardField.YEAR, "2016"); assertTrue(change.isPresent()); } @Test - public void testUpdateFieldCorrectFieldChangeContentsEmptyField() { + public void updateFieldCorrectFieldChangeContentsEmptyField() { Optional change = UpdateField.updateField(entry, StandardField.YEAR, "2016"); assertNull(change.get().getOldValue()); assertEquals(StandardField.YEAR, change.get().getField()); @@ -67,7 +67,7 @@ public void testUpdateFieldCorrectFieldChangeContentsEmptyField() { } @Test - public void testUpdateFieldCorrectFieldChangeContentsNonEmptyField() { + public void updateFieldCorrectFieldChangeContentsNonEmptyField() { entry.setField(StandardField.YEAR, "2015"); Optional change = UpdateField.updateField(entry, StandardField.YEAR, "2016"); assertEquals("2015", change.get().getOldValue()); @@ -77,14 +77,14 @@ public void testUpdateFieldCorrectFieldChangeContentsNonEmptyField() { } @Test - public void testUpdateFieldSameValueNoChange() { + public void updateFieldSameValueNoChange() { entry.setField(StandardField.YEAR, "2016"); Optional change = UpdateField.updateField(entry, StandardField.YEAR, "2016"); assertFalse(change.isPresent()); } @Test - public void testUpdateFieldSameValueNotChange() { + public void updateFieldSameValueNotChange() { entry.setField(StandardField.YEAR, "2016"); entry.setChanged(false); UpdateField.updateField(entry, StandardField.YEAR, "2016"); @@ -92,33 +92,33 @@ public void testUpdateFieldSameValueNotChange() { } @Test - public void testUpdateFieldSetToNullClears() { + public void updateFieldSetToNullClears() { entry.setField(StandardField.YEAR, "2016"); UpdateField.updateField(entry, StandardField.YEAR, null); assertFalse(entry.hasField(StandardField.YEAR)); } @Test - public void testUpdateFieldSetEmptyToNullClears() { + public void updateFieldSetEmptyToNullClears() { UpdateField.updateField(entry, StandardField.YEAR, null); assertFalse(entry.hasField(StandardField.YEAR)); } @Test - public void testUpdateFieldSetToNullHasFieldChangeContents() { + public void updateFieldSetToNullHasFieldChangeContents() { entry.setField(StandardField.YEAR, "2016"); Optional change = UpdateField.updateField(entry, StandardField.YEAR, null); assertTrue(change.isPresent()); } @Test - public void testUpdateFieldSetRmptyToNullHasNoFieldChangeContents() { + public void updateFieldSetRmptyToNullHasNoFieldChangeContents() { Optional change = UpdateField.updateField(entry, StandardField.YEAR, null); assertFalse(change.isPresent()); } @Test - public void testUpdateFieldSetToNullCorrectFieldChangeContents() { + public void updateFieldSetToNullCorrectFieldChangeContents() { entry.setField(StandardField.YEAR, "2016"); Optional change = UpdateField.updateField(entry, StandardField.YEAR, null); assertNull(change.get().getNewValue()); @@ -128,14 +128,14 @@ public void testUpdateFieldSetToNullCorrectFieldChangeContents() { } @Test - public void testUpdateFieldSameContentClears() { + public void updateFieldSameContentClears() { entry.setField(StandardField.YEAR, "2016"); UpdateField.updateField(entry, StandardField.YEAR, "2016", true); assertFalse(entry.hasField(StandardField.YEAR)); } @Test - public void testUpdateFieldSameContentHasChanged() { + public void updateFieldSameContentHasChanged() { entry.setField(StandardField.YEAR, "2016"); entry.setChanged(false); UpdateField.updateField(entry, StandardField.YEAR, "2016", true); @@ -143,14 +143,14 @@ public void testUpdateFieldSameContentHasChanged() { } @Test - public void testUpdateFieldSameContentHasFieldChange() { + public void updateFieldSameContentHasFieldChange() { entry.setField(StandardField.YEAR, "2016"); Optional change = UpdateField.updateField(entry, StandardField.YEAR, "2016", true); assertTrue(change.isPresent()); } @Test - public void testUpdateFieldSameContentHasCorrectFieldChange() { + public void updateFieldSameContentHasCorrectFieldChange() { entry.setField(StandardField.YEAR, "2016"); Optional change = UpdateField.updateField(entry, StandardField.YEAR, "2016", true); assertNull(change.get().getNewValue()); @@ -160,7 +160,7 @@ public void testUpdateFieldSameContentHasCorrectFieldChange() { } @Test - public void testUpdateNonDisplayableFieldUpdates() { + public void updateNonDisplayableFieldUpdates() { assertFalse(entry.hasField(StandardField.YEAR)); UpdateField.updateNonDisplayableField(entry, StandardField.YEAR, "2016"); assertTrue(entry.hasField(StandardField.YEAR)); @@ -168,7 +168,7 @@ public void testUpdateNonDisplayableFieldUpdates() { } @Test - public void testUpdateNonDisplayableFieldHasNotChanged() { + public void updateNonDisplayableFieldHasNotChanged() { assertFalse(entry.hasChanged()); UpdateField.updateNonDisplayableField(entry, StandardField.YEAR, "2016"); assertFalse(entry.hasChanged()); diff --git a/src/test/java/org/jabref/logic/util/io/FileNameUniquenessTest.java b/src/test/java/org/jabref/logic/util/io/FileNameUniquenessTest.java index a54aadf58b4..6b888754323 100644 --- a/src/test/java/org/jabref/logic/util/io/FileNameUniquenessTest.java +++ b/src/test/java/org/jabref/logic/util/io/FileNameUniquenessTest.java @@ -20,7 +20,7 @@ public class FileNameUniquenessTest { protected Path tempDir; @Test - public void testGetNonOverWritingFileNameReturnsSameName() throws IOException { + public void getNonOverWritingFileNameReturnsSameName() throws IOException { assertFalse(Files.exists(tempDir.resolve("sameFile.txt"))); String outputFileName = FileNameUniqueness.getNonOverWritingFileName(tempDir, "sameFile.txt"); @@ -28,7 +28,7 @@ public void testGetNonOverWritingFileNameReturnsSameName() throws IOException { } @Test - public void testGetNonOverWritingFileNameReturnsUniqueNameOver1Conflict() throws IOException { + public void getNonOverWritingFileNameReturnsUniqueNameOver1Conflict() throws IOException { Path dummyFilePath1 = tempDir.resolve("differentFile.txt"); Files.createFile(dummyFilePath1); @@ -38,7 +38,7 @@ public void testGetNonOverWritingFileNameReturnsUniqueNameOver1Conflict() throws } @Test - public void testGetNonOverWritingFileNameReturnsUniqueNameOverNConflicts() throws IOException { + public void getNonOverWritingFileNameReturnsUniqueNameOverNConflicts() throws IOException { Path dummyFilePath1 = tempDir.resolve("manyfiles.txt"); Path dummyFilePath2 = tempDir.resolve("manyfiles (1).txt"); @@ -50,7 +50,7 @@ public void testGetNonOverWritingFileNameReturnsUniqueNameOverNConflicts() throw } @Test - public void testIsDuplicatedFileWithNoSimilarNames() throws IOException { + public void isDuplicatedFileWithNoSimilarNames() throws IOException { DialogService dialogService = mock(DialogService.class); String filename1 = "file1.txt"; Path filePath1 = tempDir.resolve(filename1); @@ -61,7 +61,7 @@ public void testIsDuplicatedFileWithNoSimilarNames() throws IOException { } @Test - public void testIsDuplicatedFileWithOneSimilarNames() throws IOException { + public void isDuplicatedFileWithOneSimilarNames() throws IOException { DialogService dialogService = mock(DialogService.class); String filename1 = "file.txt"; String filename2 = "file (1).txt"; @@ -75,28 +75,28 @@ public void testIsDuplicatedFileWithOneSimilarNames() throws IOException { } @Test - public void testTaseDuplicateMarksReturnsOrignalFileName1() throws IOException { + public void taseDuplicateMarksReturnsOrignalFileName1() throws IOException { String fileName1 = "abc def (1)"; String fileName2 = FileNameUniqueness.eraseDuplicateMarks(fileName1); assertEquals("abc def", fileName2); } @Test - public void testTaseDuplicateMarksReturnsOrignalFileName2() throws IOException { + public void taseDuplicateMarksReturnsOrignalFileName2() throws IOException { String fileName1 = "abc (def) gh (1)"; String fileName2 = FileNameUniqueness.eraseDuplicateMarks(fileName1); assertEquals("abc (def) gh", fileName2); } @Test - public void testTaseDuplicateMarksReturnsSameName1() throws IOException { + public void taseDuplicateMarksReturnsSameName1() throws IOException { String fileName1 = "abc def (g)"; String fileName2 = FileNameUniqueness.eraseDuplicateMarks(fileName1); assertEquals("abc def (g)", fileName2); } @Test - public void testTaseDuplicateMarksReturnsSameName2() throws IOException { + public void taseDuplicateMarksReturnsSameName2() throws IOException { String fileName1 = "abc def"; String fileName2 = FileNameUniqueness.eraseDuplicateMarks(fileName1); assertEquals("abc def", fileName2); diff --git a/src/test/java/org/jabref/logic/util/io/FileUtilTest.java b/src/test/java/org/jabref/logic/util/io/FileUtilTest.java index b5bf3b8d5b4..99551587f2a 100644 --- a/src/test/java/org/jabref/logic/util/io/FileUtilTest.java +++ b/src/test/java/org/jabref/logic/util/io/FileUtilTest.java @@ -61,7 +61,7 @@ void extensionBakAddedCorrectlyToAFileContainedInTmpDirectory() { } @Test - void testGetLinkedFileNameDefaultFullTitle() { + void getLinkedFileNameDefaultFullTitle() { String fileNamePattern = "[citationkey] - [fulltitle]"; BibEntry entry = new BibEntry(); entry.setCitationKey("1234"); @@ -72,7 +72,7 @@ void testGetLinkedFileNameDefaultFullTitle() { } @Test - void testGetLinkedFileNameDefaultWithLowercaseTitle() { + void getLinkedFileNameDefaultWithLowercaseTitle() { String fileNamePattern = "[citationkey] - [title:lower]"; BibEntry entry = new BibEntry(); entry.setCitationKey("1234"); @@ -83,7 +83,7 @@ void testGetLinkedFileNameDefaultWithLowercaseTitle() { } @Test - void testGetLinkedFileNameBibTeXKey() { + void getLinkedFileNameBibTeXKey() { String fileNamePattern = "[citationkey]"; BibEntry entry = new BibEntry(); entry.setCitationKey("1234"); @@ -94,7 +94,7 @@ void testGetLinkedFileNameBibTeXKey() { } @Test - void testGetLinkedFileNameNoPattern() { + void getLinkedFileNameNoPattern() { String fileNamePattern = ""; BibEntry entry = new BibEntry(); entry.setCitationKey("1234"); @@ -104,7 +104,7 @@ void testGetLinkedFileNameNoPattern() { } @Test - void testGetDefaultFileNameNoPatternNoBibTeXKey() { + void getDefaultFileNameNoPatternNoBibTeXKey() { String fileNamePattern = ""; BibEntry entry = new BibEntry(); entry.setField(StandardField.TITLE, "mytitle"); @@ -113,7 +113,7 @@ void testGetDefaultFileNameNoPatternNoBibTeXKey() { } @Test - void testGetLinkedFileNameGetKeyIfEmptyField() { + void getLinkedFileNameGetKeyIfEmptyField() { String fileNamePattern = "[title]"; BibEntry entry = new BibEntry(); entry.setCitationKey("1234"); @@ -122,7 +122,7 @@ void testGetLinkedFileNameGetKeyIfEmptyField() { } @Test - void testGetLinkedFileNameGetDefaultIfEmptyFieldNoKey() { + void getLinkedFileNameGetDefaultIfEmptyFieldNoKey() { String fileNamePattern = "[title]"; BibEntry entry = new BibEntry(); @@ -130,7 +130,7 @@ void testGetLinkedFileNameGetDefaultIfEmptyFieldNoKey() { } @Test - void testGetLinkedFileNameByYearAuthorFirstpage() { + void getLinkedFileNameByYearAuthorFirstpage() { String fileNamePattern = "[year]_[auth]_[firstpage]"; BibEntry entry = new BibEntry(); entry.setField(StandardField.AUTHOR, "O. Kitsune"); @@ -141,22 +141,22 @@ void testGetLinkedFileNameByYearAuthorFirstpage() { } @Test - void testGetFileExtensionSimpleFile() { + void getFileExtensionSimpleFile() { assertEquals("pdf", FileUtil.getFileExtension(Path.of("test.pdf")).get()); } @Test - void testGetFileExtensionMultipleDotsFile() { + void getFileExtensionMultipleDotsFile() { assertEquals("pdf", FileUtil.getFileExtension(Path.of("te.st.PdF")).get()); } @Test - void testGetFileExtensionNoExtensionFile() { + void getFileExtensionNoExtensionFile() { assertFalse(FileUtil.getFileExtension(Path.of("JustTextNotASingleDot")).isPresent()); } @Test - void testGetFileExtensionNoExtension2File() { + void getFileExtensionNoExtension2File() { assertFalse(FileUtil.getFileExtension(Path.of(".StartsWithADotIsNotAnExtension")).isPresent()); } @@ -213,59 +213,59 @@ void uniquePathSubstrings() { } @Test - void testUniquePathFragmentWithSameSuffix() { + void uniquePathFragmentWithSameSuffix() { List dirs = List.of("/users/jabref/bibliography.bib", "/users/jabref/koppor-bibliograsphy.bib"); assertEquals(Optional.of("bibliography.bib"), FileUtil.getUniquePathFragment(dirs, Path.of("/users/jabref/bibliography.bib"))); } @Test - void testUniquePathFragmentWithSameSuffixAndLongerName() { + void uniquePathFragmentWithSameSuffixAndLongerName() { List dirs = List.of("/users/jabref/bibliography.bib", "/users/jabref/koppor-bibliography.bib"); assertEquals(Optional.of("koppor-bibliography.bib"), FileUtil.getUniquePathFragment(dirs, Path.of("/users/jabref/koppor-bibliography.bib"))); } @Test - void testCopyFileFromEmptySourcePathToEmptyDestinationPathWithOverrideExistFile() { + void copyFileFromEmptySourcePathToEmptyDestinationPathWithOverrideExistFile() { assertFalse(FileUtil.copyFile(nonExistingTestPath, nonExistingTestPath, true)); } @Test - void testCopyFileFromEmptySourcePathToEmptyDestinationPathWithoutOverrideExistFile() { + void copyFileFromEmptySourcePathToEmptyDestinationPathWithoutOverrideExistFile() { assertFalse(FileUtil.copyFile(nonExistingTestPath, nonExistingTestPath, false)); } @Test - void testCopyFileFromEmptySourcePathToExistDestinationPathWithOverrideExistFile() { + void copyFileFromEmptySourcePathToExistDestinationPathWithOverrideExistFile() { assertFalse(FileUtil.copyFile(nonExistingTestPath, existingTestFile, true)); } @Test - void testCopyFileFromEmptySourcePathToExistDestinationPathWithoutOverrideExistFile() { + void copyFileFromEmptySourcePathToExistDestinationPathWithoutOverrideExistFile() { assertFalse(FileUtil.copyFile(nonExistingTestPath, existingTestFile, false)); } @Test - void testCopyFileFromExistSourcePathToExistDestinationPathWithOverrideExistFile() { + void copyFileFromExistSourcePathToExistDestinationPathWithOverrideExistFile() { assertTrue(FileUtil.copyFile(existingTestFile, existingTestFile, true)); } @Test - void testCopyFileFromExistSourcePathToExistDestinationPathWithoutOverrideExistFile() { + void copyFileFromExistSourcePathToExistDestinationPathWithoutOverrideExistFile() { assertFalse(FileUtil.copyFile(existingTestFile, existingTestFile, false)); } @Test - void testCopyFileFromExistSourcePathToOtherExistDestinationPathWithOverrideExistFile() { + void copyFileFromExistSourcePathToOtherExistDestinationPathWithOverrideExistFile() { assertTrue(FileUtil.copyFile(existingTestFile, otherExistingTestFile, true)); } @Test - void testCopyFileFromExistSourcePathToOtherExistDestinationPathWithoutOverrideExistFile() { + void copyFileFromExistSourcePathToOtherExistDestinationPathWithoutOverrideExistFile() { assertFalse(FileUtil.copyFile(existingTestFile, otherExistingTestFile, false)); } @Test - void testCopyFileSuccessfulWithOverrideExistFile() throws IOException { + void copyFileSuccessfulWithOverrideExistFile() throws IOException { Path subDir = rootDir.resolve("2"); Files.createDirectory(subDir); Path temp = subDir.resolve("existingTestFile.txt"); @@ -275,7 +275,7 @@ void testCopyFileSuccessfulWithOverrideExistFile() throws IOException { } @Test - void testCopyFileSuccessfulWithoutOverrideExistFile() throws IOException { + void copyFileSuccessfulWithoutOverrideExistFile() throws IOException { Path subDir = rootDir.resolve("2"); Files.createDirectory(subDir); Path temp = subDir.resolve("existingTestFile.txt"); @@ -309,7 +309,7 @@ void invalidFilenameWithoutExtension() { } @Test - void testGetLinkedDirNameDefaultFullTitle() { + void getLinkedDirNameDefaultFullTitle() { String fileDirPattern = "PDF/[year]/[auth]/[citationkey] - [fulltitle]"; BibEntry entry = new BibEntry(); entry.setCitationKey("1234"); @@ -321,7 +321,7 @@ void testGetLinkedDirNameDefaultFullTitle() { } @Test - void testGetLinkedDirNamePatternEmpty() { + void getLinkedDirNamePatternEmpty() { BibEntry entry = new BibEntry(); entry.setCitationKey("1234"); entry.setField(StandardField.TITLE, "mytitle"); @@ -332,26 +332,26 @@ void testGetLinkedDirNamePatternEmpty() { } @Test - void testIsBibFile() throws IOException { + void isBibFile() throws IOException { Path bibFile = Files.createFile(rootDir.resolve("test.bib")); assertTrue(FileUtil.isBibFile(bibFile)); } @Test - void testIsNotBibFile() throws IOException { + void isNotBibFile() throws IOException { Path bibFile = Files.createFile(rootDir.resolve("test.pdf")); assertFalse(FileUtil.isBibFile(bibFile)); } @Test - void testFindinPath() { + void findinPath() { Optional resultPath1 = FileUtil.findSingleFileRecursively("existingTestFile.txt", rootDir); assertEquals(resultPath1.get().toString(), existingTestFile.toString()); } @Test - void testFindInListOfPath() { + void findInListOfPath() { // due to the added workaround for old JabRef behavior as both path starts with the same name they are considered equal List paths = List.of(existingTestFile, otherExistingTestFile, rootDir); List resultPaths = List.of(existingTestFile); @@ -372,20 +372,20 @@ public void fileExtensionFromUrl() { } @Test - public void testFileNameEmpty() { + public void fileNameEmpty() { Path path = Path.of("/"); assertEquals(Optional.of(path), FileUtil.find("", path)); } @ParameterizedTest @ValueSource(strings = {"*", "?", ">", "\""}) - public void testFileNameIllegal(String fileName) { + public void fileNameIllegal(String fileName) { Path path = Path.of("/"); assertEquals(Optional.empty(), FileUtil.find(fileName, path)); } @Test - public void testFindsFileInDirectory(@TempDir Path temp) throws Exception { + public void findsFileInDirectory(@TempDir Path temp) throws Exception { Path firstFilePath = temp.resolve("files"); Files.createDirectories(firstFilePath); Path firstFile = Files.createFile(firstFilePath.resolve("test.pdf")); @@ -394,7 +394,7 @@ public void testFindsFileInDirectory(@TempDir Path temp) throws Exception { } @Test - public void testFindsFileStartingWithTheSameDirectory(@TempDir Path temp) throws Exception { + public void findsFileStartingWithTheSameDirectory(@TempDir Path temp) throws Exception { Path firstFilePath = temp.resolve("files"); Files.createDirectories(firstFilePath); Path firstFile = Files.createFile(firstFilePath.resolve("test.pdf")); @@ -403,7 +403,7 @@ public void testFindsFileStartingWithTheSameDirectory(@TempDir Path temp) throws } @Test - public void testDoesNotFindsFileStartingWithTheSameDirectoryHasASubdirectory(@TempDir Path temp) throws Exception { + public void doesNotFindsFileStartingWithTheSameDirectoryHasASubdirectory(@TempDir Path temp) throws Exception { Path firstFilesPath = temp.resolve("files"); Path secondFilesPath = firstFilesPath.resolve("files"); Files.createDirectories(secondFilesPath); diff --git a/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTest.java b/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTest.java index 49faa6e3f4f..e6da7216596 100644 --- a/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTest.java +++ b/src/test/java/org/jabref/logic/util/io/RegExpBasedFileFinderTest.java @@ -56,7 +56,7 @@ void setUp(@TempDir Path tempDir) throws Exception { } @Test - void testFindFiles() throws Exception { + void findFiles() throws Exception { // given BibEntry localEntry = new BibEntry(StandardEntryType.Article).withCitationKey("pdfInDatabase"); @@ -71,7 +71,7 @@ void testFindFiles() throws Exception { } @Test - void testYearAuthFirstPageFindFiles() throws Exception { + void yearAuthFirstPageFindFiles() throws Exception { // given RegExpBasedFileFinder fileFinder = new RegExpBasedFileFinder("**/[year]_[auth]_[firstpage].*\\\\.[extension]", ','); @@ -124,7 +124,7 @@ void findAssociatedFilesFindFileContainingParenthesizesFromBracketedExpression() } @Test - void testAuthorWithDiacritics() throws Exception { + void authorWithDiacritics() throws Exception { // given BibEntry localEntry = new BibEntry(StandardEntryType.Article).withCitationKey("Grazulis2017"); localEntry.setField(StandardField.YEAR, "2017"); @@ -142,7 +142,7 @@ void testAuthorWithDiacritics() throws Exception { } @Test - void testFindFileInSubdirectory() throws Exception { + void findFileInSubdirectory() throws Exception { // given BibEntry localEntry = new BibEntry(StandardEntryType.Article); localEntry.setCitationKey("pdfInSubdirectory"); @@ -159,7 +159,7 @@ void testFindFileInSubdirectory() throws Exception { } @Test - void testFindFileNonRecursive() throws Exception { + void findFileNonRecursive() throws Exception { // given BibEntry localEntry = new BibEntry(StandardEntryType.Article); localEntry.setCitationKey("pdfInSubdirectory"); diff --git a/src/test/java/org/jabref/logic/util/strings/StringManipulatorTest.java b/src/test/java/org/jabref/logic/util/strings/StringManipulatorTest.java index fce0126c0b7..c8a749bc149 100644 --- a/src/test/java/org/jabref/logic/util/strings/StringManipulatorTest.java +++ b/src/test/java/org/jabref/logic/util/strings/StringManipulatorTest.java @@ -14,7 +14,7 @@ public class StringManipulatorTest { @Test - public void testCapitalizePreservesNewlines() { + public void capitalizePreservesNewlines() { int caretPosition = 5; // Position of the caret, between the two ll in the first hellO" String input = "hello\n\nhELLO"; String expectedResult = "hello\n\nHello"; @@ -23,7 +23,7 @@ public void testCapitalizePreservesNewlines() { } @Test - public void testUppercasePreservesSpace() { + public void uppercasePreservesSpace() { int caretPosition = 3; // Position of the caret, between the two ll in the first hello String input = "hello hello"; String expectedResult = "helLO hello"; @@ -32,7 +32,7 @@ public void testUppercasePreservesSpace() { } @Test - public void testUppercasePreservesNewlines() { + public void uppercasePreservesNewlines() { int caretPosition = 3; // Position of the caret, between the two ll in the first hello String input = "hello\nhello"; String expectedResult = "helLO\nhello"; @@ -41,7 +41,7 @@ public void testUppercasePreservesNewlines() { } @Test - public void testUppercasePreservesTab() { + public void uppercasePreservesTab() { int caretPosition = 3; // Position of the caret, between the two ll in the first hello String input = "hello\thello"; String expectedResult = "helLO\thello"; @@ -50,7 +50,7 @@ public void testUppercasePreservesTab() { } @Test - public void testUppercasePreservesDoubleSpace() { + public void uppercasePreservesDoubleSpace() { int caretPosition = 5; // Position of the caret, at the first space String input = "hello hello"; String expectedResult = "hello HELLO"; @@ -59,7 +59,7 @@ public void testUppercasePreservesDoubleSpace() { } @Test - public void testUppercaseIgnoresTrailingWhitespace() { + public void uppercaseIgnoresTrailingWhitespace() { int caretPosition = 5; // First space String input = "hello "; String expectedResult = "hello "; @@ -70,7 +70,7 @@ public void testUppercaseIgnoresTrailingWhitespace() { } @Test - public void testKillWordTrimsTrailingWhitespace() { + public void killWordTrimsTrailingWhitespace() { int caretPosition = 5; // First space String input = "hello "; String expectedResult = "hello"; @@ -80,7 +80,7 @@ public void testKillWordTrimsTrailingWhitespace() { } @Test - public void testBackwardsKillWordTrimsPreceedingWhitespace() { + public void backwardsKillWordTrimsPreceedingWhitespace() { int caretPosition = 1; // Second space String input = " hello"; // One space should be preserved since we are deleting everything preceding the second space. @@ -92,7 +92,7 @@ public void testBackwardsKillWordTrimsPreceedingWhitespace() { } @Test - public void testUppercasePreservesMixedSpaceNewLineTab() { + public void uppercasePreservesMixedSpaceNewLineTab() { int caretPosition = 5; // Position of the caret, after first hello String input = "hello \n\thello"; String expectedResult = "hello \n\tHELLO"; @@ -101,7 +101,7 @@ public void testUppercasePreservesMixedSpaceNewLineTab() { } @Test - public void testLowercaseEditsTheNextWord() { + public void lowercaseEditsTheNextWord() { int caretPosition = 5; // Position of the caret, right at the space String input = "hello HELLO"; String expectedResult = "hello hello"; @@ -110,7 +110,7 @@ public void testLowercaseEditsTheNextWord() { } @Test - public void testKillWordRemovesFromPositionUpToNextWord() { + public void killWordRemovesFromPositionUpToNextWord() { int caretPosition = 3; // Position of the caret, between the two "ll in the first hello" String input = "hello hello"; String expectedResult = "hel hello"; @@ -119,7 +119,7 @@ public void testKillWordRemovesFromPositionUpToNextWord() { } @Test - public void testKillWordRemovesNextWordIfPositionIsInSpace() { + public void killWordRemovesNextWordIfPositionIsInSpace() { int caretPosition = 5; // Position of the caret, after the first hello" String input = "hello person"; String expectedResult = "hello"; @@ -128,7 +128,7 @@ public void testKillWordRemovesNextWordIfPositionIsInSpace() { } @Test - public void testKillPreviousWord() { + public void killPreviousWord() { int caretPosition = 8; int expectedPosition = 6; String input = "hello person"; @@ -140,7 +140,7 @@ public void testKillPreviousWord() { @ParameterizedTest @MethodSource("wordBoundaryTestData") - void testGetNextWordBoundary(String text, int caretPosition, int expectedPosition, StringManipulator.Direction direction) { + void getNextWordBoundary(String text, int caretPosition, int expectedPosition, StringManipulator.Direction direction) { int result = StringManipulator.getNextWordBoundary(caretPosition, text, direction); assertEquals(expectedPosition, result); } diff --git a/src/test/java/org/jabref/logic/util/strings/StringSimilarityTest.java b/src/test/java/org/jabref/logic/util/strings/StringSimilarityTest.java index 908727784a5..808f197bfa4 100644 --- a/src/test/java/org/jabref/logic/util/strings/StringSimilarityTest.java +++ b/src/test/java/org/jabref/logic/util/strings/StringSimilarityTest.java @@ -24,7 +24,7 @@ public class StringSimilarityTest { "abcdef, ab, true", // no empty strings and similarity == threshold (4) "abcdef, a, false" // no empty string sand similarity > threshold (4) }) - public void testStringSimilarity(String a, String b, String expectedResult) { + public void stringSimilarity(String a, String b, String expectedResult) { assertEquals(Boolean.valueOf(expectedResult), similarityChecker.isSimilar(a, b)); } } diff --git a/src/test/java/org/jabref/logic/xmp/XmpUtilReaderTest.java b/src/test/java/org/jabref/logic/xmp/XmpUtilReaderTest.java index 3aef7de70ee..31264b9ff77 100644 --- a/src/test/java/org/jabref/logic/xmp/XmpUtilReaderTest.java +++ b/src/test/java/org/jabref/logic/xmp/XmpUtilReaderTest.java @@ -49,7 +49,7 @@ void setUp() { * Tests reading of dublinCore metadata. */ @Test - void testReadArticleDublinCoreReadRawXmp() throws IOException, URISyntaxException { + void readArticleDublinCoreReadRawXmp() throws IOException, URISyntaxException { Path path = Path.of(XmpUtilShared.class.getResource("article_dublinCore_without_day.pdf").toURI()); List meta = xmpUtilReader.readRawXmp(path); @@ -67,7 +67,7 @@ void testReadArticleDublinCoreReadRawXmp() throws IOException, URISyntaxExceptio * Tests reading of dublinCore metadata. */ @Test - void testReadArticleDublinCoreReadXmp() throws IOException, URISyntaxException { + void readArticleDublinCoreReadXmp() throws IOException, URISyntaxException { Path pathPdf = Path.of(XmpUtilShared.class.getResource("article_dublinCore.pdf").toURI()); List entries = xmpUtilReader.readXmp(pathPdf, xmpPreferences); Path bibFile = Path.of(XmpUtilShared.class.getResource("article_dublinCore.bib").toURI()); @@ -82,7 +82,7 @@ void testReadArticleDublinCoreReadXmp() throws IOException, URISyntaxException { } @Test - void testReadArticleDublinCoreReadXmpPartialDate() throws IOException, URISyntaxException { + void readArticleDublinCoreReadXmpPartialDate() throws IOException, URISyntaxException { Path pathPdf = Path.of(XmpUtilShared.class.getResource("article_dublinCore_partial_date.pdf").toURI()); List entries = xmpUtilReader.readXmp(pathPdf, xmpPreferences); Path bibFile = Path.of(XmpUtilShared.class.getResource("article_dublinCore_partial_date.bib").toURI()); @@ -99,7 +99,7 @@ void testReadArticleDublinCoreReadXmpPartialDate() throws IOException, URISyntax * Tests an pdf file with an empty metadata section. */ @Test - void testReadEmtpyMetadata() throws IOException, URISyntaxException { + void readEmtpyMetadata() throws IOException, URISyntaxException { List entries = xmpUtilReader.readXmp(Path.of(XmpUtilShared.class.getResource("empty_metadata.pdf").toURI()), xmpPreferences); assertEquals(Collections.emptyList(), entries); } @@ -108,7 +108,7 @@ void testReadEmtpyMetadata() throws IOException, URISyntaxException { * Test non XMP metadata. Metadata are included in the PDInformation */ @Test - void testReadPDMetadata() throws IOException, URISyntaxException { + void readPDMetadata() throws IOException, URISyntaxException { Path pathPdf = Path.of(XmpUtilShared.class.getResource("PD_metadata.pdf").toURI()); List entries = xmpUtilReader.readXmp(pathPdf, xmpPreferences); @@ -126,7 +126,7 @@ void testReadPDMetadata() throws IOException, URISyntaxException { * Tests an pdf file with metadata which has no description section. */ @Test - void testReadNoDescriptionMetadata() throws IOException, URISyntaxException { + void readNoDescriptionMetadata() throws IOException, URISyntaxException { List entries = xmpUtilReader.readXmp(Path.of(XmpUtilShared.class.getResource("no_description_metadata.pdf").toURI()), xmpPreferences); assertEquals(Collections.emptyList(), entries); } diff --git a/src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java b/src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java index 113582d0ec4..ef68c48c59c 100644 --- a/src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java +++ b/src/test/java/org/jabref/logic/xmp/XmpUtilWriterTest.java @@ -117,7 +117,7 @@ void vapnik2000Works() throws Exception { } @Test - void testWriteTwoBibEntries(@TempDir Path tempDir) throws Exception { + void writeTwoBibEntries(@TempDir Path tempDir) throws Exception { Path pdfFile = this.createDefaultFile("JabRef_writeTwo.pdf", tempDir); List entries = List.of(olly2018, toral2006); new XmpUtilWriter(xmpPreferences).writeXmp(pdfFile.toAbsolutePath(), entries, null); @@ -132,7 +132,7 @@ void testWriteTwoBibEntries(@TempDir Path tempDir) throws Exception { } @Test - void testWriteThreeBibEntries(@TempDir Path tempDir) throws Exception { + void writeThreeBibEntries(@TempDir Path tempDir) throws Exception { Path pdfFile = this.createDefaultFile("JabRef_writeThree.pdf", tempDir); List entries = List.of(olly2018, vapnik2000, toral2006); new XmpUtilWriter(xmpPreferences).writeXmp(pdfFile.toAbsolutePath(), entries, null); diff --git a/src/test/java/org/jabref/migrations/PreferencesMigrationsTest.java b/src/test/java/org/jabref/migrations/PreferencesMigrationsTest.java index 7146764d8c1..0a89c471788 100644 --- a/src/test/java/org/jabref/migrations/PreferencesMigrationsTest.java +++ b/src/test/java/org/jabref/migrations/PreferencesMigrationsTest.java @@ -38,7 +38,7 @@ void setUp() { } @Test - void testOldStyleBibtexkeyPattern0() { + void oldStyleBibtexkeyPattern0() { when(prefs.get(JabRefPreferences.IMPORT_FILENAMEPATTERN)).thenReturn(oldStylePatterns[0]); when(mainPrefsNode.get(JabRefPreferences.IMPORT_FILENAMEPATTERN, null)).thenReturn(oldStylePatterns[0]); when(prefs.hasKey(JabRefPreferences.IMPORT_FILENAMEPATTERN)).thenReturn(true); @@ -50,7 +50,7 @@ void testOldStyleBibtexkeyPattern0() { } @Test - void testOldStyleBibtexkeyPattern1() { + void oldStyleBibtexkeyPattern1() { when(prefs.get(JabRefPreferences.IMPORT_FILENAMEPATTERN)).thenReturn(oldStylePatterns[1]); when(mainPrefsNode.get(JabRefPreferences.IMPORT_FILENAMEPATTERN, null)).thenReturn(oldStylePatterns[1]); when(prefs.hasKey(JabRefPreferences.IMPORT_FILENAMEPATTERN)).thenReturn(true); @@ -62,7 +62,7 @@ void testOldStyleBibtexkeyPattern1() { } @Test - void testArbitraryBibtexkeyPattern() { + void arbitraryBibtexkeyPattern() { String arbitraryPattern = "[anyUserPrividedString]"; when(prefs.get(JabRefPreferences.IMPORT_FILENAMEPATTERN)).thenReturn(arbitraryPattern); @@ -75,7 +75,7 @@ void testArbitraryBibtexkeyPattern() { } @Test - void testPreviewStyleReviewToComment() { + void previewStyleReviewToComment() { String oldPreviewStyle = "__NEWLINE__" + "Customized preview style using reviews and comments:__NEWLINE__" + "\\begin{review}

Review: \\format[HTMLChars]{\\review} \\end{review}__NEWLINE__" @@ -96,7 +96,7 @@ void testPreviewStyleReviewToComment() { } @Test - void testUpgradeColumnPreferencesAlreadyMigrated() { + void upgradeColumnPreferencesAlreadyMigrated() { List columnNames = Arrays.asList("entrytype", "author/editor", "title", "year", "journal/booktitle", "citationkey", "printed"); List columnWidths = Arrays.asList("75", "300", "470", "60", "130", "100", "30"); @@ -110,7 +110,7 @@ void testUpgradeColumnPreferencesAlreadyMigrated() { } @Test - void testUpgradeColumnPreferencesFromWithoutTypes() { + void upgradeColumnPreferencesFromWithoutTypes() { List columnNames = Arrays.asList("entrytype", "author/editor", "title", "year", "journal/booktitle", "citationkey", "printed"); List columnWidths = Arrays.asList("75", "300", "470", "60", "130", "100", "30"); List updatedNames = Arrays.asList("groups", "files", "linked_id", "field:entrytype", "field:author/editor", "field:title", "field:year", "field:journal/booktitle", "field:citationkey", "special:printed"); @@ -128,7 +128,7 @@ void testUpgradeColumnPreferencesFromWithoutTypes() { } @Test - void testChangeColumnPreferencesVariableNamesFor51() { + void changeColumnPreferencesVariableNamesFor51() { List columnNames = Arrays.asList("entrytype", "author/editor", "title", "year", "journal/booktitle", "citationkey", "printed"); List columnWidths = Arrays.asList("75", "300", "470", "60", "130", "100", "30"); @@ -152,7 +152,7 @@ void testChangeColumnPreferencesVariableNamesFor51() { } @Test - void testChangeColumnPreferencesVariableNamesBackwardsCompatibility() { + void changeColumnPreferencesVariableNamesBackwardsCompatibility() { List columnNames = Arrays.asList("entrytype", "author/editor", "title", "year", "journal/booktitle", "citationkey", "printed"); List columnWidths = Arrays.asList("75", "300", "470", "60", "130", "100", "30"); @@ -176,7 +176,7 @@ void testChangeColumnPreferencesVariableNamesBackwardsCompatibility() { } @Test - void testRestoreColumnVariablesForBackwardCompatibility() { + void restoreColumnVariablesForBackwardCompatibility() { List updatedNames = Arrays.asList("groups", "files", "linked_id", "field:entrytype", "field:author/editor", "field:title", "field:year", "field:journal/booktitle", "field:citationkey", "special:printed"); List columnNames = Arrays.asList("entrytype", "author/editor", "title", "year", "journal/booktitle", "citationkey", "printed"); List columnWidths = Arrays.asList("100", "100", "100", "100", "100", "100", "100"); @@ -196,7 +196,7 @@ void testRestoreColumnVariablesForBackwardCompatibility() { } @Test - void testMoveApiKeysToKeyRing() throws Exception { + void moveApiKeysToKeyRing() throws Exception { final String V5_9_FETCHER_CUSTOM_KEY_NAMES = "fetcherCustomKeyNames"; final String V5_9_FETCHER_CUSTOM_KEYS = "fetcherCustomKeys"; final Keyring keyring = mock(Keyring.class); diff --git a/src/test/java/org/jabref/model/database/BibDatabaseContextTest.java b/src/test/java/org/jabref/model/database/BibDatabaseContextTest.java index dfb069680d0..26777d80519 100644 --- a/src/test/java/org/jabref/model/database/BibDatabaseContextTest.java +++ b/src/test/java/org/jabref/model/database/BibDatabaseContextTest.java @@ -106,7 +106,7 @@ void getUserFileDirectoryIfAllAreEmpty() { } @Test - void testTypeBasedOnDefaultBiblatex() { + void typeBasedOnDefaultBiblatex() { BibDatabaseContext bibDatabaseContext = new BibDatabaseContext(new BibDatabase(), new MetaData()); assertEquals(BibDatabaseMode.BIBLATEX, bibDatabaseContext.getMode()); @@ -115,7 +115,7 @@ void testTypeBasedOnDefaultBiblatex() { } @Test - void testTypeBasedOnDefaultBibtex() { + void typeBasedOnDefaultBibtex() { BibDatabaseContext bibDatabaseContext = new BibDatabaseContext(new BibDatabase(), new MetaData()); assertEquals(BibDatabaseMode.BIBLATEX, bibDatabaseContext.getMode()); @@ -124,7 +124,7 @@ void testTypeBasedOnDefaultBibtex() { } @Test - void testTypeBasedOnInferredModeBiblatex() { + void typeBasedOnInferredModeBiblatex() { BibDatabase db = new BibDatabase(); BibEntry e1 = new BibEntry(IEEETranEntryType.Electronic); db.insertEntry(e1); @@ -134,7 +134,7 @@ void testTypeBasedOnInferredModeBiblatex() { } @Test - void testGetFullTextIndexPathWhenPathIsNull() { + void getFullTextIndexPathWhenPathIsNull() { BibDatabaseContext bibDatabaseContext = new BibDatabaseContext(); bibDatabaseContext.setDatabasePath(null); @@ -145,7 +145,7 @@ void testGetFullTextIndexPathWhenPathIsNull() { } @Test - void testGetFullTextIndexPathWhenPathIsNotNull() { + void getFullTextIndexPathWhenPathIsNotNull() { Path existingPath = Path.of("some_path.bib"); BibDatabaseContext bibDatabaseContext = new BibDatabaseContext(); diff --git a/src/test/java/org/jabref/model/database/KeyChangeListenerTest.java b/src/test/java/org/jabref/model/database/KeyChangeListenerTest.java index a0cdc5b65e7..1cbe8aaaf9c 100644 --- a/src/test/java/org/jabref/model/database/KeyChangeListenerTest.java +++ b/src/test/java/org/jabref/model/database/KeyChangeListenerTest.java @@ -46,46 +46,46 @@ public void setUp() { } @Test - public void testCrossrefChanged() { + public void crossrefChanged() { assertEquals(Optional.of("Entry4"), entry1.getField(StandardField.CROSSREF)); entry4.setCitationKey("Banana"); assertEquals(Optional.of("Banana"), entry1.getField(StandardField.CROSSREF)); } @Test - public void testRelatedChanged() { + public void relatedChanged() { assertEquals(Optional.of("Entry1,Entry3"), entry2.getField(StandardField.RELATED)); entry1.setCitationKey("Banana"); assertEquals(Optional.of("Banana,Entry3"), entry2.getField(StandardField.RELATED)); } @Test - public void testRelatedChangedInSameEntry() { + public void relatedChangedInSameEntry() { assertEquals(Optional.of("Entry1,Entry2,Entry3"), entry3.getField(StandardField.RELATED)); entry3.setCitationKey("Banana"); assertEquals(Optional.of("Entry1,Entry2,Banana"), entry3.getField(StandardField.RELATED)); } @Test - public void testCrossrefRemoved() { + public void crossrefRemoved() { entry4.clearField(InternalField.KEY_FIELD); assertEquals(Optional.empty(), entry1.getField(StandardField.CROSSREF)); } @Test - public void testCrossrefEntryRemoved() { + public void crossrefEntryRemoved() { db.removeEntry(entry4); assertEquals(Optional.empty(), entry1.getField(StandardField.CROSSREF)); } @Test - public void testRelatedEntryRemoved() { + public void relatedEntryRemoved() { db.removeEntry(entry1); assertEquals(Optional.of("Entry3"), entry2.getField(StandardField.RELATED)); } @Test - public void testRelatedAllEntriesRemoved() { + public void relatedAllEntriesRemoved() { List entries = Arrays.asList(entry1, entry3); db.removeEntries(entries); assertEquals(Optional.empty(), entry2.getField(StandardField.RELATED)); diff --git a/src/test/java/org/jabref/model/entry/AuthorListTest.java b/src/test/java/org/jabref/model/entry/AuthorListTest.java index 152bd3d80a8..11fd5a8e35f 100644 --- a/src/test/java/org/jabref/model/entry/AuthorListTest.java +++ b/src/test/java/org/jabref/model/entry/AuthorListTest.java @@ -43,7 +43,7 @@ public static int size(String bibtex) { } @Test - public void testFixAuthorNatbib() { + public void fixAuthorNatbib() { assertEquals("", AuthorList.fixAuthorNatbib("")); assertEquals("Smith", AuthorList.fixAuthorNatbib("John Smith")); assertEquals("Smith and Black Brown", AuthorList @@ -116,7 +116,7 @@ public void parseCachesOneLatexFreeAuthor() { } @Test - public void testFixAuthorFirstNameFirstCommas() { + public void fixAuthorFirstNameFirstCommas() { // No Commas assertEquals("", AuthorList.fixAuthorFirstNameFirstCommas("", true, false)); assertEquals("", AuthorList.fixAuthorFirstNameFirstCommas("", false, false)); @@ -285,7 +285,7 @@ public void getAsFirstLastNamesLatexFreeOneInstitutionWithParanthesisAtStart() { } @Test - public void testFixAuthorFirstNameFirst() { + public void fixAuthorFirstNameFirst() { assertEquals("John Smith", AuthorList.fixAuthorFirstNameFirst("John Smith")); assertEquals("John Smith and Peter Black Brown", AuthorList @@ -304,7 +304,7 @@ public void testFixAuthorFirstNameFirst() { } @Test - public void testFixAuthorLastNameFirstCommasNoComma() { + public void fixAuthorLastNameFirstCommasNoComma() { // No commas before and assertEquals("", AuthorList.fixAuthorLastNameFirstCommas("", true, false)); assertEquals("", AuthorList.fixAuthorLastNameFirstCommas("", false, false)); @@ -335,7 +335,7 @@ public void testFixAuthorLastNameFirstCommasNoComma() { } @Test - public void testFixAuthorLastNameFirstCommasOxfordComma() { + public void fixAuthorLastNameFirstCommasOxfordComma() { // Oxford Commas assertEquals("", AuthorList.fixAuthorLastNameFirstCommas("", true, true)); assertEquals("", AuthorList.fixAuthorLastNameFirstCommas("", false, true)); @@ -558,7 +558,7 @@ public void getAsLastFirstNamesLatexFreeOneInstitutionWithParanthesisAtStartOxfo } @Test - public void testFixAuthorLastNameFirst() { + public void fixAuthorLastNameFirst() { // Test helper method assertEquals("Smith, John", AuthorList.fixAuthorLastNameFirst("John Smith")); @@ -612,7 +612,7 @@ public void testFixAuthorLastNameFirst() { } @Test - public void testFixAuthorLastNameOnlyCommas() { + public void fixAuthorLastNameOnlyCommas() { // No comma before and assertEquals("", AuthorList.fixAuthorLastNameOnlyCommas("", false)); assertEquals("Smith", AuthorList.fixAuthorLastNameOnlyCommas("John Smith", false)); @@ -688,7 +688,7 @@ public void getAsLastNamesLatexFreeOneInstitutionWithParanthesisAtStart() { } @Test - public void testFixAuthorForAlphabetization() { + public void fixAuthorForAlphabetization() { assertEquals("Smith, J.", AuthorList.fixAuthorForAlphabetization("John Smith")); assertEquals("Neumann, J.", AuthorList.fixAuthorForAlphabetization("John von Neumann")); assertEquals("Neumann, J.", AuthorList.fixAuthorForAlphabetization("J. von Neumann")); @@ -699,7 +699,7 @@ public void testFixAuthorForAlphabetization() { } @Test - public void testSize() { + public void size() { assertEquals(0, AuthorListTest.size("")); assertEquals(1, AuthorListTest.size("Bar")); assertEquals(1, AuthorListTest.size("Foo Bar")); @@ -721,18 +721,18 @@ public void testSize() { } @Test - public void testIsEmpty() { + public void isEmpty() { assertTrue(AuthorList.parse("").isEmpty()); assertFalse(AuthorList.parse("Bar").isEmpty()); } @Test - public void testGetEmptyAuthor() { + public void getEmptyAuthor() { assertThrows(Exception.class, () -> AuthorList.parse("").getAuthor(0)); } @Test - public void testGetAuthor() { + public void getAuthor() { Author author = AuthorList.parse("John Smith and von Neumann, Jr, John").getAuthor(0); assertEquals(Optional.of("John"), author.getFirst()); assertEquals(Optional.of("J."), author.getFirstAbbr()); @@ -769,35 +769,35 @@ public void testGetAuthor() { } @Test - public void testCompanyAuthor() { + public void companyAuthor() { Author author = AuthorList.parse("{JabRef Developers}").getAuthor(0); Author expected = new Author(null, null, null, "JabRef Developers", null); assertEquals(expected, author); } @Test - public void testCompanyAuthorAndPerson() { + public void companyAuthorAndPerson() { Author company = new Author(null, null, null, "JabRef Developers", null); Author person = new Author("Stefan", "S.", null, "Kolb", null); assertEquals(Arrays.asList(company, person), AuthorList.parse("{JabRef Developers} and Stefan Kolb").getAuthors()); } @Test - public void testCompanyAuthorWithLowerCaseWord() { + public void companyAuthorWithLowerCaseWord() { Author author = AuthorList.parse("{JabRef Developers on Fire}").getAuthor(0); Author expected = new Author(null, null, null, "JabRef Developers on Fire", null); assertEquals(expected, author); } @Test - public void testAbbreviationWithRelax() { + public void abbreviationWithRelax() { Author author = AuthorList.parse("{\\relax Ch}ristoph Cholera").getAuthor(0); Author expected = new Author("{\\relax Ch}ristoph", "{\\relax Ch}.", null, "Cholera", null); assertEquals(expected, author); } @Test - public void testGetAuthorsNatbib() { + public void getAuthorsNatbib() { assertEquals("", AuthorList.parse("").getAsNatbib()); assertEquals("Smith", AuthorList.parse("John Smith").getAsNatbib()); assertEquals("Smith and Black Brown", AuthorList.parse( @@ -818,7 +818,7 @@ public void testGetAuthorsNatbib() { } @Test - public void testGetAuthorsLastOnly() { + public void getAuthorsLastOnly() { // No comma before and assertEquals("", AuthorList.parse("").getAsLastNames(false)); assertEquals("Smith", AuthorList.parse("John Smith").getAsLastNames(false)); @@ -841,7 +841,7 @@ public void testGetAuthorsLastOnly() { } @Test - public void testGetAuthorsLastFirstNoComma() { + public void getAuthorsLastFirstNoComma() { // No commas before and AuthorList al; @@ -869,7 +869,7 @@ public void testGetAuthorsLastFirstNoComma() { } @Test - public void testGetAuthorsLastFirstOxfordComma() { + public void getAuthorsLastFirstOxfordComma() { // Oxford comma AuthorList al; @@ -896,7 +896,7 @@ public void testGetAuthorsLastFirstOxfordComma() { } @Test - public void testGetAuthorsLastFirstAnds() { + public void getAuthorsLastFirstAnds() { assertEquals("Smith, John", AuthorList.parse("John Smith").getAsLastFirstNamesWithAnd( false)); assertEquals("Smith, John and Black Brown, Peter", AuthorList.parse( @@ -918,7 +918,7 @@ public void testGetAuthorsLastFirstAnds() { } @Test - public void testGetAuthorsFirstFirst() { + public void getAuthorsFirstFirst() { AuthorList al; al = AuthorList.parse(""); @@ -957,7 +957,7 @@ public void testGetAuthorsFirstFirst() { } @Test - public void testGetAuthorsFirstFirstAnds() { + public void getAuthorsFirstFirstAnds() { assertEquals("John Smith", AuthorList.parse("John Smith") .getAsFirstLastNamesWithAnd()); assertEquals("John Smith and Peter Black Brown", AuthorList.parse( @@ -970,7 +970,7 @@ public void testGetAuthorsFirstFirstAnds() { } @Test - public void testGetAuthorsForAlphabetization() { + public void getAuthorsForAlphabetization() { assertEquals("Smith, J.", AuthorList.parse("John Smith") .getForAlphabetization()); assertEquals("Neumann, J.", AuthorList.parse("John von Neumann") @@ -983,7 +983,7 @@ public void testGetAuthorsForAlphabetization() { } @Test - public void testRemoveStartAndEndBraces() { + public void removeStartAndEndBraces() { assertEquals("{A}bbb{c}", AuthorList.parse("{A}bbb{c}").getAsLastNames(false)); assertEquals("Vall{\\'e}e Poussin", AuthorList.parse("{Vall{\\'e}e Poussin}").getAsLastNames(false)); assertEquals("Poussin", AuthorList.parse("{Vall{\\'e}e} {Poussin}").getAsLastNames(false)); diff --git a/src/test/java/org/jabref/model/entry/BibEntryTest.java b/src/test/java/org/jabref/model/entry/BibEntryTest.java index 63cd6657bc9..25ed76d7633 100644 --- a/src/test/java/org/jabref/model/entry/BibEntryTest.java +++ b/src/test/java/org/jabref/model/entry/BibEntryTest.java @@ -42,7 +42,7 @@ class BibEntryTest { private BibEntry entry = new BibEntry(); @Test - void testDefaultConstructor() { + void defaultConstructor() { assertEquals(StandardEntryType.Misc, entry.getType()); assertNotNull(entry.getId()); assertFalse(entry.getField(StandardField.AUTHOR).isPresent()); @@ -248,7 +248,7 @@ void getFieldOrAliasLatexFreeComplexConversionInAlias() { } @Test - void testGetAndAddToLinkedFileList() { + void getAndAddToLinkedFileList() { List files = entry.getFiles(); files.add(new LinkedFile("", Path.of(""), "")); entry.setFiles(files); @@ -268,14 +268,14 @@ void replaceOfLinkWorks() throws Exception { } @Test - void testGetEmptyKeywords() { + void getEmptyKeywords() { KeywordList actual = entry.getKeywords(','); assertEquals(new KeywordList(), actual); } @Test - void testGetSingleKeywords() { + void getSingleKeywords() { entry.addKeyword("kw", ','); KeywordList actual = entry.getKeywords(','); @@ -407,27 +407,27 @@ void putNullKeywordSeparatorThrowsNPE() { } @Test - void testGetSeparatedKeywordsAreCorrect() { + void getSeparatedKeywordsAreCorrect() { entry.setField(StandardField.KEYWORDS, "Foo, Bar"); assertEquals(new KeywordList("Foo", "Bar"), entry.getKeywords(',')); } @Test - void testAddKeywordIsCorrect() { + void addKeywordIsCorrect() { entry.setField(StandardField.KEYWORDS, "Foo, Bar"); entry.addKeyword("FooBar", ','); assertEquals(new KeywordList("Foo", "Bar", "FooBar"), entry.getKeywords(',')); } @Test - void testAddKeywordHasChanged() { + void addKeywordHasChanged() { entry.setField(StandardField.KEYWORDS, "Foo, Bar"); entry.addKeyword("FooBar", ','); assertTrue(entry.hasChanged()); } @Test - void testAddKeywordTwiceYiedsOnlyOne() { + void addKeywordTwiceYiedsOnlyOne() { entry.setField(StandardField.KEYWORDS, "Foo, Bar"); entry.addKeyword("FooBar", ','); entry.addKeyword("FooBar", ','); @@ -442,21 +442,21 @@ void addKeywordIsCaseSensitive() { } @Test - void testAddKeywordWithDifferentCapitalizationChanges() { + void addKeywordWithDifferentCapitalizationChanges() { entry.setField(StandardField.KEYWORDS, "Foo, Bar"); entry.addKeyword("FOO", ','); assertTrue(entry.hasChanged()); } @Test - void testAddKeywordEmptyKeywordIsNotAdded() { + void addKeywordEmptyKeywordIsNotAdded() { entry.setField(StandardField.KEYWORDS, "Foo, Bar"); entry.addKeyword("", ','); assertEquals(new KeywordList("Foo", "Bar"), entry.getKeywords(',')); } @Test - void testAddKeywordEmptyKeywordNotChanged() { + void addKeywordEmptyKeywordNotChanged() { entry.setField(StandardField.KEYWORDS, "Foo, Bar"); entry.setChanged(false); entry.addKeyword("", ','); @@ -481,47 +481,47 @@ void texNewBibEntryAfterAddingEmptyKeywordNotChanged() { } @Test - void testAddKeywordsWorksAsExpected() { + void addKeywordsWorksAsExpected() { entry.addKeywords(Arrays.asList("Foo", "Bar"), ','); assertEquals(new KeywordList("Foo", "Bar"), entry.getKeywords(',')); } @Test - void testPutKeywordsOverwritesOldKeywords() { + void putKeywordsOverwritesOldKeywords() { entry.setField(StandardField.KEYWORDS, "Foo, Bar"); entry.putKeywords(Arrays.asList("Yin", "Yang"), ','); assertEquals(new KeywordList("Yin", "Yang"), entry.getKeywords(',')); } @Test - void testPutKeywordsHasChanged() { + void putKeywordsHasChanged() { entry.setField(StandardField.KEYWORDS, "Foo, Bar"); entry.putKeywords(Arrays.asList("Yin", "Yang"), ','); assertTrue(entry.hasChanged()); } @Test - void testPutKeywordsPutEmpyListErasesPreviousKeywords() { + void putKeywordsPutEmpyListErasesPreviousKeywords() { entry.setField(StandardField.KEYWORDS, "Foo, Bar"); entry.putKeywords(Collections.emptyList(), ','); assertTrue(entry.getKeywords(',').isEmpty()); } @Test - void testPutKeywordsPutEmpyListHasChanged() { + void putKeywordsPutEmpyListHasChanged() { entry.setField(StandardField.KEYWORDS, "Foo, Bar"); entry.putKeywords(Collections.emptyList(), ','); assertTrue(entry.hasChanged()); } @Test - void testPutKeywordsPutEmpyListToEmptyBibentry() { + void putKeywordsPutEmpyListToEmptyBibentry() { entry.putKeywords(Collections.emptyList(), ','); assertTrue(entry.getKeywords(',').isEmpty()); } @Test - void testPutKeywordsPutEmpyListToEmptyBibentryNotChanged() { + void putKeywordsPutEmpyListToEmptyBibentryNotChanged() { entry.putKeywords(Collections.emptyList(), ','); assertFalse(entry.hasChanged()); } @@ -602,7 +602,7 @@ void keywordListCorrectlyConstructedForThreeKeywords() { } @Test - void testGetEmptyResolvedKeywords() { + void getEmptyResolvedKeywords() { BibDatabase database = new BibDatabase(); entry.setField(StandardField.CROSSREF, "entry2"); database.insertEntry(entry); @@ -617,7 +617,7 @@ void testGetEmptyResolvedKeywords() { } @Test - void testGetSingleResolvedKeywords() { + void getSingleResolvedKeywords() { BibDatabase database = new BibDatabase(); entry.setField(StandardField.CROSSREF, "entry2"); @@ -634,7 +634,7 @@ void testGetSingleResolvedKeywords() { } @Test - void testGetResolvedKeywords() { + void getResolvedKeywords() { BibDatabase database = new BibDatabase(); entry.setField(StandardField.CROSSREF, "entry2"); diff --git a/src/test/java/org/jabref/model/entry/BibEntryTypesManagerTest.java b/src/test/java/org/jabref/model/entry/BibEntryTypesManagerTest.java index 0564e8b4bd7..e736a1b8b90 100644 --- a/src/test/java/org/jabref/model/entry/BibEntryTypesManagerTest.java +++ b/src/test/java/org/jabref/model/entry/BibEntryTypesManagerTest.java @@ -140,7 +140,7 @@ void standardTypeIsStillAccessibleIfOverwritten(BibDatabaseMode mode) { @ParameterizedTest @EnumSource(BibDatabaseMode.class) - void testsModifyingArticle(BibDatabaseMode mode) { + void sModifyingArticle(BibDatabaseMode mode) { overwrittenStandardType = new BibEntryType( StandardEntryType.Article, List.of(new BibField(StandardField.TITLE, FieldPriority.IMPORTANT), @@ -155,7 +155,7 @@ void testsModifyingArticle(BibDatabaseMode mode) { @ParameterizedTest @EnumSource(BibDatabaseMode.class) - void testsModifyingArticleWithParsing(BibDatabaseMode mode) { + void sModifyingArticleWithParsing(BibDatabaseMode mode) { overwrittenStandardType = new BibEntryType( StandardEntryType.Article, List.of(new BibField(StandardField.TITLE, FieldPriority.IMPORTANT), @@ -173,7 +173,7 @@ void testsModifyingArticleWithParsing(BibDatabaseMode mode) { @ParameterizedTest @EnumSource(BibDatabaseMode.class) - void testsModifyingArticleWithParsingKeepsListOrder(BibDatabaseMode mode) { + void sModifyingArticleWithParsingKeepsListOrder(BibDatabaseMode mode) { overwrittenStandardType = new BibEntryType( StandardEntryType.Article, List.of(new BibField(StandardField.TITLE, FieldPriority.IMPORTANT), diff --git a/src/test/java/org/jabref/model/entry/EntryTypeFactoryTest.java b/src/test/java/org/jabref/model/entry/EntryTypeFactoryTest.java index 9cfef3dbff6..90c602c0ba8 100644 --- a/src/test/java/org/jabref/model/entry/EntryTypeFactoryTest.java +++ b/src/test/java/org/jabref/model/entry/EntryTypeFactoryTest.java @@ -11,7 +11,7 @@ public class EntryTypeFactoryTest { @Test - public void testParseEntryTypePatent() { + public void parseEntryTypePatent() { EntryType patent = IEEETranEntryType.Patent; assertEquals(patent, EntryTypeFactory.parse("patent")); } diff --git a/src/test/java/org/jabref/model/entry/IdGeneratorTest.java b/src/test/java/org/jabref/model/entry/IdGeneratorTest.java index 83ef54af5eb..20955e25fcd 100644 --- a/src/test/java/org/jabref/model/entry/IdGeneratorTest.java +++ b/src/test/java/org/jabref/model/entry/IdGeneratorTest.java @@ -9,7 +9,7 @@ public class IdGeneratorTest { @Test - public void testCreateNeutralId() { + public void createNeutralId() { HashSet set = new HashSet<>(); for (int i = 0; i < 10000; i++) { String string = IdGenerator.next(); diff --git a/src/test/java/org/jabref/model/entry/field/FieldFactoryTest.java b/src/test/java/org/jabref/model/entry/field/FieldFactoryTest.java index f218e3f82d7..731d2cfc319 100644 --- a/src/test/java/org/jabref/model/entry/field/FieldFactoryTest.java +++ b/src/test/java/org/jabref/model/entry/field/FieldFactoryTest.java @@ -14,12 +14,12 @@ class FieldFactoryTest { @Test - void testOrFieldsTwoTerms() { + void orFieldsTwoTerms() { assertEquals("Aaa/Bbb", FieldFactory.serializeOrFields(new UnknownField("aaa"), new UnknownField("bbb"))); } @Test - void testOrFieldsThreeTerms() { + void orFieldsThreeTerms() { assertEquals("Aaa/Bbb/Ccc", FieldFactory.serializeOrFields(new UnknownField("aaa"), new UnknownField("bbb"), new UnknownField("ccc"))); } @@ -40,12 +40,12 @@ void fieldsWithoutFieldProperties(Field expected, String name) { } @Test - void testDoesNotParseApaFieldWithoutEntryType() { + void doesNotParseApaFieldWithoutEntryType() { assertNotEquals(BiblatexApaField.ARTICLE, FieldFactory.parseField("article")); } @Test - void testDoesParseApaFieldWithEntryType() { + void doesParseApaFieldWithEntryType() { assertEquals(BiblatexApaField.ARTICLE, FieldFactory.parseField(BiblatexApaEntryType.Constitution, "article")); } } diff --git a/src/test/java/org/jabref/model/entry/identifier/DOITest.java b/src/test/java/org/jabref/model/entry/identifier/DOITest.java index 544844845de..c3301b4d3f1 100644 --- a/src/test/java/org/jabref/model/entry/identifier/DOITest.java +++ b/src/test/java/org/jabref/model/entry/identifier/DOITest.java @@ -208,7 +208,7 @@ private static Stream testData() { @ParameterizedTest @MethodSource("testData") - public void testEquals(String expected, String input) { + public void equals(String expected, String input) { assertEquals(expected, input); } diff --git a/src/test/java/org/jabref/model/entry/identifier/ISBNTest.java b/src/test/java/org/jabref/model/entry/identifier/ISBNTest.java index 55dcfe847ca..cc3c5e20310 100644 --- a/src/test/java/org/jabref/model/entry/identifier/ISBNTest.java +++ b/src/test/java/org/jabref/model/entry/identifier/ISBNTest.java @@ -8,66 +8,66 @@ public class ISBNTest { @Test - public void testIsValidFormat10Correct() { + public void isValidFormat10Correct() { assertTrue(new ISBN("0-123456-47-9").isValidFormat()); assertTrue(new ISBN("0-9752298-0-X").isValidFormat()); } @Test - public void testIsValidFormat10Incorrect() { + public void isValidFormat10Incorrect() { assertFalse(new ISBN("0-12B456-47-9").isValidFormat()); } @Test - public void testIsValidChecksum10Correct() { + public void isValidChecksum10Correct() { assertTrue(new ISBN("0-123456-47-9").isValidChecksum()); assertTrue(new ISBN("0-9752298-0-X").isValidChecksum()); assertTrue(new ISBN("0-9752298-0-x").isValidChecksum()); } @Test - public void testIsValidChecksum10Incorrect() { + public void isValidChecksum10Incorrect() { assertFalse(new ISBN("0-123456-47-8").isValidChecksum()); } @Test - public void testIsValidFormat13Correct() { + public void isValidFormat13Correct() { assertTrue(new ISBN("978-1-56619-909-4").isValidFormat()); } @Test - public void testIsValidFormat13Incorrect() { + public void isValidFormat13Incorrect() { assertFalse(new ISBN("978-1-56619-9O9-4 ").isValidFormat()); } @Test - public void testIsValidChecksum13Correct() { + public void isValidChecksum13Correct() { assertTrue(new ISBN("978-1-56619-909-4 ").isValidChecksum()); } @Test - public void testIsValidChecksum13Incorrect() { + public void isValidChecksum13Incorrect() { assertFalse(new ISBN("978-1-56619-909-5").isValidChecksum()); } @Test - public void testIsIsbn10Correct() { + public void isIsbn10Correct() { assertTrue(new ISBN("0-123456-47-9").isIsbn10()); assertTrue(new ISBN("0-9752298-0-X").isIsbn10()); } @Test - public void testIsIsbn10Incorrect() { + public void isIsbn10Incorrect() { assertFalse(new ISBN("978-1-56619-909-4").isIsbn10()); } @Test - public void testIsIsbn13Correct() { + public void isIsbn13Correct() { assertTrue(new ISBN("978-1-56619-909-4").isIsbn13()); } @Test - public void testIsIsbn13Incorrect() { + public void isIsbn13Incorrect() { assertFalse(new ISBN("0-123456-47-9").isIsbn13()); } } diff --git a/src/test/java/org/jabref/model/entry/identifier/ISSNTest.java b/src/test/java/org/jabref/model/entry/identifier/ISSNTest.java index d585552e5fe..6d577a299b1 100644 --- a/src/test/java/org/jabref/model/entry/identifier/ISSNTest.java +++ b/src/test/java/org/jabref/model/entry/identifier/ISSNTest.java @@ -9,54 +9,54 @@ public class ISSNTest { @Test - public void testIsCanBeCleaned() { + public void isCanBeCleaned() { assertTrue(new ISSN("00279633").isCanBeCleaned()); } @Test - public void testIsCanBeCleanedIncorrectRubbish() { + public void isCanBeCleanedIncorrectRubbish() { assertFalse(new ISSN("A brown fox").isCanBeCleaned()); } @Test - public void testIsCanBeCleanedDashAlreadyThere() { + public void isCanBeCleanedDashAlreadyThere() { assertFalse(new ISSN("0027-9633").isCanBeCleaned()); } @Test - public void testGetCleanedISSN() { + public void getCleanedISSN() { assertEquals("0027-9633", new ISSN("00279633").getCleanedISSN()); } @Test - public void testGetCleanedISSNDashAlreadyThere() { + public void getCleanedISSNDashAlreadyThere() { assertEquals("0027-9633", new ISSN("0027-9633").getCleanedISSN()); } @Test - public void testGetCleanedISSNDashRubbish() { + public void getCleanedISSNDashRubbish() { assertEquals("A brown fox", new ISSN("A brown fox").getCleanedISSN()); } @Test - public void testIsValidChecksumCorrect() { + public void isValidChecksumCorrect() { assertTrue(new ISSN("0027-9633").isValidChecksum()); assertTrue(new ISSN("2434-561X").isValidChecksum()); assertTrue(new ISSN("2434-561x").isValidChecksum()); } @Test - public void testIsValidChecksumIncorrect() { + public void isValidChecksumIncorrect() { assertFalse(new ISSN("0027-9634").isValidChecksum()); } @Test - public void testIsValidFormatCorrect() { + public void isValidFormatCorrect() { assertTrue(new ISSN("0027-963X").isValidFormat()); } @Test - public void testIsValidFormatIncorrect() { + public void isValidFormatIncorrect() { assertFalse(new ISSN("00279634").isValidFormat()); } } diff --git a/src/test/java/org/jabref/model/openoffice/CitationEntryTest.java b/src/test/java/org/jabref/model/openoffice/CitationEntryTest.java index 481afa00eac..6e003d6746b 100644 --- a/src/test/java/org/jabref/model/openoffice/CitationEntryTest.java +++ b/src/test/java/org/jabref/model/openoffice/CitationEntryTest.java @@ -11,7 +11,7 @@ class CitationEntryTest { @Test - void testCitationEntryInitialPageInfo() { + void citationEntryInitialPageInfo() { CitationEntry citationEntry = new CitationEntry("RefMark", "Context", "Info"); assertTrue(citationEntry.getPageInfo().isPresent()); assertEquals("Info", citationEntry.getPageInfo().get()); @@ -20,7 +20,7 @@ void testCitationEntryInitialPageInfo() { } @Test - void testCitationEntryOptionalInitialPageInfo() { + void citationEntryOptionalInitialPageInfo() { CitationEntry citationEntry = new CitationEntry("RefMark", "Context", Optional.of("Info")); assertEquals(Optional.of("Info"), citationEntry.getPageInfo()); @@ -29,19 +29,19 @@ void testCitationEntryOptionalInitialPageInfo() { } @Test - void testCitationEntryInitalPageInfoChanged() { + void citationEntryInitalPageInfoChanged() { CitationEntry citationEntry = new CitationEntry("RefMark", "Context", "Info"); assertEquals(Optional.of("Info"), citationEntry.getPageInfo()); } @Test - void testCitationEntryNoInitialPageInfo() { + void citationEntryNoInitialPageInfo() { CitationEntry citationEntry = new CitationEntry("RefMark", "Context"); assertEquals(Optional.empty(), citationEntry.getPageInfo()); } @Test - void testCitationEntryEquals() { + void citationEntryEquals() { CitationEntry citationEntry1 = new CitationEntry("RefMark", "Context", "Info"); CitationEntry citationEntry2 = new CitationEntry("RefMark2", "Context", "Info"); CitationEntry citationEntry3 = new CitationEntry("RefMark", "Other Context", "Other Info"); @@ -52,7 +52,7 @@ void testCitationEntryEquals() { } @Test - void testCitationEntryCompareTo() { + void citationEntryCompareTo() { CitationEntry citationEntry1 = new CitationEntry("RefMark", "Context", "Info"); CitationEntry citationEntry2 = new CitationEntry("RefMark2", "Context", "Info"); CitationEntry citationEntry3 = new CitationEntry("RefMark", "Other Context", "Other Info"); diff --git a/src/test/java/org/jabref/model/pdf/FileAnnotationTest.java b/src/test/java/org/jabref/model/pdf/FileAnnotationTest.java index 74b54990ef6..cb0fb97f14d 100644 --- a/src/test/java/org/jabref/model/pdf/FileAnnotationTest.java +++ b/src/test/java/org/jabref/model/pdf/FileAnnotationTest.java @@ -12,35 +12,35 @@ public class FileAnnotationTest { @Test - public void testParseDateMinusBeforeTimezone() { + public void parseDateMinusBeforeTimezone() { String dateString = "D:20170512224019-03'00'"; LocalDateTime date = FileAnnotation.extractModifiedTime(dateString); assertEquals(LocalDateTime.of(2017, 05, 12, 22, 40, 19), date); } @Test - public void testParseDatePlusBeforeTimezone() { + public void parseDatePlusBeforeTimezone() { String dateString = "D:20170512224019+03'00'"; LocalDateTime date = FileAnnotation.extractModifiedTime(dateString); assertEquals(LocalDateTime.of(2017, 05, 12, 22, 40, 19), date); } @Test - public void testParseDateNoTimezone() { + public void parseDateNoTimezone() { String dateString = "D:20170512224019"; LocalDateTime date = FileAnnotation.extractModifiedTime(dateString); assertEquals(LocalDateTime.of(2017, 05, 12, 22, 40, 19), date); } @Test - public void testParseNotADate() { + public void parseNotADate() { String dateString = "gsdfgwergsdf"; LocalDateTime date = FileAnnotation.extractModifiedTime(dateString); assertTrue(ChronoUnit.SECONDS.between(LocalDateTime.now(), date) <= 1); } @Test - public void testAbbreviateAnnotationName() { + public void abbreviateAnnotationName() { final FileAnnotation fileAnnotation = new FileAnnotation("John Robertson", LocalDateTime.of(2020, 4, 18, 17, 10), 1, "this is an annotation that is very long and goes over the character limit of 45", diff --git a/src/test/java/org/jabref/model/search/matchers/MatcherSetsTest.java b/src/test/java/org/jabref/model/search/matchers/MatcherSetsTest.java index be77c6773e3..4d671a94035 100644 --- a/src/test/java/org/jabref/model/search/matchers/MatcherSetsTest.java +++ b/src/test/java/org/jabref/model/search/matchers/MatcherSetsTest.java @@ -11,7 +11,7 @@ public class MatcherSetsTest { @Test - public void testBuildAnd() { + public void buildAnd() { MatcherSet matcherSet = MatcherSets.build(MatcherSets.MatcherType.AND); assertTrue(matcherSet.isMatch(new BibEntry())); @@ -23,7 +23,7 @@ public void testBuildAnd() { } @Test - public void testBuildOr() { + public void buildOr() { MatcherSet matcherSet = MatcherSets.build(MatcherSets.MatcherType.OR); assertFalse(matcherSet.isMatch(new BibEntry())); @@ -35,13 +35,13 @@ public void testBuildOr() { } @Test - public void testBuildNotWithTrue() { + public void buildNotWithTrue() { NotMatcher matcher = new NotMatcher(new MockSearchMatcher(true)); assertFalse(matcher.isMatch(new BibEntry())); } @Test - public void testBuildNotWithFalse() { + public void buildNotWithFalse() { NotMatcher matcher = new NotMatcher(new MockSearchMatcher(false)); assertTrue(matcher.isMatch(new BibEntry())); } diff --git a/src/test/java/org/jabref/model/search/rules/ContainsBasedSearchRuleTest.java b/src/test/java/org/jabref/model/search/rules/ContainsBasedSearchRuleTest.java index ed77afd40be..593017ef7ab 100644 --- a/src/test/java/org/jabref/model/search/rules/ContainsBasedSearchRuleTest.java +++ b/src/test/java/org/jabref/model/search/rules/ContainsBasedSearchRuleTest.java @@ -27,7 +27,7 @@ public class ContainsBasedSearchRuleTest { private final RegexBasedSearchRule bsCaseInsensitiveRegexp = new RegexBasedSearchRule(EnumSet.of(SearchRules.SearchFlags.REGULAR_EXPRESSION)); @Test - public void testContentOfSingleField() { + public void contentOfSingleField() { String query = "\"marine larviculture\""; assertFalse(bsCaseSensitive.applyRule(query, be)); @@ -37,7 +37,7 @@ public void testContentOfSingleField() { } @Test - public void testContentDistributedOnMultipleFields() { + public void contentDistributedOnMultipleFields() { String query = "marine 2001 shields"; assertFalse(bsCaseSensitive.applyRule(query, be)); @@ -47,7 +47,7 @@ public void testContentDistributedOnMultipleFields() { } @Test - public void testRegularExpressionMatch() { + public void regularExpressionMatch() { String query = "marine [A-Za-z]* larviculture"; assertFalse(bsCaseSensitive.applyRule(query, be)); diff --git a/src/test/java/org/jabref/model/search/rules/SentenceAnalyzerTest.java b/src/test/java/org/jabref/model/search/rules/SentenceAnalyzerTest.java index 61e05e3def4..7624fd694d4 100644 --- a/src/test/java/org/jabref/model/search/rules/SentenceAnalyzerTest.java +++ b/src/test/java/org/jabref/model/search/rules/SentenceAnalyzerTest.java @@ -28,7 +28,7 @@ static Stream getParameters() { @ParameterizedTest @MethodSource("getParameters") - public void testGetWords(List expected, String input) { + public void getWords(List expected, String input) { assertEquals(expected, new SentenceAnalyzer(input).getWords()); } } diff --git a/src/test/java/org/jabref/model/strings/StringUtilTest.java b/src/test/java/org/jabref/model/strings/StringUtilTest.java index f41584e1939..5adf4d6f9e3 100644 --- a/src/test/java/org/jabref/model/strings/StringUtilTest.java +++ b/src/test/java/org/jabref/model/strings/StringUtilTest.java @@ -31,38 +31,38 @@ void StringUtilClassIsSmall() throws Exception { } @Test - void testBooleanToBinaryString() { + void booleanToBinaryString() { assertEquals("0", StringUtil.booleanToBinaryString(false)); assertEquals("1", StringUtil.booleanToBinaryString(true)); } @Test - void testQuoteSimple() { + void quoteSimple() { assertEquals("a::", StringUtil.quote("a:", "", ':')); } @Test - void testQuoteNullQuotation() { + void quoteNullQuotation() { assertEquals("a::", StringUtil.quote("a:", null, ':')); } @Test - void testQuoteNullString() { + void quoteNullString() { assertEquals("", StringUtil.quote(null, ";", ':')); } @Test - void testQuoteQuotationCharacter() { + void quoteQuotationCharacter() { assertEquals("a:::;", StringUtil.quote("a:;", ";", ':')); } @Test - void testQuoteMoreComplicated() { + void quoteMoreComplicated() { assertEquals("a::b:%c:;", StringUtil.quote("a:b%c;", "%;", ':')); } @Test - void testUnifyLineBreaks() { + void unifyLineBreaks() { // Mac < v9 String result = StringUtil.unifyLineBreaks("\r", "newline"); assertEquals("newline", result); @@ -75,7 +75,7 @@ void testUnifyLineBreaks() { } @Test - void testGetCorrectFileName() { + void getCorrectFileName() { assertEquals("aa.bib", StringUtil.getCorrectFileName("aa", "bib")); assertEquals(".login.bib", StringUtil.getCorrectFileName(".login", "bib")); assertEquals("a.bib", StringUtil.getCorrectFileName("a.bib", "bib")); @@ -86,13 +86,13 @@ void testGetCorrectFileName() { } @Test - void testQuoteForHTML() { + void quoteForHTML() { assertEquals("!", StringUtil.quoteForHTML("!")); assertEquals("!!!", StringUtil.quoteForHTML("!!!")); } @Test - void testRemoveBracesAroundCapitals() { + void removeBracesAroundCapitals() { assertEquals("ABC", StringUtil.removeBracesAroundCapitals("{ABC}")); assertEquals("ABC", StringUtil.removeBracesAroundCapitals("{{ABC}}")); assertEquals("{abc}", StringUtil.removeBracesAroundCapitals("{abc}")); @@ -100,7 +100,7 @@ void testRemoveBracesAroundCapitals() { } @Test - void testPutBracesAroundCapitals() { + void putBracesAroundCapitals() { assertEquals("{ABC}", StringUtil.putBracesAroundCapitals("ABC")); assertEquals("{ABC}", StringUtil.putBracesAroundCapitals("{ABC}")); assertEquals("abc", StringUtil.putBracesAroundCapitals("abc")); @@ -109,7 +109,7 @@ void testPutBracesAroundCapitals() { } @Test - void testShaveString() { + void shaveString() { assertEquals("", StringUtil.shaveString(null)); assertEquals("", StringUtil.shaveString("")); assertEquals("aaa", StringUtil.shaveString(" aaa\t\t\n\r")); @@ -121,7 +121,7 @@ void testShaveString() { } @Test - void testJoin() { + void join() { String[] s = {"ab", "cd", "ed"}; assertEquals("ab\\cd\\ed", StringUtil.join(s, "\\", 0, s.length)); @@ -135,7 +135,7 @@ void testJoin() { } @Test - void testStripBrackets() { + void stripBrackets() { assertEquals("foo", StringUtil.stripBrackets("[foo]")); assertEquals("[foo]", StringUtil.stripBrackets("[[foo]]")); assertEquals("", StringUtil.stripBrackets("")); @@ -147,7 +147,7 @@ void testStripBrackets() { } @Test - void testGetPart() { + void getPart() { // Get word between braces assertEquals("{makes}", StringUtil.getPart("Practice {makes} perfect", 8, false)); // When the string is empty and start Index equal zero @@ -159,12 +159,12 @@ void testGetPart() { } @Test - void testFindEncodingsForString() { + void findEncodingsForString() { // Unused in JabRef, but should be added in case it finds some use } @Test - void testWrap() { + void wrap() { String newline = "newline"; assertEquals("aaaaa" + newline + "\tbbbbb" + newline + "\tccccc", StringUtil.wrap("aaaaa bbbbb ccccc", 5, newline)); @@ -181,7 +181,7 @@ void testWrap() { } @Test - void testDecodeStringDoubleArray() { + void decodeStringDoubleArray() { assertArrayEquals(new String[][]{{"a", "b"}, {"c", "d"}}, StringUtil.decodeStringDoubleArray("a:b;c:d")); assertArrayEquals(new String[][]{{"a", ""}, {"c", "d"}}, StringUtil.decodeStringDoubleArray("a:;c:d")); // arrays first differed at element [0][1]; expected: null but was: java.lang.String @@ -190,7 +190,7 @@ void testDecodeStringDoubleArray() { } @Test - void testIsInCurlyBrackets() { + void isInCurlyBrackets() { assertFalse(StringUtil.isInCurlyBrackets("")); assertFalse(StringUtil.isInCurlyBrackets(null)); assertTrue(StringUtil.isInCurlyBrackets("{}")); @@ -204,7 +204,7 @@ void testIsInCurlyBrackets() { } @Test - void testIsInSquareBrackets() { + void isInSquareBrackets() { assertFalse(StringUtil.isInSquareBrackets("")); assertFalse(StringUtil.isInSquareBrackets(null)); assertTrue(StringUtil.isInSquareBrackets("[]")); @@ -215,7 +215,7 @@ void testIsInSquareBrackets() { } @Test - void testIsInCitationMarks() { + void isInCitationMarks() { assertFalse(StringUtil.isInCitationMarks("")); assertFalse(StringUtil.isInCitationMarks(null)); assertTrue(StringUtil.isInCitationMarks("\"\"")); @@ -225,87 +225,87 @@ void testIsInCitationMarks() { } @Test - void testIntValueOfSingleDigit() { + void intValueOfSingleDigit() { assertEquals(1, StringUtil.intValueOf("1")); assertEquals(2, StringUtil.intValueOf("2")); assertEquals(8, StringUtil.intValueOf("8")); } @Test - void testIntValueOfLongString() { + void intValueOfLongString() { assertEquals(1234567890, StringUtil.intValueOf("1234567890")); } @Test - void testIntValueOfStartWithZeros() { + void intValueOfStartWithZeros() { assertEquals(1234, StringUtil.intValueOf("001234")); } @Test - void testIntValueOfExceptionIfStringContainsLetter() { + void intValueOfExceptionIfStringContainsLetter() { assertThrows(NumberFormatException.class, () -> StringUtil.intValueOf("12A2")); } @Test - void testIntValueOfExceptionIfStringNull() { + void intValueOfExceptionIfStringNull() { assertThrows(NumberFormatException.class, () -> StringUtil.intValueOf(null)); } @Test - void testIntValueOfExceptionfIfStringEmpty() { + void intValueOfExceptionfIfStringEmpty() { assertThrows(NumberFormatException.class, () -> StringUtil.intValueOf("")); } @Test - void testIntValueOfWithNullSingleDigit() { + void intValueOfWithNullSingleDigit() { assertEquals(Optional.of(1), StringUtil.intValueOfOptional("1")); assertEquals(Optional.of(2), StringUtil.intValueOfOptional("2")); assertEquals(Optional.of(8), StringUtil.intValueOfOptional("8")); } @Test - void testIntValueOfWithNullLongString() { + void intValueOfWithNullLongString() { assertEquals(Optional.of(1234567890), StringUtil.intValueOfOptional("1234567890")); } @Test - void testIntValueOfWithNullStartWithZeros() { + void intValueOfWithNullStartWithZeros() { assertEquals(Optional.of(1234), StringUtil.intValueOfOptional("001234")); } @Test - void testIntValueOfWithNullExceptionIfStringContainsLetter() { + void intValueOfWithNullExceptionIfStringContainsLetter() { assertEquals(Optional.empty(), StringUtil.intValueOfOptional("12A2")); } @Test - void testIntValueOfWithNullExceptionIfStringNull() { + void intValueOfWithNullExceptionIfStringNull() { assertEquals(Optional.empty(), StringUtil.intValueOfOptional(null)); } @Test - void testIntValueOfWithNullExceptionfIfStringEmpty() { + void intValueOfWithNullExceptionfIfStringEmpty() { assertEquals(Optional.empty(), StringUtil.intValueOfOptional("")); } @Test - void testLimitStringLengthShort() { + void limitStringLengthShort() { assertEquals("Test", StringUtil.limitStringLength("Test", 20)); } @Test - void testLimitStringLengthLimiting() { + void limitStringLengthLimiting() { assertEquals("TestTes...", StringUtil.limitStringLength("TestTestTestTestTest", 10)); assertEquals(10, StringUtil.limitStringLength("TestTestTestTestTest", 10).length()); } @Test - void testLimitStringLengthNullInput() { + void limitStringLengthNullInput() { assertEquals("", StringUtil.limitStringLength(null, 10)); } @Test - void testReplaceSpecialCharacters() { + void replaceSpecialCharacters() { assertEquals("Hallo Arger", StringUtil.replaceSpecialCharacters("Hallo Arger")); assertEquals("aaAeoeeee", StringUtil.replaceSpecialCharacters("åÄöéèë")); } @@ -326,41 +326,41 @@ static Stream testRepeatSpacesData() { @ParameterizedTest @MethodSource("testRepeatSpacesData") - void testRepeatSpaces(String result, int count) { + void repeatSpaces(String result, int count) { assertEquals(result, StringUtil.repeatSpaces(count)); } @Test - void testRepeat() { + void repeat() { assertEquals("", StringUtil.repeat(0, 'a')); assertEquals("a", StringUtil.repeat(1, 'a')); assertEquals("aaaaaaa", StringUtil.repeat(7, 'a')); } @Test - void testBoldHTML() { + void boldHTML() { assertEquals("AA", StringUtil.boldHTML("AA")); } @Test - void testBoldHTMLReturnsOriginalTextIfNonNull() { + void boldHTMLReturnsOriginalTextIfNonNull() { assertEquals("AA", StringUtil.boldHTML("AA", "BB")); } @Test - void testBoldHTMLReturnsAlternativeTextIfNull() { + void boldHTMLReturnsAlternativeTextIfNull() { assertEquals("BB", StringUtil.boldHTML(null, "BB")); } @Test - void testUnquote() { + void unquote() { assertEquals("a:", StringUtil.unquote("a::", ':')); assertEquals("a:;", StringUtil.unquote("a:::;", ':')); assertEquals("a:b%c;", StringUtil.unquote("a::b:%c:;", ':')); } @Test - void testCapitalizeFirst() { + void capitalizeFirst() { assertEquals("", StringUtil.capitalizeFirst("")); assertEquals("Hello world", StringUtil.capitalizeFirst("Hello World")); assertEquals("A", StringUtil.capitalizeFirst("a")); @@ -378,17 +378,17 @@ private static Stream getQuoteStringIfSpaceIsContainedData() { @ParameterizedTest @MethodSource("getQuoteStringIfSpaceIsContainedData") - void testGuoteStringIfSpaceIsContained(String expected, String source) { + void guoteStringIfSpaceIsContained(String expected, String source) { assertEquals(expected, StringUtil.quoteStringIfSpaceIsContained(source)); } @Test - void testStripAccents() { + void stripAccents() { assertEquals("aAoeee", StringUtil.stripAccents("åÄöéèë")); assertEquals("Muhlbach", StringUtil.stripAccents("Mühlbach")); } - static Stream testContainsWhitespace() { + static Stream containsWhitespace() { return Stream.of( Arguments.of(true, "file url"), Arguments.of(true, "file\nurl"), @@ -406,7 +406,7 @@ static Stream testContainsWhitespace() { @ParameterizedTest @MethodSource - void testContainsWhitespace(Boolean expected, String input) { + void containsWhitespace(Boolean expected, String input) { assertEquals(expected, StringUtil.containsWhitespace(input)); } }