>From: "CONNER, BRENDAN (SBCSI)" <[EMAIL PROTECTED]> > > OK, sorry for being a little dense about this, but, if, for example, my > application code is referencing a FacesContext object, and my Test code > initializes MockFacesContext, what is the mechanism that makes my > application use the values that are in MockFacesContext? I understand > that MockFacesContext is a subclass of FacesContext, but I don't > understand how my application ends up using the values in the > MockFacesContext instance instead that were initialized by the test > case. >
The idea is that you extend a base test case that sets up the mock objects. They are scoped so that they can be referenced from test methods in a subclass. Take a look at the AbstractJsfTestCase (http://svn.apache.org/viewcvs.cgi/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java?view=markup) > - Brendan > Gary