The error message says it can&#39;t find a Container. <div><br></div><div>If your testing the demo project, it is setup to run against multiple containers controlled via maven profile. see the arquillian demo wiki.</div><div>
<br></div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>ie:</div><div>mvn test -P jboss-remote-60</div><div><br></div><div>-aslak-<br><br><div class="gmail_quote">2009/12/26 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">Excellent, Arquillian seems perfect for my needs.<div>The snapshot build fails, though (the demo project). All tests fails with the same problem report:</div>
<div><br></div><div><div>  &lt;testcase time=&quot;0.004&quot; classname=&quot;com.acme.ejb.InjectionTestCase&quot; name=&quot;initializationError&quot;&gt;</div><div>    &lt;error message=&quot;No containers found&quot; type=&quot;java.lang.RuntimeException&quot;&gt;java.lang.RuntimeException: No containers found</div>
<div><span style="white-space:pre">        </span>at org.jboss.arquillian.spi.util.DeployableContainers.load(DeployableContainers.java:37)</div><div><span style="white-space:pre">        </span>at org.jboss.arquillian.impl.DeployableTestBuilder.build(DeployableTestBuilder.java:56)</div>
<div><span style="white-space:pre">        </span>at org.jboss.arquillian.junit.Arquillian.&amp;lt;init&amp;gt;(Arquillian.java:52)</div><div><span style="white-space:pre">        </span>at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)</div>
<div><span style="white-space:pre">        </span>at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)</div><div><span style="white-space:pre">        </span>at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)</div>
<div><span style="white-space:pre">        </span>at java.lang.reflect.Constructor.newInstance(Constructor.java:513)</div><div><span style="white-space:pre">        </span>at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)</div>
<div><span style="white-space:pre">        </span>at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)</div><div><span style="white-space:pre">        </span>at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)</div>
<div><span style="white-space:pre">        </span>at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)</div><div><span style="white-space:pre">        </span>at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)</div>
<div><span style="white-space:pre">        </span>at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)</div><div><span style="white-space:pre">        </span>at org.apache.maven.surefire.junit4.JUnit4TestSet.&amp;lt;init&amp;gt;(JUnit4TestSet.java:45)</div>
<div><span style="white-space:pre">        </span>at org.apache.maven.surefire.junit4.JUnit4DirectoryTestSuite.createTestSet(JUnit4DirectoryTestSuite.java:56)</div><div><span style="white-space:pre">        </span>at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets(AbstractDirectoryTestSuite.java:96)</div>
<div><span style="white-space:pre">        </span>at org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.java:209)</div><div><span style="white-space:pre">        </span>at org.apache.maven.surefire.Surefire.run(Surefire.java:90)</div>
<div><span style="white-space:pre">        </span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div><div><span style="white-space:pre">        </span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</div>
<div><span style="white-space:pre">        </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</div><div><span style="white-space:pre">        </span>at java.lang.reflect.Method.invoke(Method.java:597)</div>
<div><span style="white-space:pre">        </span>at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:289)</div><div><span style="white-space:pre">        </span>at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:993)</div>
<div>&lt;/error&gt;</div><div>  &lt;/testcase&gt;</div><div><br></div><div>Any hints that helps me forwards would be much appreciated.</div><div><br></div><font color="#888888"><div>/Johan</div></font></div><div><div></div>
<div class="h5"><div><br><div><div>On 26 dec 2009 v52, at 11.19, Aslak Knutsen wrote:</div><br><blockquote type="cite">There is always the Weld User Forum: <a href="http://seamframework.org/Community/WeldUsers" target="_blank">http://seamframework.org/Community/WeldUsers</a><div>
<br></div><div>Weld Test does exist:</div><div><a href="http://anonsvn.jboss.org/repos/weld/test/trunk/" target="_blank">http://anonsvn.jboss.org/repos/weld/test/trunk/</a></div>
<div>but will be &#39;converted&#39; to a Arquillian container:</div><div><br></div><div>Arquillian is a allover &#39;in container&#39; test framework. Have a look at:</div><div><a href="http://community.jboss.org/docs/DOC-14376?uniqueTitle=false" target="_blank">http://community.jboss.org/docs/DOC-14376?uniqueTitle=false</a></div>

<div><a href="http://community.jboss.org/wiki/Arquillian-Demo" target="_blank">http://community.jboss.org/wiki/Arquillian-Demo</a></div><div><br></div><div>Junit demo code: </div><div><a href="http://anonsvn.jboss.org/repos/common/arquillian/trunk/demo/" target="_blank">http://anonsvn.jboss.org/repos/common/arquillian/trunk/demo/</a></div>

<div><br></div><div>TestNG demo code: </div><div><a href="http://anonsvn.jboss.org/repos/common/arquillian/trunk/demo-testng/" target="_blank">http://anonsvn.jboss.org/repos/common/arquillian/trunk/demo-testng/</a><br><div>
<br></div><div>
Arquillian does not have any direct/standalone Weld support yet, but this is in the works and will be out soon. As for now, Weld can be used via the Jboss 6.0 Remote Container. </div><div><br></div><div>Example of Weld + JUnit + Arquillian: </div>

<div><a href="http://anonsvn.jboss.org/repos/common/arquillian/trunk/demo/src/test/java/com/acme/weld/InjectionTestCase.java" target="_blank">http://anonsvn.jboss.org/repos/common/arquillian/trunk/demo/src/test/java/com/acme/weld/InjectionTestCase.java</a></div>

<div><br></div><div><br></div><div>This is the basis of upcoming Seam 3 Test.</div><div><br></div><div>-- <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/" target="_blank">http://www.conduct.no</a>; mailto:<a href="mailto:aslak@conduct.no" target="_blank">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><br><div class="gmail_quote">2009/12/26 Johan Eltes <span dir="ltr">&lt;<a href="mailto:johan.eltes@callistaenterprise.se" target="_blank">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">It would be great me and other users to get a weld-user list!<br>
My major pain is to wrap my head around how to implement junit tests for cdi beans.<br>
Having a place where users could get together to sort out essential issues for projects trying to use Weld, would be great. If anyone has a sample of a unit test that does not depend on anything else than weld 1.0.0 would be really great:<br>


<br>
- How to have the test target object injected into the test case ?<br>
... or...<br>
- How to obtain an injected test target object from within the test case?<br>
<br>
/Johan<br>
_______________________________________________<br>
weld-dev mailing list<br>
<a href="mailto:weld-dev@lists.jboss.org" target="_blank">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>
</div></div>
</blockquote></div><br></div></div></div></div></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>
</div>