Dmitry Beransky wrote:

Ideally, I wish I could annotate tests with a type (e.g.
@Test(type=component) public void testSomeFunction() {...}) and have
the test framework pick the tests out for me.

Lacking above, it's probably a good idea to break tests into multiple
directories based on their type (could be a good idea regardless), and
then simply modify test source directory based on the same system
property your recommended:

<build>
<testSourceDirectory>src/test/java/${test.category}</testSourceDirectory>
</build>

can I define a default value for ${test.category} in POM and then
override it at runtime with -Dtest.category=<value>?

or is profiles still a preferred way of approaching this and if so, why?

thanks
d.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Hi Dmitry,

If you want to categorize the tests with your own Annotation, you will definitely need to write you own plugin to run these test cases since sunfire-plugin has no knowledge of those Annotations. Then it would be problem to make plugins like clover to work with your own test plugin.

The testSourceDirectory is sort of coded in maven-model (http://svn.apache.org/repos/asf/maven/components/trunk/maven-model/maven.mdo), it could be a mess to change it and add multiple test source directories into POM model.

This left the "profile" the only option that I could come up with.

Even within a <profile>, you can't define a different testSourceDirectory according to http://maven.apache.org/guides/introduction/introduction-to-profiles.html. So I had to make the categorization base on file pattern.

In my example code, without specifying -Dtest.category, no profile will be activated, so the <build> directly under <project> will count in that case.



Best regards

--



Jiaqi Guo

http://www.cyclopsgroup.org
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to