Open koppor opened 4 months ago
I am so sorry that my "hints" section above that the task list was complete.
The intention of the task was that students think of test cases.
Here some hints:
Thus, file can be placed in
File can exist in multiple directories.
The work should cover all cases derived from that.
These are:
(that list is complete IMHO)
(META: This issue is reserved for a university course. Please only work on it if it is part of your assignment)
The class
org.jabref.logic.util.io.DatabaseFileLookup
is used to check for existing files. The current tests do not do anything with files.Some context:
User-facing thing
(draftish - hope, you understand)
C:\TEMP\JabRef\linked-files\general AKA library-specific
C:\TEMP\JabRef\linked-files\user-specific
Main file directory
One needs to set the main file directory, too:
C:\TEMP\JabRef\linked-files\global
Example:
Where is
test.pdf
located?Is it
C:\TEMP\JabRef\linked-files\global
,C:\TEMP\JabRef\linked-files\general AKA library-specific
, is itC:\TEMP\JabRef\linked-files\user-specific
? Which directory is JabRef finding? What if the file is in two of these directories?Task
Create a test for
DatabaseFileLookup
covering both a present and an absent file.Hints:
@TempDir tmpDir
and create file therex.txt
there (Files.write(...)
)tmpDir
asmetaData.getDefaultFileDirectory()
(mockito!)BibDatabaseContext
with aBibDatabase
with two entries. Both entries with an attached file. The first one withx.txt
, the other one withy.txt
assert
thatx.txt
is found, but noty.txt
. (org.jabref.logic.util.io.DatabaseFileLookup#lookupDatabase
)Hints:
org.jabref.logic.util.io.DatabaseFileLookup
works