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 2021/09/16 06:53:15 UTC

[GitHub] [commons-rng] wx930910 opened a new pull request #102: replace test child class with mocking object

wx930910 opened a new pull request #102:
URL: https://github.com/apache/commons-rng/pull/102


   Fix [RNG-164](https://issues.apache.org/jira/browse/RNG-164)
   
   ### Description
   
   #### Replace test class [SimpleSampler](https://github.com/apache/commons-rng/blob/42a5151f9e2433ce84a6a77299cacbc389dcb870/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/SamplerBaseTest.java#L33) by mocking object and improve test design
   <hr>
   
   ##### Motivation
   
   - Decouple test class `SimpleSampler` from production interface `SamplerBase`.
   - Remove the redundant test child class `SimpleSampler`.
   
   <hr>
   
   ##### Key changed/added classes in this PR
    * Created mocking object to replace test subclass `SimpleSampler`, decoupled test from production code.
    * Make test logic more clear by using method stub instead of method overriding.
    * Add Mockito dependency
   
   <hr>


-- 
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-rng] wx930910 closed pull request #102: replace test child class with mocking object

Posted by GitBox <gi...@apache.org>.
wx930910 closed pull request #102:
URL: https://github.com/apache/commons-rng/pull/102


   


-- 
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-rng] coveralls commented on pull request #102: replace test child class with mocking object

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #102:
URL: https://github.com/apache/commons-rng/pull/102#issuecomment-920638791


   
   [![Coverage Status](https://coveralls.io/builds/42914221/badge)](https://coveralls.io/builds/42914221)
   
   Coverage remained the same at 99.758% when pulling **6a111bf2ab50137c21d1fafbf6c060f8262f10ab on wx930910:refactor-SimpleSampler** into **55e02d4387eb9eae48f93e717b7bd65baafc63fd on apache:master**.
   


-- 
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-rng] wx930910 commented on pull request #102: replace test child class with mocking object

Posted by GitBox <gi...@apache.org>.
wx930910 commented on pull request #102:
URL: https://github.com/apache/commons-rng/pull/102#issuecomment-927408783


   Fixed by removing the redundant test subclass and directly test the parent class: [Directly test the SamplerBase class](https://github.com/apache/commons-rng/commit/f5f958c7a2eec722a828a5fcb7acad3c2cf52c62)


-- 
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-rng] wx930910 commented on pull request #102: replace test child class with mocking object

Posted by GitBox <gi...@apache.org>.
wx930910 commented on pull request #102:
URL: https://github.com/apache/commons-rng/pull/102#issuecomment-920628912


   Actually we can further improve the code logic by spying parent production class SamplerBase since all the overridden methods only call super methods defined in the parent class. In that case, we can get replace the child class by the spying object.


-- 
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