You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it C:\TEMP\JabRef\linked-files\global, C:\TEMP\JabRef\linked-files\general AKA library-specific, is it C:\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:
Use @TempDir tmpDir and create file there
Create on file x.txt there (Files.write(...))
Set the tmpDir as metaData.getDefaultFileDirectory() (mockito!)
Crete a BibDatabaseContext with a BibDatabase with two entries. Both entries with an attached file. The first one with x.txt, the other one with y.txt
assert that x.txt is found, but not y.txt. (org.jabref.logic.util.io.DatabaseFileLookup#lookupDatabase)
Use IntellIjs code coverage feature to check if all lines of DatabaseFileLookup were covered. If not: create more test cases...
Hints:
First write the initial test
Then, use the debugger to step though and check how the code of org.jabref.logic.util.io.DatabaseFileLookup works
Finish the test
The text was updated successfully, but these errors were encountered:
(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
worksThe text was updated successfully, but these errors were encountered: