<div class="gmail_quote">On Thu, Apr 30, 2009 at 10:13 AM, Jay Balunas <span dir="ltr">&lt;<a href="mailto:tech4j@gmail.com">tech4j@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
You may also want to check out <a href="http://www.jboss.org/community/wiki/TestDrivenJSFDevelopment" target="_blank">http://www.jboss.org/community/wiki/TestDrivenJSFDevelopment</a> <br><br>Alex Smirnov has been working on this to help with RF 4.0 development.  Perhaps we can collaborate.</blockquote>
<div><br>Awesome. So I&#39;m not alone in my thinking that we need a solution.<br><br>Another initiative that is just getting started is faces-tester by Jason Lee. <a href="http://kenai.com/projects/facestester">http://kenai.com/projects/facestester</a><br>
<br>I see two requirements. One is that you are interacting with the JSF API to validate your framework or business code. For instance, I have tests in Seam 3 right now that validate that the EL resolver is working correctly, ones that validate that FacesMessage objects are created and registered and ones that test that a component can be found by id in a programmatically created tree.<br>
<br>Then there is the view and UI component stuff (but not functional testing like Selenium or JSFUnit). That is where faces-tester and/or jsf-test are needed. They reach into the JSF view layer and begin executing the component renderers.<br>
<br>We absolutely need both. And it&#39;s time to get serious and have a definitive library rather than just spinning off a homegrown mock everytime we need to write a test. I&#39;m going to be looking into both of these projects as I add tests to Seam 3.<br>
<br>-Dan<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br><div class="gmail_quote"><div class="im">On Wed, Apr 29, 2009 at 11:10 AM, Dan Allen <span dir="ltr">&lt;<a href="mailto:dan.j.allen@gmail.com" target="_blank">dan.j.allen@gmail.com</a>&gt;</span> wrote:<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">
It&#39;s hard to believe that for as long as JSF has been around, the only decent repository of mocks for the JSF API comes not from the implementation, but rather from all but dead and irrelevant project at Apache (Shale). Of course, Seam 2 forged it&#39;s own path and has a healthy set of mocks, although still somewhat incomplete and vagrant. In the Seam 3 spirit of modularity, I would like to migrate the Seam 2 mocks into a mock module in Seam 3 that provides mock/stub object for various Java EE APIs. I plan to categorize them by spec under the org.jboss.seam.mock folder<br>


<br>JSF - org.jboss.seam.mock.faces<br>Servlet - org.jboss.seam.mock.servlet<br>etc<br><br>This module should not depend on any other module so that it is easy to reuse, perhaps even outside of the Seam framework. Perhaps seam-mock can end up replacing Shale test. Who knows. We&#39;ll just let it play out. Please contribute your ideas/use cases!<br>


<br><a href="http://anonsvn.jboss.org/repos/seam/modules/trunk/mock/" target="_blank">http://anonsvn.jboss.org/repos/seam/modules/trunk/mock/</a><br><br>As for the functionality, my feeling is that the mocks should be functional as long as each class behaves like a bean. That means it shouldn&#39;t parse XML documents or make similar assumptions. But they should be easy enough to extend that perhaps you can add that functionality in your test case or we can think about providing an additional subclass or helper if the need is common (perhaps parsing an web.xml document).<br>


<br>-Dan<br><br>-- <br>Dan Allen<br>Senior Software Engineer, Red Hat | Author of Seam in Action<br><br><a href="http://mojavelinux.com" target="_blank">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction" target="_blank">http://mojavelinux.com/seaminaction</a><br>


<a href="http://in.relation.to/Bloggers/Dan" target="_blank">http://in.relation.to/Bloggers/Dan</a><br><br>NOTE: While I make a strong effort to keep up with my email on a daily<br>basis, personal or other work matters can sometimes keep me away<br>


from my email. If you contact me, but don&#39;t hear back for more than a week,<br>it is very likely that I am excessively backlogged or the message was<br>caught in the spam filters.  Please don&#39;t hesitate to resend a message if<br>


you feel that it did not reach my attention.<br>
<br></div></div>_______________________________________________<br>
seam-dev mailing list<br>
<a href="mailto:seam-dev@lists.jboss.org" target="_blank">seam-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
<br></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br>blog: <a href="http://in.relation.to/Bloggers/Jay" target="_blank">http://in.relation.to/Bloggers/Jay</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Dan Allen<br>Senior Software Engineer, Red Hat | Author of Seam in Action<br><br><a href="http://mojavelinux.com">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a><br>
<a href="http://in.relation.to/Bloggers/Dan">http://in.relation.to/Bloggers/Dan</a><br><br>NOTE: While I make a strong effort to keep up with my email on a daily<br>basis, personal or other work matters can sometimes keep me away<br>
from my email. If you contact me, but don&#39;t hear back for more than a week,<br>it is very likely that I am excessively backlogged or the message was<br>caught in the spam filters.  Please don&#39;t hesitate to resend a message if<br>
you feel that it did not reach my attention.<br>