You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/06/06 14:28:17 UTC

[GitHub] [commons-lang] stevebosman-oc opened a new pull request, #907: Increase test coverage of functional interfaces

stevebosman-oc opened a new pull request, #907:
URL: https://github.com/apache/commons-lang/pull/907

   Primarily ensuring static interface methods are covered
   
   Contributed on behalf of the @opencastsoftware open source team


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] stevebosman-oc commented on pull request #907: Increase test coverage of functional interfaces

Posted by GitBox <gi...@apache.org>.
stevebosman-oc commented on PR #907:
URL: https://github.com/apache/commons-lang/pull/907#issuecomment-1148724767

   @kinow I can squash if you're happy with the new changes, but I'd rather wait and see what you think first


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] codecov-commenter commented on pull request #907: Increase test coverage of functional interfaces

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #907:
URL: https://github.com/apache/commons-lang/pull/907#issuecomment-1147518153

   # [Codecov](https://codecov.io/gh/apache/commons-lang/pull/907?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#907](https://codecov.io/gh/apache/commons-lang/pull/907?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b54ae9a) into [master](https://codecov.io/gh/apache/commons-lang/commit/4f08422f77b59a4f3427e675b3598c701a603854?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4f08422) will **increase** coverage by `0.21%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head b54ae9a differs from pull request most recent head a6e18d9. Consider uploading reports for the commit a6e18d9 to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master     #907      +/-   ##
   ============================================
   + Coverage     91.49%   91.71%   +0.21%     
   - Complexity     7397     7436      +39     
   ============================================
     Files           188      188              
     Lines         15953    15953              
     Branches       2999     2999              
   ============================================
   + Hits          14596    14631      +35     
   + Misses          764      728      -36     
   - Partials        593      594       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/commons-lang/pull/907?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...va/org/apache/commons/lang3/RandomStringUtils.java](https://codecov.io/gh/apache/commons-lang/pull/907/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvbGFuZzMvUmFuZG9tU3RyaW5nVXRpbHMuamF2YQ==) | `93.84% <0.00%> (-4.62%)` | :arrow_down: |
   | [...ache/commons/lang3/function/FailablePredicate.java](https://codecov.io/gh/apache/commons-lang/pull/907/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvbGFuZzMvZnVuY3Rpb24vRmFpbGFibGVQcmVkaWNhdGUuamF2YQ==) | `100.00% <0.00%> (+22.22%)` | :arrow_up: |
   | [...he/commons/lang3/function/FailableIntFunction.java](https://codecov.io/gh/apache/commons-lang/pull/907/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvbGFuZzMvZnVuY3Rpb24vRmFpbGFibGVJbnRGdW5jdGlvbi5qYXZh) | `100.00% <0.00%> (+100.00%)` | :arrow_up: |
   | [...e/commons/lang3/function/FailableLongFunction.java](https://codecov.io/gh/apache/commons-lang/pull/907/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvbGFuZzMvZnVuY3Rpb24vRmFpbGFibGVMb25nRnVuY3Rpb24uamF2YQ==) | `100.00% <0.00%> (+100.00%)` | :arrow_up: |
   | [.../commons/lang3/function/FailableToIntFunction.java](https://codecov.io/gh/apache/commons-lang/pull/907/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvbGFuZzMvZnVuY3Rpb24vRmFpbGFibGVUb0ludEZ1bmN0aW9uLmphdmE=) | `100.00% <0.00%> (+100.00%)` | :arrow_up: |
   | [...commons/lang3/function/FailableDoubleFunction.java](https://codecov.io/gh/apache/commons-lang/pull/907/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvbGFuZzMvZnVuY3Rpb24vRmFpbGFibGVEb3VibGVGdW5jdGlvbi5qYXZh) | `100.00% <0.00%> (+100.00%)` | :arrow_up: |
   | [...commons/lang3/function/FailableObjIntConsumer.java](https://codecov.io/gh/apache/commons-lang/pull/907/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvbGFuZzMvZnVuY3Rpb24vRmFpbGFibGVPYmpJbnRDb25zdW1lci5qYXZh) | `100.00% <0.00%> (+100.00%)` | :arrow_up: |
   | [...commons/lang3/function/FailableToLongFunction.java](https://codecov.io/gh/apache/commons-lang/pull/907/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvbGFuZzMvZnVuY3Rpb24vRmFpbGFibGVUb0xvbmdGdW5jdGlvbi5qYXZh) | `100.00% <0.00%> (+100.00%)` | :arrow_up: |
   | [...ommons/lang3/function/FailableObjLongConsumer.java](https://codecov.io/gh/apache/commons-lang/pull/907/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvbGFuZzMvZnVuY3Rpb24vRmFpbGFibGVPYmpMb25nQ29uc3VtZXIuamF2YQ==) | `100.00% <0.00%> (+100.00%)` | :arrow_up: |
   | [...ommons/lang3/function/FailableToIntBiFunction.java](https://codecov.io/gh/apache/commons-lang/pull/907/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvbGFuZzMvZnVuY3Rpb24vRmFpbGFibGVUb0ludEJpRnVuY3Rpb24uamF2YQ==) | `100.00% <0.00%> (+100.00%)` | :arrow_up: |
   | ... and [10 more](https://codecov.io/gh/apache/commons-lang/pull/907/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/commons-lang/pull/907?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/commons-lang/pull/907?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4f08422...a6e18d9](https://codecov.io/gh/apache/commons-lang/pull/907?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] jochenw merged pull request #907: Increase test coverage of functional interfaces

Posted by GitBox <gi...@apache.org>.
jochenw merged PR #907:
URL: https://github.com/apache/commons-lang/pull/907


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] stevebosman-oc commented on pull request #907: Increase test coverage of functional interfaces

Posted by GitBox <gi...@apache.org>.
stevebosman-oc commented on PR #907:
URL: https://github.com/apache/commons-lang/pull/907#issuecomment-1148448521

   There is repetition, but because there isn't a common interface for each nop, and each instance requires different parameter types in the apply call I can't see a good way of using a ParameterisedTest, e.g.
   
   ```
   assertNull(FailableBiFunction.nop().apply("Foo", "Bar"), "Expect NOP to return null");
   assertNull(FailableDoubleFunction.nop().apply(Double.MAX_VALUE), "Expect NOP to return null");
   assertNull(FailableIntFunction.nop().apply(Integer.MAX_VALUE), "Expect NOP to return null");
   assertNull(FailableLongFunction.nop().apply(Long.MAX_VALUE), "Expect NOP to return null");
   ```
   
   I could move the tests inside of FailableFunctionsTest either individually or bunched (similar to other tests in the class), e.g.
   
   ```
       @Test
       public void testFailablePrimitiveFunctionNops() throws Throwable {
           // NOP functions returning primitives should return default values and not throw exceptions
           assertEquals(0, FailableDoubleToIntFunction.nop().applyAsInt(Double.MAX_VALUE), "Expect NOP to return 0");
           assertEquals(0, FailableDoubleToLongFunction.nop().applyAsLong(Double.MAX_VALUE), "Expect NOP to return 0");
           assertEquals(0, FailableIntToDoubleFunction.nop().applyAsDouble(Integer.MAX_VALUE), "Expect NOP to return 0");
           assertEquals(0, FailableIntToLongFunction.nop().applyAsLong(Integer.MAX_VALUE), "Expect NOP to return 0");
           assertEquals(0, FailableLongToDoubleFunction.nop().applyAsDouble(Long.MAX_VALUE), "Expect NOP to return 0");
           assertEquals(0, FailableLongToIntFunction.nop().applyAsInt(Long.MAX_VALUE), "Expect NOP to return 0");
           assertEquals(0, FailableToIntFunction.nop().applyAsInt("Foo"), "Expect NOP to return 0");
           assertEquals(0, FailableToIntBiFunction.nop().applyAsInt("Foo", "Bar"), "Expect NOP to return 0");
           assertEquals(0, FailableToLongFunction.nop().applyAsLong("Foo"), "Expect NOP to return 0");
           assertEquals(0, FailableToLongBiFunction.nop().applyAsLong("Foo", "Bar"), "Expect NOP to return 0");
           assertEquals(0, FailableToDoubleFunction.nop().applyAsDouble("Foo"), "Expect NOP to return 0");
           assertEquals(0, FailableToDoubleBiFunction.nop().applyAsDouble("Foo", "Bar"), "Expect NOP to return 0");
       }
   
       @Test
       public void testFailableFunctionNops() throws Throwable {
           // NOP functions returning objects should return null and not throw exceptions
           assertNull(FailableBiFunction.nop().apply("Foo", "Bar"), "Expect NOP to return null");
           assertNull(FailableDoubleFunction.nop().apply(Double.MAX_VALUE), "Expect NOP to return null");
           assertNull(FailableIntFunction.nop().apply(Integer.MAX_VALUE), "Expect NOP to return null");
           assertNull(FailableLongFunction.nop().apply(Long.MAX_VALUE), "Expect NOP to return null");
       }
   
       @Test
       public void testFailableConsumerNops() throws Throwable {
           // NOP Consumers should not throw exceptions
           FailableConsumer.nop().accept("Foo");
           FailableDoubleConsumer.nop().accept(Double.MAX_VALUE);
           FailableIntConsumer.nop().accept(Integer.MAX_VALUE);
           FailableLongConsumer.nop().accept(Long.MAX_VALUE);
           FailableObjDoubleConsumer.nop().accept("Foo", Double.MAX_VALUE);
           FailableObjIntConsumer.nop().accept("Foo", Integer.MAX_VALUE);
           FailableObjLongConsumer.nop().accept("Foo", Long.MAX_VALUE);
       }
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] stevebosman-oc commented on pull request #907: Increase test coverage of functional interfaces

Posted by GitBox <gi...@apache.org>.
stevebosman-oc commented on PR #907:
URL: https://github.com/apache/commons-lang/pull/907#issuecomment-1148703388

   I don't really like tests which cover many different things, so I'll move them into FailableFunctionsTest as one test per Nop


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] kinow commented on pull request #907: Increase test coverage of functional interfaces

Posted by GitBox <gi...@apache.org>.
kinow commented on PR #907:
URL: https://github.com/apache/commons-lang/pull/907#issuecomment-1148545799

   >There is repetition, but because there isn't a common interface for each nop, and each instance requires different parameter types in the apply call I can't see a good way of using a ParameterisedTest, e.g.
   
   Good point. Just checked out the branch and also couldn't come up with parameterised tests.
   
   >I could move the tests inside of FailableFunctionsTest either individually or bunched (similar to other tests in the class), e.g.
   
   Hmmm, I **think** this option might be simpler as we have already the other methods being tested in the same class. Otherwise the individual test classes are testing only the `nop` method.
   
   But we can leave the PR as-is and wait others to review if you'd like. For me either way is fine.
   
   Thanks!
   -Bruno


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org