[jsfunit-dev] Error when setting selectOne parameter

Pieter Kuijpers pieter.kuijpers at luminis.nl
Mon Aug 13 15:43:17 EDT 2007


You're right, that was it...

Thanks!

Pieter.

Op 13-aug-2007, om 15:47 heeft Stan Silvert het volgende geschreven:

> Pieter,
>
> Did you revert back to the original WebConversationFactory?  That  
> looks like a bug that I found in the Neko HTML parser.  So  
> WebConversationFactory should have this line in the  
> makeWebConversation() method:
>
> HTMLParserFactory.useJTidyParser();
>
> Stan
>
> pieter.kuijpers at luminis.nl wrote:
>> Hi,
>> I have the following JSP (selectone.jsp), containing a single  
>> selectOneMenu component:
>> <?xml version="1.0" encoding="UTF-8" ?>
>> <%@ page language="java" contentType="text/html; charset=UTF-8"
>>     pageEncoding="UTF-8"%>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>> <html xmlns="http://www.w3.org/1999/xhtml">
>> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
>> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
>> <f:view>
>>     <head>
>>         <meta http-equiv="Content-Type" content="text/html; " />
>>         <title>Insert title here</title>
>>     </head>
>>     <body>
>>         <h:form id="selectForm">
>>             <h:selectOneMenu id="selectOne">
>>                 <f:selectItem itemValue="One" itemLabel="One"/>
>>                 <f:selectItem itemValue="Two" itemLabel="Two"/>
>>                 <f:selectItem itemValue="Three" itemLabel="Three"/>
>>             </h:selectOneMenu>
>>         </h:form>
>>     </body>
>> </f:view>
>> </html>
>> And the following test:
>> public class SelectTest extends TestCase {
>>        public void testSelectOne() throws Exception {
>>         ClientFacade client = new ClientFacade("/selectone.faces");
>>         client.setParameter("selectOne", "One");
>>         client.submit("submit_button");
>>                assertEquals(200, client.getWebResponse 
>> ().getResponseCode());
>>     }
>> }
>> Running the test results in the following error:
>> |com.meterware.httpunit.IllegalParameterValueException: May not  
>> set parameter 'selectForm:selectOne' to 'One'. Value must be one  
>> of: { }
>> at com.meterware.httpunit.SelectionFormControl 
>> $Options.reportNoMatches(FormControl.java:1186)
>> at com.meterware.httpunit.SelectionFormControl 
>> $SingleSelectOptions.claimUniqueValues(FormControl.java:1360)
>> at com.meterware.httpunit.SelectionFormControl 
>> $Options.claimUniqueValues(FormControl.java:1178)
>> at com.meterware.httpunit.SelectionFormControl.claimUniqueValue 
>> (FormControl.java:1059)
>> at com.meterware.httpunit.FormParameter.setValues 
>> (FormParameter.java:90)
>> at com.meterware.httpunit.WebForm.setParameter(WebForm.java:612)
>> at org.jboss.jsfunit.facade.ClientFacade.setParameter 
>> (ClientFacade.java:155)
>> |It seems like HttpUnit does not correctly see the options for the  
>> select menu (hence the 'must be one of: { }).
>> Am I doing something wrong here or is this a bug?
>> Thanks,
>> Pieter.
>> --------------------------------------------------------------------- 
>> ---
>> _______________________________________________
>> jsfunit-dev mailing list
>> jsfunit-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/jsfunit-dev
>

--
  Pieter Kuijpers
Senior software engineer luminis®
-------------------------------------------------
06 174 185 34
pieter.kuijpers at luminis.nl
www.luminis.nl
-------------------------------------------------


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsfunit-dev/attachments/20070813/12751f43/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: onbekend.jpg
Type: image/jpeg
Size: 1397 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/jsfunit-dev/attachments/20070813/12751f43/attachment.jpg 


More information about the jsfunit-dev mailing list