[[Shared_Test_Classes_and_Resources]]
= Shared Test Classes and Resources

ifdef::env-github[]
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]

[[among-testsuite-modules]]
== 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 WildFly 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]]
== 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:

[source,xml,options="nowrap"]
----
<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:

[source,xml,options="nowrap"]
----
    <dependency>
        <groupId>org.wildfly</groupId>
        <artifactId>wildfly-clustering-common</artifactId>
        <classifier>tests</classifier>
        <version>${project.version}</version>
        <scope>test</scope>
    </dependency>
----