Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

drivenflywheel
Copy link
Collaborator

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.

@jpdahlke jpdahlke added the enhancement An enhancement or update to an existing feature label Oct 2, 2023
…s that aren't tightly coupled to the default file naming schemes
@jpdahlke
Copy link
Collaborator

@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 {
Copy link
Collaborator

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?

Copy link
Collaborator

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.

@DonResnik DonResnik self-requested a review October 26, 2024 17:28
@DonResnik
Copy link
Collaborator

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.

Copy link
Collaborator

@DonResnik DonResnik left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or update to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants