-
Notifications
You must be signed in to change notification settings - Fork 122
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
Added a ResourceReader that can retrieve test resource files in nested locations #556
base: main
Are you sure you want to change the base?
Added a ResourceReader that can retrieve test resource files in nested locations #556
Conversation
…s that aren't tightly coupled to the default file naming schemes
f37d147
to
432688e
Compare
@drivenflywheel is this something we should revisit or spend cycles integrating? It seems helpful for certain situations but I'm not sure where we left it. |
* content-representative file names. | ||
* </p> | ||
*/ | ||
public class GreedyResourceReader extends ResourceReader { |
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.
Should this class exist in the test package?
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.
You could argue either way, but I like it where it is. As a class that supports a test (as opposed to containing tests), it seems reasonable to be in main/util/io.
As a newer user of the API, I like the idea of not have to call everything a .dat file in tests. As a follow-on effort, it might be good to incorporate this into RegressionTest and it's generation of answer files to follow this implementation. |
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.
code looks good. mvn clean install completed successfully.
Allows decoupling from the default ".dat" file naming scheme and flat directory structure. Primarily intended for use by IdentificationTests that can benefit from more content-representative test file names. Along with PR #555, this will allow IdentificationTests to specify a payload's "expected form" via directory name rather than file name, without explicitly requiring an answer XML file.
With the initial commit, test data files should be stored anywhere below the TestClassName/payloads folder. Answer files (when needed) should be in mirrored paths below the TestClassName/answers folder.
Given the fairly large break with existing convention, I thought it would be prudent to keep this functionality out of the base
ResourceReader
class so devs would not accidentally select the new methods via autocomplete.