<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks, works like charm!<div><br></div><div>/Johan</div><div><br><div><div>On 27 dec 2009 v52, at 14.18, Aslak Knutsen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>I just commited some code that change the injection done in TestCore to use Non-Contextual-Injection. This should fix the issues your having.</div><div><br></div><div><a href="https://jira.jboss.org/jira/browse/WELDX-63">https://jira.jboss.org/jira/browse/WELDX-63</a></div>
<div><br></div><div>Do remember that Weld-Test will be 'replaced' by Arquillian, so don't put to much work into it.. :)</div><div><br></div><div>-aslak-</div><br><div class="gmail_quote">2009/12/27 Johan Eltes <span dir="ltr">&lt;<a href="mailto:johan.eltes@callistaenterprise.se">johan.eltes@callistaenterprise.se</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word">org.jboss.weld.test.core.TestCore is used by the&nbsp;org.jboss.weld.test.junit.CDIRunner to inject the dependencies of the test case. However, it only supports&nbsp;injection of qualified fields. As a side effect, dependencies declared as concrete classes can not be injected, since qualifiers only make sense to&nbsp;interface/abstract dependency declarations:<br>
<br>package org.jboss.weld.test.core;<br>...<br><br>public class TestCore {<br>...<br>&nbsp;private void injectField(Field field, Object target) throws Exception<br>&nbsp;&nbsp; {<br><font size="3"><span style="font-size:12px"><b>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (!hasBindTypeAnnotation(field.getAnnotations()))<br>
&nbsp;&nbsp; &nbsp; &nbsp;{<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; return;<br>&nbsp;&nbsp; &nbsp; &nbsp;}</b></span></font><br>&nbsp;&nbsp; &nbsp; &nbsp;if (!field.isAccessible())<br>&nbsp;&nbsp; &nbsp; &nbsp;{<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; field.setAccessible(true);<br>&nbsp;&nbsp; &nbsp; &nbsp;}<br>&nbsp;&nbsp; &nbsp; &nbsp;Object injectable = getInstanceByType(field.getType(), field<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.getAnnotations());<br><br>&nbsp;&nbsp; &nbsp; &nbsp;if (injectable != null)<br>&nbsp;&nbsp; &nbsp; &nbsp;{<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; field.set(target, injectable);<br>&nbsp;&nbsp; &nbsp; &nbsp;}<br>&nbsp;&nbsp; }<div><br></div><div>Just wondering the value of this restriction?</div><div><br>
</div><font color="#888888"><div>/Johan</div></font></div><br>_______________________________________________<br>
weld-dev mailing list<br>
<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br></blockquote></div><br><br clear="all"><br>-- <br>--<br>Aslak Knutsen; +47 952 38 791; fax +47 22 33 60 24<br>
Kongens gate 14; Boks 805 Sentrum, 0104 Oslo;<br><a href="http://www.conduct.no/">http://www.conduct.no</a>; mailto:<a href="mailto:aslak@conduct.no">aslak@conduct.no</a><br><br>Conduct AS - Professional Open Source Services<br>
- Red Hat/JBoss Premier System Integrator<br>- Pentaho Preferred Integration Partner<br>- Atlassian Technology Partner<br>
</blockquote></div><br></div></body></html>