[hibernate-dev] Mocking for unit tests
Emmanuel Bernard
emmanuel at hibernate.org
Tue Mar 29 11:48:52 EDT 2011
Hi Tom,
Most tests in HSearch are more integration / functional tests than true unit tests. Since we can tests everything with in-memory components it ends up quite fast and more "real life".
If you feel that there is no way to reproduce the issue at hand in a functional test, is that:
- because you can't reproduce
- because it would require too much work?
All in all, if you need Mockito, we can add it as a test dependency. but if we can find a way to test the problem with a functional / integration test that would be preferable.
Emmanuel
On 28 mars 2011, at 21:12, Tom Waterhouse wrote:
> I've completed a unit test for HSEARCH-679. Testing the issue was made
> easier using mock objects, as I needed to mock SearchFactoryImplementor and
> Worker to determine if indexing work was created during transaction commit.
>
> The mocking library I've used recently is Mockito, and is the library used
> for the test. I don't know that mocks have been used to this point for
> Hibernate Search testing. Mockito/mocking is acceptable?
>
> You can see the test I created as an attachment to HSEARCH-679.
>
> Tom
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
More information about the hibernate-dev
mailing list