|Test Architecture causes Dependency Cycle [message #603825]
||Fri, 18 December 2009 16:16
| Alexander Kreul
Registered: December 2009
After adding Junit tests to our RCP Project, our PDE Build suddenly fails with the Error Message "A cycle was detected when generating the classpath PluginA, PluginB, PluginA"
After googling the error, I came to the solution that the newly added Unit Test-Architecture is causing the problem:
I was trying to use fragments to test the different plugins, due to the advantages it brings regarding access to package-private methods and not-exported packages.
However to setup a common test-environment, I also added a new Plugin which contains methods to create a Project, create GMF Diagrams, initializes PreferenceStores and so on. This was mainly to not repeat myself in every Junit Setup method that needs one of these functionalities.
So the added structure for the Test was PluginUnderTestA - TestFragmentA (using TestSetupPlugin); PluginUnderTestB - TestFragmentB (using TestSetupPlugin)
Since the TestSetupPlugin also calls Methods from other Plugins which related Testfragments call the TestSetupPlugin, the Build detects a cyclic dependency. Eclipse detected this as well when using the look for cycles functionality. The Automated Management of Dependencies solved this for Eclipse (it did not find cycles anymore) but the build still fails.
So my Question is:
Is there a possibility to switch off the dependency check for some plugins during the build or is there a better solution to setup my Unit tests?
Any help is appreciated,
Powered by FUDForum
. Page generated in 0.01706 seconds