Page History
...
General Setup | Specifics | Preferred Approach | Example |
---|---|---|---|
Class under tests operates on JCR Node | few calls to common methods of the Node | MockNode if it supports those calls, Mockito mock else | |
need a simple hierarchy of Nodes | MockNode if it supports those calls, Mockito mock else | ||
need a simple hierarchy of Nodes but with several properties | use SessionTestUtil to instantiate MockSession + MockNodes from propertiesStream or String | ||
need a complex hierarchy of Nodes, real NodeTypes or issue real queries | use RepositoryTestCase |
Resources
Mock Object: http://en.wikipedia.org/wiki/Mock_object
Mockito Documentation: http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html
Mockito Examples: http://gojko.net/2009/10/23/mockito-in-six-easy-examples/
Overview
Content Tools