From ssilvert at redhat.com Fri Aug 3 21:37:30 2007
From: ssilvert at redhat.com (Stan Silvert)
Date: Fri, 03 Aug 2007 21:37:30 -0400
Subject: [jsfunit-dev] cactus.properties now optional
Message-ID: <46B3D85A.7080807@redhat.com>
I've removed cactus.properties from all the JSFUnit examples. See
http://jira.jboss.com/jira/browse/JSFUNIT-11 for details.
From pieter.kuijpers at luminis.nl Tue Aug 7 10:59:27 2007
From: pieter.kuijpers at luminis.nl (Pieter Kuijpers)
Date: Tue, 7 Aug 2007 16:59:27 +0200
Subject: [jsfunit-dev] ClientFacade.clickLink not working for h:commandLink
Message-ID: <3AA4358A-E3C1-4F2D-BC59-6CB6CE19F8F2@luminis.nl>
I'm trying to test a commandLink in a page with
ClientFacade.clickLink, but this does not seem to be working.
link.jsp:
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
Link test
target.jsp:
Link test successful
Success.
Test code:
public class LinkTest extends TestCase {
public void testClickLink() throws Exception {
ClientFacade client = new ClientFacade("/link.faces");
client.clickLink("link");
assertEquals("Link test successful", client.getWebResponse
().getTitle());
}
}
The HTML that is returned using client.getWebResponse().getText is
that of link.jsp. When I try the same test by hand, it is working OK.
How is this supposed to work?
Thanks,
Pieter Kuijpers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsfunit-dev/attachments/20070807/72546413/attachment.html
From ssilvert at redhat.com Tue Aug 7 11:36:09 2007
From: ssilvert at redhat.com (Stan Silvert)
Date: Tue, 07 Aug 2007 11:36:09 -0400
Subject: [jsfunit-dev] ClientFacade.clickLink not working for h:commandLink
In-Reply-To: <3AA4358A-E3C1-4F2D-BC59-6CB6CE19F8F2@luminis.nl>
References: <3AA4358A-E3C1-4F2D-BC59-6CB6CE19F8F2@luminis.nl>
Message-ID: <46B89169.9060804@redhat.com>
Hi Pieter,
It looks like you've found a bug in JSFUnit. Our test suite doesn't
include an example of using plain . We only have it for
an AJAXified commandLink.
The clickLink() method was really meant for static links of the type
that get created when you use . I'm not sure if I should
overload this method for use with or not. Any thoughts?
Anyway, I'll be fixing this ASAP and let you know.
Stan
Pieter Kuijpers wrote:
> I'm trying to test a commandLink in a page with ClientFacade.clickLink,
> but this does not seem to be working.
>
> link.jsp:
>
>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
>
>
>
> Link test
>
>
>
>
>
>
>
>
>
> target.jsp:
>
>
>
>
> Link test successful
>
>
> Success.
>
>
>
> Test code:
>
> public class LinkTest extends TestCase {
> public void testClickLink() throws Exception {
> ClientFacade client = new ClientFacade("/link.faces");
> client.clickLink("link");
> assertEquals("Link test successful",
> client.getWebResponse().getTitle());
> }
> }
>
> The HTML that is returned using client.getWebResponse().getText is that
> of link.jsp. When I try the same test by hand, it is working OK.
>
> How is this supposed to work?
>
> Thanks,
> Pieter Kuijpers.
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> jsfunit-dev mailing list
> jsfunit-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jsfunit-dev
From ssilvert at redhat.com Tue Aug 7 20:41:16 2007
From: ssilvert at redhat.com (Stan Silvert)
Date: Tue, 07 Aug 2007 20:41:16 -0400
Subject: [jsfunit-dev] ClientFacade.clickLink not working for h:commandLink
In-Reply-To: <3AA4358A-E3C1-4F2D-BC59-6CB6CE19F8F2@luminis.nl>
References: <3AA4358A-E3C1-4F2D-BC59-6CB6CE19F8F2@luminis.nl>
Message-ID: <46B9112C.8090800@redhat.com>
Hi Pieter,
The fix is taking a little longer than I expected. If you comment out
two lines of code in WebConversationFactory then the client.clickLink()
on a commandLink will work (at least with MyFaces 1.1). The two lines are:
HTMLParserFactory.useJTidyParser();
HttpUnitOptions.setScriptingEnabled(false);
The problem is, that will break AJAX support. So I'm not sure what the
final solution will be.
Stan
Pieter Kuijpers wrote:
> I'm trying to test a commandLink in a page with ClientFacade.clickLink,
> but this does not seem to be working.
>
> link.jsp:
>
>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
>
>
>
> Link test
>
>
>
>
>
>
>
>
>
> target.jsp:
>
>
>
>
> Link test successful
>
>
> Success.
>
>
>
> Test code:
>
> public class LinkTest extends TestCase {
> public void testClickLink() throws Exception {
> ClientFacade client = new ClientFacade("/link.faces");
> client.clickLink("link");
> assertEquals("Link test successful",
> client.getWebResponse().getTitle());
> }
> }
>
> The HTML that is returned using client.getWebResponse().getText is that
> of link.jsp. When I try the same test by hand, it is working OK.
>
> How is this supposed to work?
>
> Thanks,
> Pieter Kuijpers.
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> jsfunit-dev mailing list
> jsfunit-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jsfunit-dev
From pieter.kuijpers at luminis.nl Wed Aug 8 04:22:47 2007
From: pieter.kuijpers at luminis.nl (Pieter Kuijpers)
Date: Wed, 8 Aug 2007 10:22:47 +0200
Subject: [jsfunit-dev] ClientFacade.clickLink not working for h:commandLink
In-Reply-To: <46B9112C.8090800@redhat.com>
References: <3AA4358A-E3C1-4F2D-BC59-6CB6CE19F8F2@luminis.nl>
<46B9112C.8090800@redhat.com>
Message-ID:
Hi Stan,
Thanks for the quick response. I've tried commenting out the two
lines you indicated, but still no luck. HttpUnit doesn't seem to be
able to cope with the JavaScript that is generated for the
commandLink. The error I get is:
com.meterware.httpunit.ScriptException: Event 'if(typeof jsfcljs ==
'function'){jsfcljs(document.forms['form'],'form:link,form:link','');}
return false' failed: TypeError: undefined is not a function.
(httpunit; )
at com.meterware.httpunit.javascript.JavaScript
$JavaScriptEngine.handleScriptException(JavaScript.java:202)
at com.meterware.httpunit.javascript.JavaScript
$JavaScriptEngine.performEvent(JavaScript.java:175)
at com.meterware.httpunit.scripting.ScriptableDelegate.doEvent
(ScriptableDelegate.java:56)
at com.meterware.httpunit.WebRequestSource.submitRequest
(WebRequestSource.java:232)
at com.meterware.httpunit.WebLink.click(WebLink.java:98)
I'm using JBoss 4.2.0GA, that in turn uses the JSF reference
implementation, so that may explain why this fix is working for you
but not for me.
The HTML/Javascript that is generated for link.jsp is:
Link test
My JavaScript knowledge is not very deep, so I'm having trouble
understanding the error message from HttpUnit.
Regards,
Pieter.
Op 8-aug-2007, om 2:41 heeft Stan Silvert het volgende geschreven:
> Hi Pieter,
>
> The fix is taking a little longer than I expected. If you comment
> out two lines of code in WebConversationFactory then the
> client.clickLink() on a commandLink will work (at least with
> MyFaces 1.1). The two lines are:
>
> HTMLParserFactory.useJTidyParser();
> HttpUnitOptions.setScriptingEnabled(false);
>
> The problem is, that will break AJAX support. So I'm not sure what
> the final solution will be.
>
> Stan
>
> Pieter Kuijpers wrote:
>> I'm trying to test a commandLink in a page with
>> ClientFacade.clickLink, but this does not seem to be working.
>> link.jsp:
>>
>> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
>> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
>>
>>
>>
>> Link test
>>
>>
>>
>>
>>
>>
>>
>>
>> target.jsp:
>>
>>
>>
>> Link test successful
>>
>>
>> Success.
>>
>>
>> Test code:
>> public class LinkTest extends TestCase {
>> public void testClickLink() throws Exception {
>> ClientFacade client = new ClientFacade("/link.faces");
>> client.clickLink("link");
>> assertEquals("Link test successful", client.getWebResponse
>> ().getTitle());
>> }
>> }
>> The HTML that is returned using client.getWebResponse().getText is
>> that of link.jsp. When I try the same test by hand, it is working OK.
>> How is this supposed to work?
>> Thanks,
>> Pieter Kuijpers.
>> ---------------------------------------------------------------------
>> ---
>> _______________________________________________
>> 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/20070808/07831b95/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/20070808/07831b95/attachment.jpg
From ssilvert at redhat.com Wed Aug 8 10:46:06 2007
From: ssilvert at redhat.com (Stan Silvert)
Date: Wed, 08 Aug 2007 10:46:06 -0400
Subject: [jsfunit-dev] ClientFacade.clickLink not working for h:commandLink
In-Reply-To:
References: <3AA4358A-E3C1-4F2D-BC59-6CB6CE19F8F2@luminis.nl>
<46B9112C.8090800@redhat.com>
Message-ID: <46B9D72E.4090904@redhat.com>
Thanks for letting me know that it fails on JBoss 4.2/JSF 1.2. That
saves me a bit of time.
I think we're going to have to treat the commandLink component the same
way we do an AJAX component. We just ignore all the javascript and send
the equivalent HTTP request to the server.
Stan
Pieter Kuijpers wrote:
> Hi Stan,
>
> Thanks for the quick response. I've tried commenting out the two lines
> you indicated, but still no luck. HttpUnit doesn't seem to be able to
> cope with the JavaScript that is generated for the commandLink. The
> error I get is:
>
> com.meterware.httpunit.ScriptException: Event 'if(typeof jsfcljs ==
> 'function'){jsfcljs(document.forms['form'],'form:link,form:link','');}return
> false' failed: TypeError: undefined is not a function. (httpunit; )
> at
> com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.handleScriptException(JavaScript.java:202)
> at
> com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEvent(JavaScript.java:175)
> at
> com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDelegate.java:56)
> at
> com.meterware.httpunit.WebRequestSource.submitRequest(WebRequestSource.java:232)
> at com.meterware.httpunit.WebLink.click(WebLink.java:98)
>
> I'm using JBoss 4.2.0GA, that in turn uses the JSF reference
> implementation, so that may explain why this fix is working for you but
> not for me.
>
> The HTML/Javascript that is generated for link.jsp is:
>
>
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
>
>
>
>
> Link test
>
>
>
>
>
>
>
> My JavaScript knowledge is not very deep, so I'm having trouble
> understanding the error message from HttpUnit.
>
> Regards,
> Pieter.
>
>
> Op 8-aug-2007, om 2:41 heeft Stan Silvert het volgende geschreven:
>
>> Hi Pieter,
>>
>> The fix is taking a little longer than I expected. If you comment out
>> two lines of code in WebConversationFactory then the
>> client.clickLink() on a commandLink will work (at least with MyFaces
>> 1.1). The two lines are:
>>
>> HTMLParserFactory.useJTidyParser();
>> HttpUnitOptions.setScriptingEnabled(false);
>>
>> The problem is, that will break AJAX support. So I'm not sure what
>> the final solution will be.
>>
>> Stan
>>
>> Pieter Kuijpers wrote:
>>> I'm trying to test a commandLink in a page with
>>> ClientFacade.clickLink, but this does not seem to be working.
>>> link.jsp:
>>>
>>> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
>>> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
>>>
>>>
>>>
>>> Link test
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> target.jsp:
>>>
>>>
>>>
>>> Link test successful
>>>
>>>
>>> Success.
>>>
>>>
>>> Test code:
>>> public class LinkTest extends TestCase {
>>> public void testClickLink() throws Exception {
>>> ClientFacade client = new ClientFacade("/link.faces");
>>> client.clickLink("link");
>>> assertEquals("Link test successful",
>>> client.getWebResponse().getTitle());
>>> }
>>> }
>>> The HTML that is returned using client.getWebResponse().getText is
>>> that of link.jsp. When I try the same test by hand, it is working OK.
>>> How is this supposed to work?
>>> Thanks,
>>> Pieter Kuijpers.
>>> ------------------------------------------------------------------------
>>> _______________________________________________
>>> 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
> -------------------------------------------------
>
>
>
From ssilvert at redhat.com Thu Aug 9 11:18:38 2007
From: ssilvert at redhat.com (Stan Silvert)
Date: Thu, 09 Aug 2007 11:18:38 -0400
Subject: [jsfunit-dev] ClientFacade.clickLink not working for h:commandLink
In-Reply-To:
References: <3AA4358A-E3C1-4F2D-BC59-6CB6CE19F8F2@luminis.nl>
<46B9112C.8090800@redhat.com>
Message-ID: <46BB304E.4090302@redhat.com>
Pieter,
I've committed a fix for commandLink. It has been tested on MyFaces
1.1.4, MyFaces 1.1.5, and JSF RI 1.2_04_P02 (the one that ships with
JBoss 4.2).
There is a new method in ClientFacade called clickCommandLink(). You
will need to use that instead of clickLink().
Can you try it out and let us know if it works for you?
Thanks,
Stan
Pieter Kuijpers wrote:
> Hi Stan,
>
> Thanks for the quick response. I've tried commenting out the two lines
> you indicated, but still no luck. HttpUnit doesn't seem to be able to
> cope with the JavaScript that is generated for the commandLink. The
> error I get is:
>
> com.meterware.httpunit.ScriptException: Event 'if(typeof jsfcljs ==
> 'function'){jsfcljs(document.forms['form'],'form:link,form:link','');}return
> false' failed: TypeError: undefined is not a function. (httpunit; )
> at
> com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.handleScriptException(JavaScript.java:202)
> at
> com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEvent(JavaScript.java:175)
> at
> com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDelegate.java:56)
> at
> com.meterware.httpunit.WebRequestSource.submitRequest(WebRequestSource.java:232)
> at com.meterware.httpunit.WebLink.click(WebLink.java:98)
>
> I'm using JBoss 4.2.0GA, that in turn uses the JSF reference
> implementation, so that may explain why this fix is working for you but
> not for me.
>
> The HTML/Javascript that is generated for link.jsp is:
>
>
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
>
>
>
>
> Link test
>
>
>
>
>
>
>
> My JavaScript knowledge is not very deep, so I'm having trouble
> understanding the error message from HttpUnit.
>
> Regards,
> Pieter.
>
>
> Op 8-aug-2007, om 2:41 heeft Stan Silvert het volgende geschreven:
>
>> Hi Pieter,
>>
>> The fix is taking a little longer than I expected. If you comment out
>> two lines of code in WebConversationFactory then the
>> client.clickLink() on a commandLink will work (at least with MyFaces
>> 1.1). The two lines are:
>>
>> HTMLParserFactory.useJTidyParser();
>> HttpUnitOptions.setScriptingEnabled(false);
>>
>> The problem is, that will break AJAX support. So I'm not sure what
>> the final solution will be.
>>
>> Stan
>>
>> Pieter Kuijpers wrote:
>>> I'm trying to test a commandLink in a page with
>>> ClientFacade.clickLink, but this does not seem to be working.
>>> link.jsp:
>>>
>>> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
>>> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
>>>
>>>
>>>
>>> Link test
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> target.jsp:
>>>
>>>
>>>
>>> Link test successful
>>>
>>>
>>> Success.
>>>
>>>
>>> Test code:
>>> public class LinkTest extends TestCase {
>>> public void testClickLink() throws Exception {
>>> ClientFacade client = new ClientFacade("/link.faces");
>>> client.clickLink("link");
>>> assertEquals("Link test successful",
>>> client.getWebResponse().getTitle());
>>> }
>>> }
>>> The HTML that is returned using client.getWebResponse().getText is
>>> that of link.jsp. When I try the same test by hand, it is working OK.
>>> How is this supposed to work?
>>> Thanks,
>>> Pieter Kuijpers.
>>> ------------------------------------------------------------------------
>>> _______________________________________________
>>> 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
> -------------------------------------------------
>
>
>
From pieter.kuijpers at luminis.nl Mon Aug 13 03:36:20 2007
From: pieter.kuijpers at luminis.nl (pieter.kuijpers at luminis.nl)
Date: Mon, 13 Aug 2007 09:36:20 +0200 (CEST)
Subject: [jsfunit-dev] ClientFacade.clickLink not working for h:commandLink
Message-ID: <52620.192.168.1.71.1186990580.webmail@192.168.1.71>
Hi Stan,
ClickCommandLink works for me now. Thanks!
Regards,
Pieter.
-----Original Message-----
From: Stan Silvert
Sent: Thu, August 9, 2007 5:18 pm
To: Pieter Kuijpers
Cc: jsfunit-dev at lists.jboss.org
Subject: Re: [jsfunit-dev] ClientFacade.clickLink not working for h:commandLink
Pieter,
I've committed a fix for commandLink. It has been tested on MyFaces
1.1.4, MyFaces 1.1.5, and JSF RI 1.2_04_P02 (the one that ships with
JBoss 4.2).
There is a new method in ClientFacade called clickCommandLink(). You
will need to use that instead of clickLink().
Can you try it out and let us know if it works for you?
Thanks,
Stan
Pieter Kuijpers wrote:
> Hi Stan,
>
> Thanks for the quick response. I've tried commenting out the two lines
> you indicated, but still no luck. HttpUnit doesn't seem to be able to
> cope with the JavaScript that is generated for the commandLink. The
> error I get is:
>
> com.meterware.httpunit.ScriptException: Event 'if(typeof jsfcljs ==
> 'function'){jsfcljs(document.forms['form'],'form:link,form:link','');}return
> false' failed: TypeError: undefined is not a function. (httpunit; )
> at
> com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.handleScriptException(JavaScript.java:202)
> at
> com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEvent(JavaScript.java:175)
> at
> com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDelegate.java:56)
> at
> com.meterware.httpunit.WebRequestSource.submitRequest(WebRequestSource.java:232)
> at com.meterware.httpunit.WebLink.click(WebLink.java:98)
>
> I'm using JBoss 4.2.0GA, that in turn uses the JSF reference
> implementation, so that may explain why this fix is working for you but
> not for me.
>
> The HTML/Javascript that is generated for link.jsp is:
>
>
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
>
>
>
>
> Link test
>
>
>
>
>
>
>
> My JavaScript knowledge is not very deep, so I'm having trouble
> understanding the error message from HttpUnit.
>
> Regards,
> Pieter.
>
>
> Op 8-aug-2007, om 2:41 heeft Stan Silvert het volgende geschreven:
>
>> Hi Pieter,
>>
>> The fix is taking a little longer than I expected. If you comment out
>> two lines of code in WebConversationFactory then the
>> client.clickLink() on a commandLink will work (at least with MyFaces
>> 1.1). The two lines are:
>>
>> HTMLParserFactory.useJTidyParser();
>> HttpUnitOptions.setScriptingEnabled(false);
>>
>> The problem is, that will break AJAX support. So I'm not sure what
>> the final solution will be.
>>
>> Stan
>>
>> Pieter Kuijpers wrote:
>>> I'm trying to test a commandLink in a page with
>>> ClientFacade.clickLink, but this does not seem to be working.
>>> link.jsp:
>>>
>>> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
>>> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
>>>
>>>
>>>
>>> Link test
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> target.jsp:
>>>
>>>
>>>
>>> Link test successful
>>>
>>>
>>> Success.
>>>
>>>
>>> Test code:
>>> public class LinkTest extends TestCase {
>>> public void testClickLink() throws Exception {
>>> ClientFacade client = new ClientFacade("/link.faces");
>>> client.clickLink("link");
>>> assertEquals("Link test successful",
>>> client.getWebResponse().getTitle());
>>> }
>>> }
>>> The HTML that is returned using client.getWebResponse().getText is
>>> that of link.jsp. When I try the same test by hand, it is working OK.
>>> How is this supposed to work?
>>> Thanks,
>>> Pieter Kuijpers.
>>> ------------------------------------------------------------------------
>>> _______________________________________________
>>> 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
> -------------------------------------------------
>
>
>
From pieter.kuijpers at luminis.nl Mon Aug 13 05:00:38 2007
From: pieter.kuijpers at luminis.nl (pieter.kuijpers at luminis.nl)
Date: Mon, 13 Aug 2007 11:00:38 +0200 (CEST)
Subject: [jsfunit-dev] Error when setting selectOne parameter
Message-ID: <39749.192.168.1.70.1186995638.webmail@192.168.1.70>
Hi,
I have the following JSP (selectone.jsp), containing a single selectOneMenu component:
<%@ page language="java" contentType="text/html; charset=UTF-8"
??? pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
???
??? ???
??? ??? Insert title here
???
???
??? ???
??? ??? ???
??? ??? ??? ???
??? ??? ??? ???
??? ??? ??? ???
??? ??? ???
??? ???
???
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsfunit-dev/attachments/20070813/51c18db8/attachment.html
From ssilvert at redhat.com Mon Aug 13 09:47:26 2007
From: ssilvert at redhat.com (Stan Silvert)
Date: Mon, 13 Aug 2007 09:47:26 -0400
Subject: [jsfunit-dev] Error when setting selectOne parameter
In-Reply-To: <39749.192.168.1.70.1186995638.webmail@192.168.1.70>
References: <39749.192.168.1.70.1186995638.webmail@192.168.1.70>
Message-ID: <46C060EE.2010803@redhat.com>
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:
>
>
> <%@ page language="java" contentType="text/html; charset=UTF-8"
> pageEncoding="UTF-8"%>
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
>
>
>
> Insert title here
>
>
>
>
>
>
>
>
>
>
>
>
>
> 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
From pieter.kuijpers at luminis.nl Mon Aug 13 15:43:17 2007
From: pieter.kuijpers at luminis.nl (Pieter Kuijpers)
Date: Mon, 13 Aug 2007 21:43:17 +0200
Subject: [jsfunit-dev] Error when setting selectOne parameter
In-Reply-To: <46C060EE.2010803@redhat.com>
References: <39749.192.168.1.70.1186995638.webmail@192.168.1.70>
<46C060EE.2010803@redhat.com>
Message-ID: <0DAC2DC0-446F-4F66-81AF-3FC0E3BFF553@luminis.nl>
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:
>>
>> <%@ page language="java" contentType="text/html; charset=UTF-8"
>> pageEncoding="UTF-8"%>
>> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>>
>> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
>> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
>>
>>
>>
>> Insert title here
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 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
From ssilvert at redhat.com Wed Aug 15 15:13:58 2007
From: ssilvert at redhat.com (Stan Silvert)
Date: Wed, 15 Aug 2007 15:13:58 -0400
Subject: [jsfunit-dev] Tests for Ant Task
Message-ID: <46C35076.1090101@redhat.com>
Matt,
I'm starting to look at your Ant task and thinking about how I'm going
to implement the Maven plugin. I might just use what you've got to do
the Maven stuff. It looks like Maven has a facility for wrapping Ant
tasks as Maven plugins.
Anyhow, as a way to get to know the Ant code, I'm going to go ahead and
write the unit tests for it. Please let me know if you already started
on this so we don't duplicate effort.
Stan
From mwringe at redhat.com Wed Aug 15 16:25:59 2007
From: mwringe at redhat.com (Matt Wringe)
Date: Wed, 15 Aug 2007 16:25:59 -0400
Subject: [jsfunit-dev] Tests for Ant Task
In-Reply-To: <46C35076.1090101@redhat.com>
References: <46C35076.1090101@redhat.com>
Message-ID: <1187209559.1416.23.camel@toque.toronto.redhat.com>
On Wed, 2007-08-15 at 15:13 -0400, Stan Silvert wrote:
> Matt,
>
> I'm starting to look at your Ant task and thinking about how I'm going
> to implement the Maven plugin. I might just use what you've got to do
> the Maven stuff. It looks like Maven has a facility for wrapping Ant
> tasks as Maven plugins.
>
> Anyhow, as a way to get to know the Ant code, I'm going to go ahead and
> write the unit tests for it. Please let me know if you already started
> on this so we don't duplicate effort.
I was planning on catching up on this this weekend, but if you are
volunteering so much the better :) Let me know how it goes and if you
need any help with anything.
-Matt Wringe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.jboss.org/pipermail/jsfunit-dev/attachments/20070815/e2c47040/attachment.bin
From julien at jboss.com Thu Aug 16 04:58:27 2007
From: julien at jboss.com (Julien Viet)
Date: Thu, 16 Aug 2007 10:58:27 +0200
Subject: [jsfunit-dev] Fwd: JSF Unit compiled with JDK5
References: <46C4093C.5090903@redhat.com>
Message-ID:
Stan ?
Begin forwarded message:
> From: Thomas Heute
> Date: 16 ao?t 2007 10:22:20 HAEC
> To: JBoss Portal
> Subject: JSF Unit compiled with JDK5
>
>
>
> The introduction of JSFUnit implies the first dependency on JDK5,
> is it planned ? Or just a wrong compilation ?
>
Julien Viet
JBoss Portal Project Lead
Red Hat Inc.
http://jbossportal.blogspot.com/
http://www.ohloh.net/accounts/7348
Red Hat France SARL, 171 Avenue Georges Clemenceau, 92024 Nanterre
Cedex, France.
Siret n? 421 199 464 00056
From pieter.kuijpers at luminis.nl Thu Aug 16 06:41:10 2007
From: pieter.kuijpers at luminis.nl (pieter.kuijpers at luminis.nl)
Date: Thu, 16 Aug 2007 12:41:10 +0200 (CEST)
Subject: [jsfunit-dev] Setting Accept-Language header with ClientFacade
Message-ID: <39881.192.168.1.35.1187260870.webmail@192.168.1.35>
I'm testing a JSF application that has support for internationalization. Pages are rendered in the correct language based on the Accept-Language header in a request.
I can set the Accept-Language header in a unit test by invoking request.setHeaderField on a WebRequest that I have created through a WebConversation. I like the convenience of the ClientFacade though, and would like to use that instead of the WebConversationFactory / WebConversation.
When I use the ClientFacade, there is no Accept-Language header set in the WebRequest. This results in ServletRequest.getLocale returning the server default Locale as the preferred locale for the request. Since I need the tests to run correctly on servers with different default locales, this is undesirable for me.
Is there a way to set the Accept-Language header when using ClientFacade for setting up the WebConversation? It would be best to be able to set the Locale once for the entire conversation, so that the correct header is set in each WebRequest.
Regards,
Pieter Kuijpers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsfunit-dev/attachments/20070816/d4dbcc3e/attachment.html
From ssilvert at redhat.com Thu Aug 16 09:52:51 2007
From: ssilvert at redhat.com (Stan Silvert)
Date: Thu, 16 Aug 2007 09:52:51 -0400
Subject: [jsfunit-dev] Setting Accept-Language header with ClientFacade
In-Reply-To: <39881.192.168.1.35.1187260870.webmail@192.168.1.35>
References: <39881.192.168.1.35.1187260870.webmail@192.168.1.35>
Message-ID: <46C456B3.9000905@redhat.com>
Hi Pieter,
Thanks again for your feedback.
The simplest way I can see for adding this functionality to the
ClientFacade would be to just provide access to the WebConversation. So
you would say:
ClientFacade client = new ClientFacade("/foo.jsf");
client.getWebConversation().setHeaderField("Accept-Language", "es-mx,es");
I've been a little leery about adding more HttpUnit-specific stuff to
the ClientFacade. But I think we have to give the developer full access
when needed. So, right now I think that adding getWebConversation()
looks like the solution.
Any thoughts?
Stan
pieter.kuijpers at luminis.nl wrote:
> I'm testing a JSF application that has support for internationalization.
> Pages are rendered in the correct language based on the Accept-Language
> header in a request.
>
> I can set the Accept-Language header in a unit test by invoking
> request.setHeaderField on a WebRequest that I have created through a
> WebConversation. I like the convenience of the ClientFacade though, and
> would like to use that instead of the WebConversationFactory /
> WebConversation.
>
> When I use the ClientFacade, there is no Accept-Language header set in
> the WebRequest. This results in ServletRequest.getLocale returning the
> server default Locale as the preferred locale for the request. Since I
> need the tests to run correctly on servers with different default
> locales, this is undesirable for me.
>
> Is there a way to set the Accept-Language header when using ClientFacade
> for setting up the WebConversation? It would be best to be able to set
> the Locale once for the entire conversation, so that the correct header
> is set in each WebRequest.
>
>
> Regards,
> Pieter Kuijpers
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> jsfunit-dev mailing list
> jsfunit-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jsfunit-dev
From jprindiv at redhat.com Thu Aug 16 11:30:03 2007
From: jprindiv at redhat.com (Jonathan Prindiville)
Date: Thu, 16 Aug 2007 11:30:03 -0400
Subject: [jsfunit-dev] Fwd: JSF Unit compiled with JDK5
In-Reply-To:
References: <46C4093C.5090903@redhat.com>
Message-ID: <46C46D7B.2010804@redhat.com>
Julien Viet wrote:
> Stan ?
>
> Begin forwarded message:
>
>> From: Thomas Heute
>> Date: 16 ao?t 2007 10:22:20 HAEC
>> To: JBoss Portal
>> Subject: JSF Unit compiled with JDK5
>>
>>
>>
>> The introduction of JSFUnit implies the first dependency on JDK5, is
>> it planned ? Or just a wrong compilation ?
It seems that it was planned:
Stan wrote (see "Demo target platform" emails on jsfunit-dev list):
> Actually JSFUnit rules out JDK 1.4. I found that supporting 1.4 was going to be more trouble than it's worth.
> Unless we get lots of pushback from users, I'd like to require JDK 1.5 or better.
Regards,
Jon
From pieter.kuijpers at luminis.nl Thu Aug 16 15:20:33 2007
From: pieter.kuijpers at luminis.nl (Pieter Kuijpers)
Date: Thu, 16 Aug 2007 21:20:33 +0200
Subject: [jsfunit-dev] Setting Accept-Language header with ClientFacade
In-Reply-To: <46C456B3.9000905@redhat.com>
References: <39881.192.168.1.35.1187260870.webmail@192.168.1.35>
<46C456B3.9000905@redhat.com>
Message-ID:
Hi Stan,
Since ClientFacade is just a facade in front of HttpUnit, I think
providing a getWebConversation method is a good idea. As you say,
this allows the developer to use the convenience methods of the
facade, but gives the developer full access when needed.
Regards,
Pieter.
Op 16-aug-2007, om 15:52 heeft Stan Silvert het volgende geschreven:
> Hi Pieter,
>
> Thanks again for your feedback.
>
> The simplest way I can see for adding this functionality to the
> ClientFacade would be to just provide access to the
> WebConversation. So you would say:
>
> ClientFacade client = new ClientFacade("/foo.jsf");
> client.getWebConversation().setHeaderField("Accept-Language", "es-
> mx,es");
>
> I've been a little leery about adding more HttpUnit-specific stuff
> to the ClientFacade. But I think we have to give the developer
> full access when needed. So, right now I think that adding
> getWebConversation() looks like the solution.
>
> Any thoughts?
>
> Stan
>
> pieter.kuijpers at luminis.nl wrote:
>> I'm testing a JSF application that has support for
>> internationalization. Pages are rendered in the correct language
>> based on the Accept-Language header in a request.
>> I can set the Accept-Language header in a unit test by invoking
>> request.setHeaderField on a WebRequest that I have created through
>> a WebConversation. I like the convenience of the ClientFacade
>> though, and would like to use that instead of the
>> WebConversationFactory / WebConversation.
>> When I use the ClientFacade, there is no Accept-Language header
>> set in the WebRequest. This results in ServletRequest.getLocale
>> returning the server default Locale as the preferred locale for
>> the request. Since I need the tests to run correctly on servers
>> with different default locales, this is undesirable for me.
>> Is there a way to set the Accept-Language header when using
>> ClientFacade for setting up the WebConversation? It would be best
>> to be able to set the Locale once for the entire conversation, so
>> that the correct header is set in each WebRequest.
>> Regards,
>> Pieter Kuijpers
>> ---------------------------------------------------------------------
>> ---
>> _______________________________________________
>> 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/20070816/58b81062/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/20070816/58b81062/attachment.jpg
From ssilvert at redhat.com Thu Aug 16 16:03:34 2007
From: ssilvert at redhat.com (Stan Silvert)
Date: Thu, 16 Aug 2007 16:03:34 -0400
Subject: Feedback Needed (was Re: [jsfunit-dev] Setting Accept-Language header
with ClientFacade)
In-Reply-To: <46C456B3.9000905@redhat.com>
References: <39881.192.168.1.35.1187260870.webmail@192.168.1.35>
<46C456B3.9000905@redhat.com>
Message-ID: <46C4AD96.3080202@redhat.com>
I've written a proposal in the forum for changes to the ClientFacade.
I'd like to get your feedback on it.
Please see the post here:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=116320
Thanks,
Stan
Stan Silvert wrote:
> Hi Pieter,
>
> Thanks again for your feedback.
>
> The simplest way I can see for adding this functionality to the
> ClientFacade would be to just provide access to the WebConversation. So
> you would say:
>
> ClientFacade client = new ClientFacade("/foo.jsf");
> client.getWebConversation().setHeaderField("Accept-Language", "es-mx,es");
>
> I've been a little leery about adding more HttpUnit-specific stuff to
> the ClientFacade. But I think we have to give the developer full access
> when needed. So, right now I think that adding getWebConversation()
> looks like the solution.
>
> Any thoughts?
>
> Stan
>
> pieter.kuijpers at luminis.nl wrote:
>> I'm testing a JSF application that has support for
>> internationalization. Pages are rendered in the correct language based
>> on the Accept-Language header in a request.
>>
>> I can set the Accept-Language header in a unit test by invoking
>> request.setHeaderField on a WebRequest that I have created through a
>> WebConversation. I like the convenience of the ClientFacade though,
>> and would like to use that instead of the WebConversationFactory /
>> WebConversation.
>>
>> When I use the ClientFacade, there is no Accept-Language header set in
>> the WebRequest. This results in ServletRequest.getLocale returning the
>> server default Locale as the preferred locale for the request. Since I
>> need the tests to run correctly on servers with different default
>> locales, this is undesirable for me.
>>
>> Is there a way to set the Accept-Language header when using
>> ClientFacade for setting up the WebConversation? It would be best to
>> be able to set the Locale once for the entire conversation, so that
>> the correct header is set in each WebRequest.
>>
>>
>> Regards,
>> Pieter Kuijpers
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> jsfunit-dev mailing list
>> jsfunit-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/jsfunit-dev
>
> _______________________________________________
> jsfunit-dev mailing list
> jsfunit-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jsfunit-dev