You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by Paul Spencer <pa...@apache.org> on 2007/05/11 05:16:11 UTC

How to use ConfigParser()?

I am trying to convert a test utility method that adds renders and other JSF components to the
ConfigParser in 1.1.0-SNAPSHOT, but I getting nulls from context.getRenderKit().getRenderer(...)

I have added the following in the utility method, which is NOT in an class that extends any of the
shale abstract test classes. The method is called by the test's setUp() after super.setUp().

         ConfigParser parser = new ConfigParser();
         URL[] urls = parser.getPlatformURLs();
         parser.parse(urls);

Where the prior addRender() method passed FacesContext, I am not passing it to the ConfigParser.  Is
this the problem? See the addDefaultRenderers() method in the test utility class [1] for a more complete
example.

Paul Spencer

[1]http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/test/utils/TestUtils.java?view=markup

Re: How to use ConfigParser()?

Posted by Paul Spencer <pa...@apache.org>.
I found the problem.  The test was using a Tomahawk component.  Since
the ConfigParser does not load Tomahawk's JSF configuration, the render
was not defined.  My concerns around the absents of FacesContext where
unfounded because the context is not need when adding renderers.

Paul Spencer

Paul Spencer wrote:
> I am trying to convert a test utility method that adds renders and other 
> JSF components to the
> ConfigParser in 1.1.0-SNAPSHOT, but I getting nulls from 
> context.getRenderKit().getRenderer(...)
> 
> I have added the following in the utility method, which is NOT in an 
> class that extends any of the
> shale abstract test classes. The method is called by the test's setUp() 
> after super.setUp().
> 
>         ConfigParser parser = new ConfigParser();
>         URL[] urls = parser.getPlatformURLs();
>         parser.parse(urls);
> 
> Where the prior addRender() method passed FacesContext, I am not passing 
> it to the ConfigParser.  Is
> this the problem? See the addDefaultRenderers() method in the test 
> utility class [1] for a more complete
> example.
> 
> Paul Spencer
> 
> [1]http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/test/utils/TestUtils.java?view=markup 
> 
>