Re: AbstractJsfTestCase question
Fine. Understandable. Thanks. On Tue, May 20, 2008 at 4:07 PM, Gary VanMatre <[EMAIL PROTECTED]> wrote: > The shale mock value binding has limited EL support. > > [] #parse - > http://svn.apache.org/viewvc/shale/framework/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockValueBinding.java?view=markup > -- Original message -- > From: "Venkataganesh Thoppae" <[EMAIL PROTECTED]> > > Actually I missed that part while typing a sample code. > > But here is a clean test case runnable if you have shale-test-x.jar. > > Appreciate if someone could try this on their box. > > > > Two files are attached. > > MyTestCase.java has test cases defined. > > SomeBean is a simple POJO. > > > > Thanks > > > > On Tue, May 20, 2008 at 10:57 AM, Chris Keefer <[EMAIL PROTECTED]> wrote: > > > > > I think in JSF 1.1 you have to get the value from a ValueBinding. See > > > below. > > > > > > @Test > > > public void test1 { > > >ValueBinding binding = > > > > facesContext.getApplication().createValueBinding("#{someBean.prop[0]}"}; > > >String val = (String) binding.getValue(facesContext); > > >assertEquals(val, "M"); > > > } > > > > > > > > > Or you can try the VariableResolver like so: > > > > > > @Test > > > public void test1 { > > >String val = > > > > > > facesContext.getApplication().getVariableResolver().resolveVariable(facesContext > > , > > > "#{someBean.prop[0]}"); > > >assertEquals(val, "M"); > > > } > > > > > > Hope this helps. > > > > > > --Chris > > > > > > > > > > > > > > > On May 19, 2008, at 1:06 PM, Venkataganesh Thoppae wrote: > > > > > > 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.ja > > va: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 <[EMAIL PROTECTED]> > 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" < > > >>> [EMAIL PROTECTED]> > > >>> 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. > > > > > > >>> > > >> > > >> -- > > >> > > > > > > > > > > > > -- > > Regards > > Venkat Thoppae > > (240)446-7632 > > > > > -- Forwarded message -- > From: "Venkataganesh Thoppae" <[EMAIL PROTECTED]> > To: user@shale.apache.org > Date: Tue, 20 May 2008 18:27:48 + > Subject: Re: AbstractJsfTestCase question > Actually I missed that part while typing a sample code. > But here is a clean test case runnable if you have shale-test-x.jar. > Appreciate if someone could try this on their box. > > Two files are attached. > MyTestCase.java has test cases defined. > SomeBean is a simple POJO. > > Thanks > > On Tue, May 20, 2008 at 10:57 AM, Chris Keefer <[EMAIL PROTECTED]> wrote: > >> I think in JSF 1.1 you have to get the value from a ValueBinding. See >> below. >> >> @Test >> public void test1 { >>ValueBinding binding = >> facesContext.getApplication().createValueBinding("#{someBean.prop[0]}"}; >>String val = (String) binding.getValue(facesContext); >>assertEquals(val, "M"); >> } >> >> >> Or you can try the VariableResolver like so: >> >> @Test >> public void test1 { >>String val = >> facesContext.getApplication().getVariableResolver().resolveVariable(facesContext, >> "#{someBean.prop[0]}"); >>assertEquals(val, "M"); >> } >> >> Hope this helps. >> >> --Chris >> >> >
Re: AbstractJsfTestCase question
The shale mock value binding has limited EL support. [] #parse - http://svn.apache.org/viewvc/shale/framework/trunk/shale-test/src/main/java/org/apache/shale/test/mock/MockValueBinding.java?view=markup -- Original message -- From: "Venkataganesh Thoppae" <[EMAIL PROTECTED]> > Actually I missed that part while typing a sample code. > But here is a clean test case runnable if you have shale-test-x.jar. > Appreciate if someone could try this on their box. > > Two files are attached. > MyTestCase.java has test cases defined. > SomeBean is a simple POJO. > > Thanks > > On Tue, May 20, 2008 at 10:57 AM, Chris Keefer <[EMAIL PROTECTED]> wrote: > > > I think in JSF 1.1 you have to get the value from a ValueBinding. See > > below. > > > > @Test > > public void test1 { > >ValueBinding binding = > > facesContext.getApplication().createValueBinding("#{someBean.prop[0]}"}; > >String val = (String) binding.getValue(facesContext); > >assertEquals(val, "M"); > > } > > > > > > Or you can try the VariableResolver like so: > > > > @Test > > public void test1 { > >String val = > > > facesContext.getApplication().getVariableResolver().resolveVariable(facesContext > , > > "#{someBean.prop[0]}"); > >assertEquals(val, "M"); > > } > > > > Hope this helps. > > > > --Chris > > > > > > > > > > On May 19, 2008, at 1:06 PM, Venkataganesh Thoppae wrote: > > > > 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.ja > va: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 <[EMAIL PROTECTED]> 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" < > >>> [EMAIL PROTECTED]> > >>> 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. > > > >>> > >> > >> -- > >> > > > > > > > -- > Regards > Venkat Thoppae > (240)446-7632 --- Begin Message --- Actually I missed that part while typing a sample code. But here is a clean test case runnable if you have shale-test-x.jar. Appreciate if someone could try this on their box. Two files are attached. MyTestCase.java has test cases defined. SomeBean is a simple POJO. Thanks On Tue, May 20, 2008 at 10:57 AM, Chris Keefer <[EMAIL PROTECTED]> wrote: > I think in JSF 1.1 you have to get the value from a ValueBinding. See > below. > > @Test > public void test1 { >ValueBinding binding = > facesContext.getApplication().createValueBinding("#{someBean.prop[0]}"}; >String val = (String) binding.getValue(facesContext); >assertEquals(val, "M"); > } > > > Or you can try the VariableResolver like so: > > @Test > public void test1 { >String val = > facesContext.getApplication().getVariableResolver().resolveVariable(facesContext, > "#{someBean.prop[0]}"); >assertEquals(val, "M"); > } > > Hope this helps. > > --Chris > > > > > On May 19, 2008, at 1:06 PM, Venkataganesh Thoppae wrote: > > 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(MockPr
Re: AbstractJsfTestCase question
Actually I missed that part while typing a sample code. But here is a clean test case runnable if you have shale-test-x.jar. Appreciate if someone could try this on their box. Two files are attached. MyTestCase.java has test cases defined. SomeBean is a simple POJO. Thanks On Tue, May 20, 2008 at 10:57 AM, Chris Keefer <[EMAIL PROTECTED]> wrote: > I think in JSF 1.1 you have to get the value from a ValueBinding. See > below. > > @Test > public void test1 { >ValueBinding binding = > facesContext.getApplication().createValueBinding("#{someBean.prop[0]}"}; >String val = (String) binding.getValue(facesContext); >assertEquals(val, "M"); > } > > > Or you can try the VariableResolver like so: > > @Test > public void test1 { >String val = > facesContext.getApplication().getVariableResolver().resolveVariable(facesContext, > "#{someBean.prop[0]}"); >assertEquals(val, "M"); > } > > Hope this helps. > > --Chris > > > > > On May 19, 2008, at 1:06 PM, Venkataganesh Thoppae wrote: > > 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 <[EMAIL PROTECTED]> 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" < >>> [EMAIL PROTECTED]> >>> 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. >>> >> >> -- >> > > -- Regards Venkat Thoppae (240)446-7632
Re: AbstractJsfTestCase question
I think in JSF 1.1 you have to get the value from a ValueBinding. See below. @Test public void test1 { ValueBinding binding = facesContext.getApplication ().createValueBinding("#{someBean.prop[0]}"}; String val = (String) binding.getValue(facesContext); assertEquals(val, "M"); } Or you can try the VariableResolver like so: @Test public void test1 { String val = facesContext.getApplication().getVariableResolver ().resolveVariable(facesContext, "#{someBean.prop[0]}"); assertEquals(val, "M"); } Hope this helps. --Chris On May 19, 2008, at 1:06 PM, Venkataganesh Thoppae wrote: 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 <[EMAIL PROTECTED]> 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" <[EMAIL PROTECTED]> 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. --
RE: [Tomahawk] - Both MyFaces and the RI are on your classpath
I'm very sorryi'm going to send the message to MyFaces! Thanks Mario -Original Message- From: Greg Reddin [mailto:[EMAIL PROTECTED] Sent: 20 maggio 2008 15.49 To: user@shale.apache.org Subject: Re: [Tomahawk] - Both MyFaces and the RI are on your classpath On Tue, May 20, 2008 at 5:49 AM, <[EMAIL PROTECTED]> wrote: > Hi, > I'm using Tomahawk 1.1.6 on WebSphere 6.1 and does work correctly. But > on the log I found: > "Both MyFaces and the RI are on your classpath. Please make sure to use > only one of the two JSF-implementations." > I know that WAS has a JSF 1.1 implementation (Sun implementation) and my > application classloader policy is PARENT-LAST. The question is: > The log has an "ERROR" severity, so can this cause some problem? You should probably redirect this to [EMAIL PROTECTED] for a better response. I know I've seen that message before, but I'm not sure what sort of problems it may indicate. Thanks, Greg This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
Re: [Tomahawk] - Both MyFaces and the RI are on your classpath
On Tue, May 20, 2008 at 5:49 AM, <[EMAIL PROTECTED]> wrote: > Hi, > I'm using Tomahawk 1.1.6 on WebSphere 6.1 and does work correctly. But > on the log I found: > "Both MyFaces and the RI are on your classpath. Please make sure to use > only one of the two JSF-implementations." > I know that WAS has a JSF 1.1 implementation (Sun implementation) and my > application classloader policy is PARENT-LAST. The question is: > The log has an "ERROR" severity, so can this cause some problem? You should probably redirect this to [EMAIL PROTECTED] for a better response. I know I've seen that message before, but I'm not sure what sort of problems it may indicate. Thanks, Greg
[Tomahawk] - Both MyFaces and the RI are on your classpath
Hi, I'm using Tomahawk 1.1.6 on WebSphere 6.1 and does work correctly. But on the log I found: "Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations." I know that WAS has a JSF 1.1 implementation (Sun implementation) and my application classloader policy is PARENT-LAST. The question is: The log has an "ERROR" severity, so can this cause some problem? Thanks in advance Mario This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.