koppor / jabref

Collection of simple for JabRef issues. Please submit PRs to https://github.com/jabRef/jabref/.
https://github.com/jabRef/jabref/
MIT License
8 stars 14 forks source link

Add tests for DatabaseFileLookup #678

Open koppor opened 4 months ago

koppor commented 4 months ago

(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)

image

Main file directory

One needs to set the main file directory, too:

image

Example:

@Article{test,
  file = {:test.pdf},
}

Where is test.pdf located?

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:

Hints:

koppor commented 2 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)