Regarding Java:
How about creating an abstract test in the testing module, where you will write the basic tests. This test will use the interface defined in the first module in the test.
Then, in each impl a and impl b module, you create a test that extends the abstract test and calls the test methods defined in the tests module.
Regarding Maven:
In the tests module, you need to tell Maven that it should create a test package jar :
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.3</version> <executions> <execution> <goals> <goal>test-jar</goal> </goals> </execution> </executions> </plugin>
Then in each implementing module you will need to indicate that you have a dependency on this test-jar library:
<dependency> <groupId>foo</groupId> <artifactId>bar</artifactId> <version>${pom.version}</version> <type>test-jar</type> <scope>test</scope> </dependency>
source share