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

Fix regex matching for readInfo #25

Merged

Conversation

mikejritter
Copy link
Contributor

Resolves #16

Use find instead of match to test if a line is an extended tag value

@codecov-io
Copy link

codecov-io commented Apr 21, 2020

Codecov Report

Merging #25 into master will increase coverage by 0.39%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #25      +/-   ##
============================================
+ Coverage     87.43%   87.82%   +0.39%     
- Complexity      142      143       +1     
============================================
  Files            16       16              
  Lines           573      575       +2     
  Branches         82       82              
============================================
+ Hits            501      505       +4     
+ Misses           42       41       -1     
+ Partials         30       29       -1     
Impacted Files Coverage Δ Complexity Δ
...ava/org/duraspace/bagit/ProfileValidationUtil.java 96.00% <100.00%> (+2.84%) 26.00 <2.00> (+1.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92632ab...3ebc32b. Read the comment docs.

Copy link
Member

@awoods awoods left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a case where a small unit test would help verify the updated functionality.

The following addition to "ProfileValidationUtilTest.java" may do the trick:

    @Test
    public void testOnDiskInfoValidation() throws ProfileValidationException, IOException {
        rules.clear();
        rules.put("Source-Organization",
                  new ProfileFieldRule(required, repeatable, recommended, "", singleton("bagit-support")));
        rules.put("Organization-Address",
                new ProfileFieldRule(required, repeatable, recommended, "", singleton("localhost-dot-localdomain")));
        final String bagInfoPath = "src/test/resources/sample/bag/bag-info.txt";
        ProfileValidationUtil.validate("profile-section", rules, Paths.get(bagInfoPath));
    }

@awoods
Copy link
Member

awoods commented Apr 25, 2020

Your last commit seems to revert your second.
3ebc32b

@mikejritter
Copy link
Contributor Author

@awoods nice catch... that was only supposed to remove the import, not sure what happened there. Cleaned it up with a577f12

@awoods awoods merged commit 68b5158 into duraspace:master Apr 28, 2020
@mikejritter mikejritter deleted the 16-profilevalidationutil-readinfo-failure branch August 19, 2020 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ProfileValidationUtil readInfo failure
3 participants