-
Notifications
You must be signed in to change notification settings - Fork 125
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.
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.
I agree it should be part of the tests jar. I don't know why we would need this outside of our test framework. The conventions it implements are test framework conventions.
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.
The unit test that is testing this test utility would live side-by-side next to it. I'm ok with that even though it's a bit unconventional.
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.
I was running into several scenarios where I didn't want answer files in xml format. I had input and expected output versus actual output that I wanted to be able to compare in a diff tool in the IDE, as text, or json, or some other pretty format that is human readable and easier to diff. It would be nice if answer files didn't have to use xml extensions to be identified as answer files. |
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.