-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring and addition of unit tests #7597
Conversation
FieldChange.java 18% -> 94% Abbreviation.java 63% -> 88% SuggestionProviders.java 0% -> 100%
FileHelper.java -> Boundary testing of an empty file CitationKeyGenerator.java -> Boundary testing of testlagepage parser for 0-00 & 1-1 HTMLCharacterChecker.java -> Null Value Boundary test
ParsedEntryLink.java -> Partition testing of ParsingEntryLink UpperCaseFormatter.java -> Partition testing for special characters CitationStyleCacheTest.java -> Partition testing of cache storage
SPTest typo fix
Checkstyle passed
Adjustments for @ellieMayVelasquez feedback #7543 (review)
Assertion Roulette
Added Resource Optimism
Added assertion messages to fix assertion roulette.
General Fixture, removed test code duplication
checkstyle fix
General Refactoring
not needed
Fixed AssertionRoulette, one instance of duplicated test code.
Test code duplication
Assertion Roulette fixed
fixed Assertion Roulette
src/test/java/org/jabref/logic/citationstyle/CitationStyleCacheTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jabref/migrations/SpecialFieldsToSeparateFieldsTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding to our test suite.
Nevertheless, got some remarks.
src/test/java/org/jabref/gui/autocompleter/SuggestionProvidersTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jabref/gui/autocompleter/SuggestionProvidersTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jabref/gui/groups/GroupTreeViewModelTest.java
Outdated
Show resolved
Hide resolved
...est/java/org/jabref/gui/journals/JournalAbbreviationsViewModelMixedAbbreviationsTabTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jabref/logic/integrity/HTMLCharacterCheckerTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jabref/migrations/SpecialFieldsToSeparateFieldsTest.java
Outdated
Show resolved
Hide resolved
@nasdas-dev May I ask whether you will find time to address our comments? |
@koppor I'll have a look this weekend! Sorry for the delay |
We closed the other PR #7653, so no worries if the files are duplicate. The normal way would be to do some Could you work on this PR and resolve the conflicts? Then, we can review and merge. |
Hi @nasdas-dev , did you already had some time to get this branch and the corrupt commits right? |
…ngxie1991-a2-ds # Conflicts: # src/test/java/org/jabref/gui/autocompleter/SuggestionProvidersTest.java # src/test/java/org/jabref/logic/citationkeypattern/CitationKeyGeneratorTest.java # src/test/java/org/jabref/logic/formatter/casechanger/UpperCaseFormatterTest.java # src/test/java/org/jabref/model/entry/EntryLinkListTest.java
- Remove assertion failure messages - Fix List.of() - Fix variable name - convert to parameterized test - Fix checkstyle / indent - Revert some changes
@nasdas-dev I took the freedom to finalize the PR. Most importantly, I used the power of JUnit's parameterized tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
one failing unit test
|
Way to quick again... 🙈 I'll look into it. |
* upstream/main: New Crowdin updates (#7843) Refactoring and addition of unit tests (#7597) CLI option to write XMP metadata to pdfs (#7814) Add query validation for web search (#7809) change eclipse default output dir (#7842) Bump lucene-queryparser from 8.8.2 to 8.9.0 (#7835) Bump libreoffice from 7.1.3 to 7.1.4 (#7836) Bump postgresql from 42.2.21 to 42.2.22 (#7839) Bump org.eclipse.jgit (#7838) Bump byte-buddy-parent from 1.11.2 to 1.11.5 (#7837) Bump unoloader from 7.1.3 to 7.1.4 (#7841) Ms Office Export patent author as inventor (#7831) Abbreviation toggle within the JournalEditorViewModel now ignores curly braces (issue #7773) (#7807)
* upstream/main: (26 commits) Add unit test to four test classes (#7651) Fix IEEE test (#7852) New Crowdin updates (#7859) Fix markdown syntax of ADRs add missing l10n (#7857) New Crowdin updates (#7847) Bump mockito-core from 3.11.1 to 3.11.2 (#7856) Bump checkstyle from 8.43 to 8.44 (#7855) Fix for issue #4652: Add Find Unlinked Files Filter based on Date (#7846) Fix for entering a backslash in the custom entry preview dialog (#7851) Fixed INSPIREFetcherTest Fixed TitleFetcherTest Ignore baeldung.com and tldrlegal.com from out link checks New Crowdin updates (#7845) New Crowdin updates (#7843) Refactoring and addition of unit tests (#7597) CLI option to write XMP metadata to pdfs (#7814) Add query validation for web search (#7809) change eclipse default output dir (#7842) Bump lucene-queryparser from 8.8.2 to 8.9.0 (#7835) ...
…kflow-for-slr-search * upstream/main: (31 commits) New translations JabRef_en.properties (German) (#7868) Fix test "higherTrustLevelWins()" (#7866) Change WM_CLASS to jabref (#7858) [Bot] Update CSL styles (#7865) Add unit test to four test classes (#7651) Fix IEEE test (#7852) New Crowdin updates (#7859) Fix markdown syntax of ADRs add missing l10n (#7857) New Crowdin updates (#7847) Bump mockito-core from 3.11.1 to 3.11.2 (#7856) Bump checkstyle from 8.43 to 8.44 (#7855) Fix for issue #4652: Add Find Unlinked Files Filter based on Date (#7846) Fix for entering a backslash in the custom entry preview dialog (#7851) Fixed INSPIREFetcherTest Fixed TitleFetcherTest Ignore baeldung.com and tldrlegal.com from out link checks New Crowdin updates (#7845) New Crowdin updates (#7843) Refactoring and addition of unit tests (#7597) ... # Conflicts: # src/main/resources/l10n/JabRef_en.properties
This pull request includes new unit tests for three classes which increases their line/statement coverage.
They contribute to issue #6207.
Further, I have also refactored existing unit tests to make them more readable, understandable and maintanable.
In this sense, I focused more on test smells described in the paper Refactoring test code (van Deursen et al.) and also on the Code Howtos (Test Cases) in the Development Documentation.
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)