|[tycho-user] Testing plug-in's without using single test-bundles|
After setting up the new maven tycho build successfully I tried a few possibilities to get the tests running again:
1) Converting the plain-java test project into a plugin test project Disadvantages:- In order to be able to test classes in internal packages, I have to export every single package with x-friend:<my.test.plugin> notation and have to repeat this procedure for each new tested package
2) Adding a second source folder in each plugin and move the tests into the corresponding plugin
Disadvantages:- Tycho seems to use build.properties to include the necessary source folders for the compile step. Since both the src/main/java and src/test/java needs to be registered as source folder, the real classes and the test classes are mixed up in the target/classes output folder and finally contained in the plugin's JAR file. I did not find a way to configure tycho to use src/main/java as sourceDirectory and src/test/java as testSourceDirectory. - Tycho executes the unit tests only, if the package type is "eclipse-test-plugin" - Sonar seems not to recognize tests executed in this way (I did not spend a lot of time trying to solve this issue, maybe there is an easy solution for this point)
3) Add the necessary eclipse target platform plugins as plain-maven dependency to the plain-java test project
Disadvantages:- The target platform information is duplicated, once in the target platform for the tycho build, and once in the maven dependency list of the test project (executed with plain maven-surefire) - The target platform bundles are deployed twice in the artifactory, once as target platform p2 archive, and once as maven dependencies (plugin+POM)
4) Adding a test fragment for each plugin (this seems to be the usually chosen possibility)
Disadvantages:- Needs a huge effort (> 70 plugins, >4500 unit tests), so I would need to add about 70 new fragments and split up all tests.
At the moment, possibility 3) seems the most reasonable for me... any suggestions? otherideas?
Back to the top