JBoss Community Archive (Read Only)

JBoss AS 7.2

Shared Test Classes and Resources

Among Testsuite Modules

Use the testsuite/shared module.

Classes and resources in this module are available in all testsuite modules - i.e. in testsuite/* .

Only use it if necessary - don't put things "for future use" in there.

Don't split packages across modules. Make sure the java package is unique in the AS project.

Document your util classes (javadoc) so they can be easily found and reused!  A generated list will be put here.

Between Components and Testsuite Modules

To share component's test classes with some module in testsuite, you don't need to split to submodules.
You can create a jar with classifier using this:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions> <execution>
            <goals> <goal>test-jar</goal> </goals>
        </execution></executions>
    </plugin>

This creates a jar with classifier "tests", so you can add it as dependency to a testsuite module:

    <dependency>
        <groupId>org.jboss.as</groupId>
        <artifactId>jboss-as-clustering-common</artifactId>
        <classifier>tests</classifier>
       <version>${project.version}</version>
       <scope>test</scope>
    </dependency>

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 13:29:36 UTC, last content change 2012-02-01 05:26:17 UTC.