Speaking of Shale, I really dislike the idea of one huge factory. I much prefer builders if you need to assemble an aggregate object....for instance, if you need FacesContext with ExternalContext mocked out. And you don&#39;t often need everything setup anyway. It depends on the test.<br>
<br>As for the injection, we can think about tying that into the @Artifact framework from the JBoss test harness (created for Web Beans Pete and co)<br><br>-Dan<br><br><div class="gmail_quote">On Wed, May 6, 2009 at 11:40 AM, Alaxander Smirnov <span dir="ltr">&lt;<a href="mailto:asmirnov@exadel.com">asmirnov@exadel.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;">I have an idea for the mock testing project. While Shale and all other projects use one base class where all mock objects are initialized, the new one can utilize Seam/WebBeans &#39;inverse of control&#39; pattern, where necessary mock object should be injected in the same way as components use:<br>

<br>
public class FooTest extends .... {<br>
<br>
@in<br>
private FacesContext context;<br>
<br>
public void testBar() {<br>
...............<br>
context.get......<br>
...............<br>
}<br>
<br>
Therefore all mock initialization code can be moved into separate class, that may be used with any test framework ( jUnit 3/4, testng.... ).<br>
<br>
Dan Allen wrote:<div><div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
On Tue, May 5, 2009 at 7:22 PM, Alexandr Smirnov &lt;<a href="mailto:asmirnov@exadel.com" target="_blank">asmirnov@exadel.com</a> &lt;mailto:<a href="mailto:asmirnov@exadel.com" target="_blank">asmirnov@exadel.com</a>&gt;&gt; wrote:<br>

<br>
    Ok, do you start that project ? RichFaces uses Shale mocks now, but I<br>
    wish to replace that with something more convenient. I can help with<br>
    development and contribute existing test classes from richfaces to the<br>
    new mocks project.<br>
<br>
<br>
Yes, it is here:  <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>
However, give me a day or two while I import what we have from Seam (I need to bring in the mocks from seambay and a couple other places).<br>
<br>
Exactly, we want to get away from Shale.<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>
</blockquote>
</div></div></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>