On 1/1/07, Paul Spencer <[EMAIL PROTECTED]> wrote:
How do I load faces-config.xml when running a test based on
AbstractJsfTestCase?
My current testing manually adds the renderers during setUp(). This work,
but it has the
following drawbacks:
1) The association between a component and it renderer must be maintained
in more
then one place.
2) Testing with more then one JSF Implementation is a lot of extra work.
Ideally I would like to instruct shale-test to load the implementation's
jsf configuration file, i.e. faces-config.xml. How do I do this?
There is an outstanding Shale RFE for this feature already[1], and seeing
what you were doing kind of motivated me to start working on it a bit in
between plays in the football games today :-). My thinking is to provide an
optional utility helper (based on Commons Digester) with a parse(URL) method
that you could call to register things like components, converters,
validators, renderkits, and renderers. The parser would typically be called
during a setUp() method of a test case.
We'll still have an implementation-specific issue for dealing with the
registration of the standard components (since MyFaces and the RI use
different resource names), but that's probably something that can be
abstracted into a "get me the URL(s) of the standard component definitions"
method that could isolate the differences into one place.
Is this what you had in mind?
Paul Spencer
Craig
[1] https://issues.apache.org/struts/browse/SHALE-262