You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@asterixdb.apache.org by Yingyi Bu <bu...@gmail.com> on 2015/09/18 20:00:45 UTC

MockIto for unit tests

Guys,

MockIto is a really nice framework which allows us to very easily do unit
tests:
http://mockito.org/

Here is an example for how I use it:
https://github.com/apache/incubator-asterixdb/blob/master/asterix-app/src/test/java/org/apache/asterix/api/http/servlet/ConnectorAPIServletTest.java

Let's write more unit tests for our code:-)

Best,
Yingyi

Re: MockIto for unit tests

Posted by Jianfeng Jia <ji...@gmail.com>.
+1 Great tools!
Then we can rely more on the unit test, which will be much faster than of bringing up part of system again and again.
The mvn verify should work in minutes.

> On Sep 18, 2015, at 11:12 AM, Yingyi Bu <bu...@gmail.com> wrote:
> 
> BTW, combining MockIto and privilegedaccessor (junit.extensions.PA),  you
> can test almost everything, e.g., private methods, private variables:-)
> 
> Best,
> Yingyi
> 
> On Fri, Sep 18, 2015 at 11:00 AM, Yingyi Bu <bu...@gmail.com> wrote:
> 
>> Guys,
>> 
>> MockIto is a really nice framework which allows us to very easily do unit
>> tests:
>> http://mockito.org/
>> 
>> Here is an example for how I use it:
>> 
>> https://github.com/apache/incubator-asterixdb/blob/master/asterix-app/src/test/java/org/apache/asterix/api/http/servlet/ConnectorAPIServletTest.java
>> 
>> Let's write more unit tests for our code:-)
>> 
>> Best,
>> Yingyi
>> 



Best,

Jianfeng Jia
PhD Candidate of Computer Science
University of California, Irvine


Re: MockIto for unit tests

Posted by Yingyi Bu <bu...@gmail.com>.
BTW, combining MockIto and privilegedaccessor (junit.extensions.PA),  you
can test almost everything, e.g., private methods, private variables:-)

Best,
Yingyi

On Fri, Sep 18, 2015 at 11:00 AM, Yingyi Bu <bu...@gmail.com> wrote:

> Guys,
>
> MockIto is a really nice framework which allows us to very easily do unit
> tests:
> http://mockito.org/
>
> Here is an example for how I use it:
>
> https://github.com/apache/incubator-asterixdb/blob/master/asterix-app/src/test/java/org/apache/asterix/api/http/servlet/ConnectorAPIServletTest.java
>
> Let's write more unit tests for our code:-)
>
> Best,
> Yingyi
>