<div class="gmail_quote">On Mon, Jun 1, 2009 at 6:14 AM, Pete Muir <span dir="ltr">&lt;<a href="mailto:pmuir@bleepbleep.org.uk">pmuir@bleepbleep.org.uk</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;">
<div style="">What sort of unit test are you thinking of? The unit tests we do in Web Beans and the TCK run WB, so cause the injection to occur (do we need to provide a mock logger?!) - I though you used a similar thing in Seam...</div>
</blockquote><div><br>It depends on how you define unit testing (or two what degree for a given test). The holy grail of POJO development is that you can inject all dependencies manually in the test setup, if you want. The more things a class depends on, the more things you have to inject. Now, it makes perfect since to have to inject dependencies that the class depends on to perform the business function. But having to worry about injecting a logger just to get the class to work seems like...well, sort of a bummer. I would prefer that if I&#39;m in a manual test setup configuration (outside of any bootstrap) then I don&#39;t have to worry about injecting a logger.<br>
<br>Perhaps I&#39;m just being too purist. But I still say that I should not care, as a tester, that a class needs a logger. It should find one itself if I don&#39;t provide it one.<br><br>Of course, with the AbstractWebBeansTestCase, a logger will be injected. I get that.<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;"><div style=""><div><br><div><div><div></div><div class="h5"><div>On 29 May 2009, at 18:12, Dan Allen wrote:</div>
<br></div></div><blockquote type="cite"><div><div></div><div class="h5"><div class="gmail_quote">On Fri, May 29, 2009 at 10:00 AM, Pete Muir <span dir="ltr">&lt;<a href="mailto:pmuir@bleepbleep.org.uk" target="_blank">pmuir@bleepbleep.org.uk</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;"> <div>Yeah, the split is un-obvious (esp due to naming), but we wanted a module we could use inside the RI, that didn&#39;t have the producer method on it....</div>
</blockquote><div><br>So I&#39;m wondering, what should the standard signature of this injection be? Always a field injection (as opposed to a constructor injection)? What about access (package or private)?<br> <br>private @Logger Log log;<br>
<br>The reason I ask about access (and constructor injection) is because this could be the one pain in the side to unit testing a bean. Package access just makes it easier to inject a stub. What would be interesting is if the field could be seeded with a stub so that the logger just works in a unit test.<br>
 <br>private @Logger Log log = new NoOpLogImpl();<br><br>The injection would overwrite this value. Just an idea.<br><br>-Dan<br></div></div><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></div></div><div class="im">
 _______________________________________________<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>
</div></blockquote></div><br></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>