Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

General SetupSpecificsPreferred ApproachExample
Class under tests operates on JCR Nodefew calls to common methods of the NodeMockNode if it supports those calls, Mockito mock else 
 need a simple hierarchy of NodesMockNode if it supports those calls, Mockito mock else 
 need a simple hierarchy of Nodes but with several propertiesuse SessionTestUtil to instantiate MockSession + MockNodes from propertiesStream or String 
 need a complex hierarchy of Nodes, real NodeTypes or issue real queriesuse 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/