You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Johan Oskarsson (JIRA)" <ji...@apache.org> on 2009/06/22 00:42:07 UTC

[jira] Commented: (CASSANDRA-250) Add mocking library to lib

    [ https://issues.apache.org/jira/browse/CASSANDRA-250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722432#action_12722432 ] 

Johan Oskarsson commented on CASSANDRA-250:
-------------------------------------------

While writing tests for CASSANDRA-249 I tried out mockito http://mockito.org/ - I have never used it before myself but it seems very easy to use with minimal code. I could mock out the huge Gossiper class to just respond to the few methods call I needed just the way I wanted to.
Mockito is MIT license and all other looks to be Apache v2 compatible.

> Add mocking library to lib
> --------------------------
>
>                 Key: CASSANDRA-250
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-250
>             Project: Cassandra
>          Issue Type: Task
>            Reporter: Johan Oskarsson
>            Priority: Trivial
>             Fix For: 0.4
>
>
> Cassandra in it's current state can be hard to write unit tests for, the classes are tightly coupled, a lot of variables and code is static. For example some 10 threads start up when you call a static method on MessagingService, even though all that method does is convert a byte array to a short. 
> Should we make use of a mocking library to help us make it easier to write certain tests?

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