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/08 19:49:49 UTC

[GitHub] [commons-pool] wx930910 opened a new pull request #98: Replace SingleObjectFactory with mocking object and improve test design

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


   Fixes [POOL-400](https://issues.apache.org/jira/browse/POOL-400)
   
   ### Description
   Replace test class [SingleObjectFactory](https://github.com/apache/commons-pool/blob/dbb4ca0bc969464f31435867a0800fc766f31068/src/test/java/org/apache/commons/pool2/impl/TestGenericObjectPoolFactoryCreateFailure.java#L38) by mocking object created by Mockito.
   
   <hr>
   
   ##### Key changed/added classes in this PR
   - Create mocking object to replace test subclass `SingleObjectFactory`, decouple test from production code.
   - Extract the AtomicBoolean attribute and use the extracted attribute in test case to check method `created()` invocation status.
   - Make test logic more clear by using method stub instead of method overriding.
   - Introduce 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-pool] coveralls commented on pull request #98: Replace SingleObjectFactory with mocking object and improve test design

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


   
   [![Coverage Status](https://coveralls.io/builds/42741446/badge)](https://coveralls.io/builds/42741446)
   
   Coverage decreased (-0.06%) to 84.892% when pulling **30ba8e17cd961074963462ee4702fd2bba80871e on wx930910:refactor-TestGenericObjectPoolFactoryCreateFailure** into **5ffbba589df84c948d171f015e6c3ce90dc0dc8f 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-pool] garydgregory commented on pull request #98: Replace SingleObjectFactory with mocking object and improve test design

Posted by GitBox <gi...@apache.org>.
garydgregory commented on pull request #98:
URL: https://github.com/apache/commons-pool/pull/98#issuecomment-915766073


   This PR looks to me a lot harder to follow than the comparatively simple subclass. What do others think? 


-- 
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-pool] markt-asf commented on pull request #98: Replace SingleObjectFactory with mocking object and improve test design

Posted by GitBox <gi...@apache.org>.
markt-asf commented on pull request #98:
URL: https://github.com/apache/commons-pool/pull/98#issuecomment-915831043


   Agreed. I don't see what benefit we are getting for the added complexity.
   


-- 
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-pool] garydgregory closed pull request #98: Replace SingleObjectFactory with mocking object and improve test design

Posted by GitBox <gi...@apache.org>.
garydgregory closed pull request #98:
URL: https://github.com/apache/commons-pool/pull/98


   


-- 
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-pool] garydgregory commented on pull request #98: Replace SingleObjectFactory with mocking object and improve test design

Posted by GitBox <gi...@apache.org>.
garydgregory commented on pull request #98:
URL: https://github.com/apache/commons-pool/pull/98#issuecomment-945132232


   Closing per our comments.
   


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