« Return to Thread: AbstractJsfTestCase question

Re: AbstractJsfTestCase question

by Venkataganesh Thoppae :: Rate this Message:

Reply to Author | View in Thread

Yes, I know Shale doesn't read faces-config.
Here is a sample implementation.

public class MyTestCase extends AbstractJsfTestCase {
//A valid someBean object is created in the request scope in setUp()

@Test
public void test1 {
    String val=
(String)facesContext.getApplication().createValueBinding("#{someBean.prop[0]}"};
    assertEquals(val, "M");
}
}

The error I get is:
javax.faces.el.PropertyNotFoundException: prop0
    at
org.apache.shale.test.mock.MockPropertyResolver.descriptor(MockPropertyResolver.java:213)
    at
org.apache.shale.test.mock.MockPropertyResolver.getValue(MockPropertyResolver.java:69)
    at
org.apache.shale.test.mock.MockValueBinding.getValue(MockValueBinding.java:126)






Regards



On Mon, May 19, 2008 at 12:08 PM, Kito D. Mann <kmann@...> wrote:

> Hmm... What errors are you getting? Or is it just returning null? If it's
> just returning null, remember that you must manually but the bean in the
> proper scope - Shale doesn't read faces-config.
>
> Sent from my iPhone
>
>
> On May 19, 2008, at 11:07 AM, "Venkataganesh Thoppae" <tkvganesh@...>
> wrote:
>
>  New user of Shale Test framework. I'm trying to write some test cases for
>> JSF 1.1 implementation using AbstractJsfTestCase.
>>
>> Experiencing few problems while trying to resolve some EL expressions
>> programmatically.
>> - MockVariableResolver not able to resolve array elements like
>> #{someBean.property[0]}
>> - How would I resolve an expression like #{someBean.name == "John Doe"}
>> - How could I invoke static EL functions like #{prefix:fnName}
>>
>> Advance Thanks for your help.
>>
>


--

 « Return to Thread: AbstractJsfTestCase question