Dmitry Beransky wrote:
Hi,
Just finished reading an article on test categorization:
<http://www-128.ibm.com/developerworks/java/library/j-cq10316/index.html?ca=drs->.
Any recommendations how how to implement this in Maven?
Thanks
D.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Although I don't 100% percent agree with the article, I believe
technically multiple test case file pattern can be defined for each
sunfire-plugin in multiple profiles. All test cases may still have to
stay in one directory if you are OK to categorize them by name pattern
or package.
http://maven.apache.org/guides/introduction/introduction-to-profiles.html
pom.xml could be something like
......
<profiles>
<profile>
<id>test.category.component</id>
<activation>
<property>
<name>test.category</name>
<value>component</value>
</property>
</activation>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*ComponentTest.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</profile>
<profile>
<id>test.category.system</id>
<activation>
<property>
<name>test.category</name>
<value>system</value>
</property>
</activation>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*SystemTest.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</profile>
</profiles>
... ...
By running "mvn test -Dtest.category=component", only *ComponentTest
will be invoked. Hope it helps.
Regards
--
Jiaqi Guo
http://www.cyclopsgroup.org
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]