Conversation
|
Please use rebase --interactive to squash the commits with messages like |
There was a problem hiding this comment.
Please see #310 for how to handle tests for this part.
|
@boceckts |
|
@boceckts Please squash the whole branch history into one commit. The magic command is |
e373db3 to
92f2318
Compare
|
Commits sind nun zu einem Commit zusammengefasst, index out of bounds exception gefixt und die Testmethoden sind nun leicht abgeändert zu AssertEquals. |
|
Commit looks good 👍, but the test fail. Could you please investigate? |
|
Welche Tests genau? Wenn ich die Klasse MedlinePlainImporterTest.java als JUnit Test ausführe, laufen alle Test bei mir ohne Fehler.. |
There was a problem hiding this comment.
!contains is better readable then indexOf, I think.
|
Siehst du hier beim Pull-Request die Meldung "All checks have failed"? Screenshot: Du kannst dann auf "Details" bei "ci/circleci" klicken. Dort steht dann "junit failures: testIsRecognizedFormat - in net.sf.jabref.importer.fileformat.MedlinePlainImporterTest". Hier kannst du auf "more info" klicken. Da steht dann |
3278d90 to
5b50388
Compare
|
@simonharrer changed it to !contains. |
|
Your test file looks good. Seems to cover seven different entry types with different fields and different settings (doi, multine line titles). However, your test only treats two of them. Why don't you check all test entries? You could check the result via prepared bibtex files. See https://github.com/JabRef/jabref/blob/6293b4d8ee9409afb25b402643a31904b56e33a0/src/test/java/net/sf/jabref/importer/fetcher/GVKParserTest.java. We are trying to get #378 through so that others can use these test improvements, too. |
|
@boceckts We are ready to go from our side. Please have a look at GVKParserTest.java. |
0faabca to
c201d7c
Compare
4155d5f to
33382d0
Compare
|
The Unit Test failes because multiple comments are being imported with a newline separator. However in the bibtex source the new lines are being ommitted therefore the assertion fails when testing with a import file using multiple comments such as "MedlinePlainImporterTest2.txt vs MedlinePlainImporterTestBib2.bib". |
c693eb8 to
eed59bb
Compare
There was a problem hiding this comment.
Always use try-with-resources for getResourceAsStream usages.
There was a problem hiding this comment.
Split tests. Definitely a separate test for recognized and one for not-recognized files. I would even say that there should be a separate test for every file (maybe not for all files, just the ones which actually test a new behavior...say one for txt files and one for isi).
There was a problem hiding this comment.
Split tests is a great idea. I think one test method for isRecognized and one for isNotRecognized should be enough since this methods should not test any data but only check if the format is recognized or not.
There was a problem hiding this comment.
Yes, you are right, normally one should be enough. But have a look at the isRecognized method and see if you cover all cases. Also it does not harm to check edge cases, like empty files.
|
Good work 👍 . Better test specific features in small test cases (and maybe leave one big "integration" test). For example, (using pseudo-code) public importParsesDoi() {
Stream stream = StreamFromString("PMID-22664220" + "\n" + "AID - doi:10.1016/j.cpr.2005.02.002");
List<Entries> entries = Import(stream);
BibEntry expected = new BibEntry();
expected.setField("doi", "10.1016/j.cpr.2005.02.002");
Assert(entries = Collections.singletonList(expected));
}could replace the test |
a9eda92 to
1f08f0c
Compare
|
Your test fail, because Therefore, please add a method to |
d5b2c18 to
5c7f342
Compare
ea200ff to
db9c5b3
Compare
|
Added more test methodes to cover more if conditions and included the suggestions of the comments. |
There was a problem hiding this comment.
Only the last (positive) assert statement is necessary.
|
Looks very good to me! I just pointed out some smaller things. If they are fixed, this can be merged in (from my point of view). |
db9c5b3 to
4568400
Compare
|
Thank you for the comments, I removed the unnecessary NotEquals and added tests for the remaining entries in the test file. |
- Test import and resulting bibtex files added - Testing imported entries vs bibtex files - Fixed IndexOutOfBoundsExeption - Fixed unreachable Code
4568400 to
6d09b72
Compare
|
Coverage 98.65%. I assume that covering line 126 was difficult, because there is no entry where the fourth character of the second line is NOT |


Fixed IndexOutOfBounds for MedlinePlainImporter when Testfile has lines with too few characters. Removed unreachable code. Created 100% Testcoverage for MedlinePlainImporter.