You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Jon Moore (JIRA)" <ji...@apache.org> on 2012/10/04 18:11:47 UTC

[jira] [Created] (HTTPCLIENT-1244) convert unit tests for cache module to use Mockito

Jon Moore created HTTPCLIENT-1244:
-------------------------------------

             Summary: convert unit tests for cache module to use Mockito
                 Key: HTTPCLIENT-1244
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1244
             Project: HttpComponents HttpClient
          Issue Type: Improvement
          Components: Cache
            Reporter: Jon Moore


Currently the unit tests for the caching module, while comprehensive, use strict mocks from EasyMock. In many cases, these tests are brittle in ways they shouldn't be. Converting to Mockito (as the rest of the httpclient codebase does) would potentially help here, as well as unifying the unit test frameworks used across the codebase.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1244) convert unit tests for cache module to use Mockito

Posted by "Joe Campbell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13471099#comment-13471099 ] 

Joe Campbell commented on HTTPCLIENT-1244:
------------------------------------------

I think actually - that I converted the last of the original mockito tests that existed in the HTTPclient code base when the caching client was originally submitted.  Rather I think what we would like to do is change the 'strict' mock default of EasyMock to the 'relaxed' version so that additional calls that are made the don't impact the over all compliance can be added without impacting hundreds of unit tests.

Thoughts?
                
> convert unit tests for cache module to use Mockito
> --------------------------------------------------
>
>                 Key: HTTPCLIENT-1244
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1244
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>            Reporter: Jon Moore
>              Labels: test
>             Fix For: Future
>
>
> Currently the unit tests for the caching module, while comprehensive, use strict mocks from EasyMock. In many cases, these tests are brittle in ways they shouldn't be. Converting to Mockito (as the rest of the httpclient codebase does) would potentially help here, as well as unifying the unit test frameworks used across the codebase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCLIENT-1244) convert unit tests for cache module to use Mockito

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski updated HTTPCLIENT-1244:
------------------------------------------

    Fix Version/s: Future
    
> convert unit tests for cache module to use Mockito
> --------------------------------------------------
>
>                 Key: HTTPCLIENT-1244
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1244
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>            Reporter: Jon Moore
>              Labels: test
>             Fix For: Future
>
>
> Currently the unit tests for the caching module, while comprehensive, use strict mocks from EasyMock. In many cases, these tests are brittle in ways they shouldn't be. Converting to Mockito (as the rest of the httpclient codebase does) would potentially help here, as well as unifying the unit test frameworks used across the codebase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1244) convert unit tests for cache module to use Mockito

Posted by "Joe Campbell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13471360#comment-13471360 ] 

Joe Campbell commented on HTTPCLIENT-1244:
------------------------------------------

Ok - Attached is a patch that just does the createMock --> createNiceMock conversion for the caching unit tests.  Will work on converting to mockito at some point in the nearish future.  Can I assume that it is an apache standard to use mockito...

Thanks,
     Joe
                
> convert unit tests for cache module to use Mockito
> --------------------------------------------------
>
>                 Key: HTTPCLIENT-1244
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1244
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>            Reporter: Jon Moore
>              Labels: test
>             Fix For: Future
>
>         Attachments: niceMockTransition_.patch
>
>
> Currently the unit tests for the caching module, while comprehensive, use strict mocks from EasyMock. In many cases, these tests are brittle in ways they shouldn't be. Converting to Mockito (as the rest of the httpclient codebase does) would potentially help here, as well as unifying the unit test frameworks used across the codebase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1244) convert unit tests for cache module to use Mockito

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13471323#comment-13471323 ] 

Oleg Kalnichevski commented on HTTPCLIENT-1244:
-----------------------------------------------

Joe et al
Switching EasyMock to the 'relaxed' mode would certainly be a reasonable immediate action. It would great if some one familiar with EasyMock could look into it. However. long term we should migrate the caching unit  tests to Mockito. 

Oleg
                
> convert unit tests for cache module to use Mockito
> --------------------------------------------------
>
>                 Key: HTTPCLIENT-1244
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1244
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>            Reporter: Jon Moore
>              Labels: test
>             Fix For: Future
>
>
> Currently the unit tests for the caching module, while comprehensive, use strict mocks from EasyMock. In many cases, these tests are brittle in ways they shouldn't be. Converting to Mockito (as the rest of the httpclient codebase does) would potentially help here, as well as unifying the unit test frameworks used across the codebase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1244) convert unit tests for cache module to use Mockito

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13471617#comment-13471617 ] 

Oleg Kalnichevski commented on HTTPCLIENT-1244:
-----------------------------------------------

Patch committed to both SVN trunk and 4.2.x branch. Many thanks, Joe, for contributing it.

To my best knowledge the only standards that ASF enforces is licensing.  Otherwise it is pretty much up to individual projects to decide what kind of ALv2 compatible software to use. I am personally biased toward Mockito, but could live with any mocking framework as long as it is being used consistently across all HC projects and modules. At present migration off EasyMock to Mockito looks easier.

Oleg 
                
> convert unit tests for cache module to use Mockito
> --------------------------------------------------
>
>                 Key: HTTPCLIENT-1244
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1244
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>            Reporter: Jon Moore
>              Labels: test
>             Fix For: Future
>
>         Attachments: niceMockTransition_.patch
>
>
> Currently the unit tests for the caching module, while comprehensive, use strict mocks from EasyMock. In many cases, these tests are brittle in ways they shouldn't be. Converting to Mockito (as the rest of the httpclient codebase does) would potentially help here, as well as unifying the unit test frameworks used across the codebase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCLIENT-1244) convert unit tests for cache module to use Mockito

Posted by "Joe Campbell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Campbell updated HTTPCLIENT-1244:
-------------------------------------

    Attachment: niceMockTransition_.patch
    
> convert unit tests for cache module to use Mockito
> --------------------------------------------------
>
>                 Key: HTTPCLIENT-1244
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1244
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>            Reporter: Jon Moore
>              Labels: test
>             Fix For: Future
>
>         Attachments: niceMockTransition_.patch
>
>
> Currently the unit tests for the caching module, while comprehensive, use strict mocks from EasyMock. In many cases, these tests are brittle in ways they shouldn't be. Converting to Mockito (as the rest of the httpclient codebase does) would potentially help here, as well as unifying the unit test frameworks used across the codebase.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org