I just commited some code that change the injection done in TestCore to use Non-Contextual-Injection. This should fix the issues your having.


Do remember that Weld-Test will be 'replaced' by Arquillian, so don't put to much work into it.. :)


2009/12/27 Johan Eltes <johan.eltes@callistaenterprise.se>
org.jboss.weld.test.core.TestCore is used by the org.jboss.weld.test.junit.CDIRunner to inject the dependencies of the test case. However, it only supports injection of qualified fields. As a side effect, dependencies declared as concrete classes can not be injected, since qualifiers only make sense to interface/abstract dependency declarations:

package org.jboss.weld.test.core;

public class TestCore {
 private void injectField(Field field, Object target) throws Exception
      if (!hasBindTypeAnnotation(field.getAnnotations()))

      if (!field.isAccessible())
      Object injectable = getInstanceByType(field.getType(), field

      if (injectable != null)
         field.set(target, injectable);

Just wondering the value of this restriction?


weld-dev mailing list

Aslak Knutsen; +47 952 38 791; fax +47 22 33 60 24
Kongens gate 14; Boks 805 Sentrum, 0104 Oslo;
http://www.conduct.no; mailto:aslak@conduct.no

Conduct AS - Professional Open Source Services
- Red Hat/JBoss Premier System Integrator
- Pentaho Preferred Integration Partner
- Atlassian Technology Partner