[weld-dev] [seam-dev] TCK-style testing for Seam Cron Module

Jason Porter lightguard.jp at gmail.com
Fri May 20 00:12:30 EDT 2011


On Thu, May 19, 2011 at 21:26, Pete Royle <howardmoon at screamingcoder.com>wrote:

>  Hi Jason,
>
>  1. I think I will need a test suite with the test classes in
>> src/main/java (rather than src/test/java) so that the provider can get
>> those classes onto its own classpath during testing. Will Arquillian
>> work OK like that (ie: does it have maven integration which specifically
>> looks under src/test/java only)?
>>
>
>  No, there's nothing in there that I'm aware of that would prohibit this
> approach.
>
> You're right of course. The thing that seems to be getting in my way is
> actually the Surefire Maven plugin. I've created the TCK project separately
> and configured the Compile plugin to generate a
> seam-cron-asynchronous-tck-tests.jar which I'm then including in the
> asynchronous provider's project like so:
>
>         <dependency>
>             <groupId>${project.groupId}</groupId>
>             <artifactId>seam-cron-asynchronous-tck</artifactId>
>             <version>${project.version}</version>
>             <type>test-jar</type>
>             <scope>test</scope>
>         </dependency>
>
> However Maven still concludes that there aren't any test to run for that
> project. I suppose that's for good reason, but I'd like to work out how I
> can have these imported tests run by Surefire, rather than just the ones in
> src/test/java. I'll keep trying but please chime in if anyone has any ideas.
>

Here's the "official way" of doing it:
http://maven.apache.org/guides/mini/guide-attached-tests.html

>  2. The classes in the test suite have a hard-coded @Deployment, and I'm
>> not sure how I'd go about customising that place a different provider
>> class on the classpath. I don't want to have to force my providers to
>> extend every test case just to customise the deployment.
>>
>
>  You're @Deployment should be in the test class, but that doesn't stop you
> from having a base method that setup everything and just returns an archive
> you can add to, or even merge(...) in your @Deployement method.
>
> Would this require me to extend each of the TCK test classes in the
> provider project, in order to be able to add to the archive returned by the
> base method? This is something I wanted to avoid (even though it would
> clearly solve problem 1).
>

You could simply call the method and then modify or merge the two archives
together.


>  Cheers,
>
> Pete R
>



-- 
Jason Porter
http://lightguard-jp.blogspot.com
http://twitter.com/lightguardjp

Software Engineer
Open Source Advocate
Author of Seam Catch - Next Generation Java Exception Handling

PGP key id: 926CCFF5
PGP key available at: keyserver.net, pgp.mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20110519/bfe68a55/attachment.html 


More information about the weld-dev mailing list