title: Weld and test-jar
body: <p>We have a maven multi-module project with the following modules:</p>
  
  <ul>
  <li>prj-srv</li>
  <li>prj-client</li>
  </ul>
  
  <p>The srv project contains EJBs. In prj-srv/src/test, we have @Alternative implementations of the EJBs, specified in the alternatives section of beans.xml. This works.</p>
  
  <p>The project prj-client has prj-srv as a dependency. In addition, it has a dependency on prj-srv of type test-jar, scope test, so that it can use the alternative EJB implementations for tests. This works, too.</p>
  
  <p>Now then: in prj-client/src/main/java, we have local implementations of the EJB interfaces (so that we can cache the data) annotated with our qualifier @Cacheable. What I would like to do, is setup the tests in prj-client/src/test/java so that they use my test implementations from prj-srv (the ones that aren't cacheable, but who cares since it's for testing).</p>
  
  <p>I have tried:</p>
  
  <ul>
  <li><p>Creating a class with producer methods (@Produces @Alternative @Cacheable) in prj-client/src/test/java, but I don't know how to configure beans.xml to set this up as the alternative</p></li>
  <li><p>Creating classes in prj-srv/src/test/java that extend the test EJBs, annotated @Alternative @Cacheable, and put them in src/test/resources/META-INF/beans.xml in the alternatives section, but weld still injects the "real" @Cacheable beans from src/main/java.</p></li>
  </ul>
  
  <p>Is there some problem mixing @Alternative with qualifiers? How can I get my tests to use alternate implementations of a qualified class?</p>