<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">/Xavier<br><br><br></span>
</div>
<br><div><div>On Aug 23, 2012, at 9:48 AM, Max Rydahl Andersen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><blockquote type="cite">As I read idea #4 (diagram), I wonder if it would be possible to have some Arquillian tooling based on the CDI context to generate something like this:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">package org.arquillian.example;<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">import org.jboss.arquillian.container.test.api.Deployment;<br></blockquote><blockquote type="cite">import org.jboss.arquillian.junit.Arquillian;<br></blockquote><blockquote type="cite">import org.jboss.shrinkwrap.api.ShrinkWrap;<br></blockquote><blockquote type="cite">import org.jboss.shrinkwrap.api.asset.EmptyAsset;<br></blockquote><blockquote type="cite">import org.jboss.shrinkwrap.api.spec.JavaArchive;<br></blockquote><blockquote type="cite">import org.junit.runner.RunWith;<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">@RunWith(Arquillian.class)<br></blockquote><blockquote type="cite">public class BasketTest {<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">@Deployment<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">public static JavaArchive createDeployment() {<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">return ShrinkWrap.create(JavaArchive.class, "test.jar")<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">.addClasses(Basket.class, OrderRepository.class, SingletonOrderRepository.class)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">}<br></blockquote><blockquote type="cite">}<br></blockquote><blockquote type="cite">The idea would be that from a custom Arquillian Test wizard, you could specifiy with Bean is to be tested, and then generate the proper test skeleton, including the 'createDeployment()' method.<br></blockquote><br>Something like <a href="https://issues.jboss.org/browse/JBIDE-8553">https://issues.jboss.org/browse/JBIDE-8553</a> ?<br></div></blockquote>yes, indeed.</div><div><br><blockquote type="cite"><div><br><blockquote type="cite">Also, some validation tooling could report problems if other required beans (that are injected in the one to be tested) are not declared in the archive.<br></blockquote><blockquote type="cite">I understand that it does not cover all use cases, especially when m2 dependencies should be included in the test archive, but it could be a starting point..<br></blockquote><br>Sounds good, but not sure if this last one is technical feasible since you would actually need to *execute* the @deployment method to validate it....aka. run the test.<br></div></blockquote><div><br></div>well, the tooling could look at the import declarations of the beans, locate the imported types and include the proper classes/jars in the archive. &nbsp;<br><blockquote type="cite"><div><br>thoughts ?<br><br>/max<br><br></div></blockquote></div><br></body></html>