You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (JIRA)" <ji...@apache.org> on 2010/05/12 15:37:41 UTC

[jira] Created: (HTTPCLIENT-941) Standardize on a common mocking framework (either EasyMock or Mockito)

Standardize on a common mocking framework (either EasyMock or Mockito)
----------------------------------------------------------------------

                 Key: HTTPCLIENT-941
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-941
             Project: HttpComponents HttpClient
          Issue Type: Improvement
          Components: Cache, HttpAuth
            Reporter: Oleg Kalnichevski
             Fix For: 4.1 Alpha3


We are currently using EasyMock in the caching module and Mockito in the main module. While Mockito appears to have a somewhat nicer API, the sheer number of test cases based on EasyMock in the caching module makes it much simpler to replace Mockito with EasyMock than the other way around.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-941) Standardize on a common mocking framework (either EasyMock or Mockito)

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

Joe Campbell commented on HTTPCLIENT-941:
-----------------------------------------

I was only able to find one use of Mockito in the whole project, and at that in just one test file... Did I miss something?  Attached please find the patch converting that one test case to use EasyMock.

My Company, Comcast, has authorized me to submit this patch to you and grants all license to the Apache Foundation.

> Standardize on a common mocking framework (either EasyMock or Mockito)
> ----------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-941
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-941
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache, HttpAuth
>            Reporter: Oleg Kalnichevski
>             Fix For: 4.1 Alpha3
>
>
> We are currently using EasyMock in the caching module and Mockito in the main module. While Mockito appears to have a somewhat nicer API, the sheer number of test cases based on EasyMock in the caching module makes it much simpler to replace Mockito with EasyMock than the other way around.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-941) Standardize on a common mocking framework (either EasyMock or Mockito)

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

Oleg Kalnichevski commented on HTTPCLIENT-941:
----------------------------------------------

I struggled somewhat with EasyMock and found Mockito slightly cleaner and more expressive. That is why I was not sure which one to keep. EasyMock it is.

Oleg 

> Standardize on a common mocking framework (either EasyMock or Mockito)
> ----------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-941
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-941
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache, HttpAuth
>            Reporter: Oleg Kalnichevski
>             Fix For: 4.1 Alpha3
>
>         Attachments: Convert_httpclient_from_Mockito_to_EasyMock_.patch
>
>
> We are currently using EasyMock in the caching module and Mockito in the main module. While Mockito appears to have a somewhat nicer API, the sheer number of test cases based on EasyMock in the caching module makes it much simpler to replace Mockito with EasyMock than the other way around.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (HTTPCLIENT-941) Standardize on a common mocking framework (either EasyMock or Mockito)

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

Joe Campbell updated HTTPCLIENT-941:
------------------------------------

    Attachment: Convert_httpclient_from_Mockito_to_EasyMock_.patch

Patch changing Mockito to EasyMock.

> Standardize on a common mocking framework (either EasyMock or Mockito)
> ----------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-941
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-941
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache, HttpAuth
>            Reporter: Oleg Kalnichevski
>             Fix For: 4.1 Alpha3
>
>         Attachments: Convert_httpclient_from_Mockito_to_EasyMock_.patch
>
>
> We are currently using EasyMock in the caching module and Mockito in the main module. While Mockito appears to have a somewhat nicer API, the sheer number of test cases based on EasyMock in the caching module makes it much simpler to replace Mockito with EasyMock than the other way around.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-941) Standardize on a common mocking framework (either EasyMock or Mockito)

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

Oleg Kalnichevski commented on HTTPCLIENT-941:
----------------------------------------------

As far as I know Mockito started out as a fork of EasyMock. Both frameworks share a lot in common due to that. I find Mockito slightly nicer as it eliminates those pesky replay / verify calls.

http://code.google.com/p/mockito/wiki/MockitoVSEasyMock 

Oleg

> Standardize on a common mocking framework (either EasyMock or Mockito)
> ----------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-941
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-941
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache, HttpAuth
>            Reporter: Oleg Kalnichevski
>             Fix For: 4.1 Alpha3
>
>         Attachments: Convert_httpclient_from_Mockito_to_EasyMock_.patch
>
>
> We are currently using EasyMock in the caching module and Mockito in the main module. While Mockito appears to have a somewhat nicer API, the sheer number of test cases based on EasyMock in the caching module makes it much simpler to replace Mockito with EasyMock than the other way around.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-941) Standardize on a common mocking framework (either EasyMock or Mockito)

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

Joe Campbell commented on HTTPCLIENT-941:
-----------------------------------------

Yeah - As I was doing the conversion I noted that they are syntactically only slight variations of one another.  They also follow slightly different mocking philosophy:

Mockito by default seems to create a 'Nice' mock

EasyMock by default seems to create a 'Strict' mock

Not entirely sure which one I like better, they both seem to fit the bill.

Thanks Oleg,
    Joe



> Standardize on a common mocking framework (either EasyMock or Mockito)
> ----------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-941
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-941
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache, HttpAuth
>            Reporter: Oleg Kalnichevski
>             Fix For: 4.1 Alpha3
>
>         Attachments: Convert_httpclient_from_Mockito_to_EasyMock_.patch
>
>
> We are currently using EasyMock in the caching module and Mockito in the main module. While Mockito appears to have a somewhat nicer API, the sheer number of test cases based on EasyMock in the caching module makes it much simpler to replace Mockito with EasyMock than the other way around.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Resolved: (HTTPCLIENT-941) Standardize on a common mocking framework (either EasyMock or Mockito)

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

Oleg Kalnichevski resolved HTTPCLIENT-941.
------------------------------------------

    Resolution: Fixed

Patch checked in. Many thanks, Joe

> Standardize on a common mocking framework (either EasyMock or Mockito)
> ----------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-941
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-941
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache, HttpAuth
>            Reporter: Oleg Kalnichevski
>             Fix For: 4.1 Alpha3
>
>         Attachments: Convert_httpclient_from_Mockito_to_EasyMock_.patch
>
>
> We are currently using EasyMock in the caching module and Mockito in the main module. While Mockito appears to have a somewhat nicer API, the sheer number of test cases based on EasyMock in the caching module makes it much simpler to replace Mockito with EasyMock than the other way around.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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