Hi,
for one of my modules I´ve written a "JDependCycleTest" that checks the
internal packages from not having cyclic dependencies.
...
JDepend jdepend = new JDepend();
jdepend.addDirectory(...);
Collection col = jdepend.analyze();
for (Iterator iter = col.iterator(); iter.hasNext();)
{
JavaPackage p = (JavaPackage) iter.next();
List<JavaPackage> cycles = new ArrayList<JavaPackage>();
p.collectCycle(cycles);
Assert.assertNotNull(p);
if( cycles.size() > 0)
{
Assert.fail("Cycle exists at package " + p.getName() + ":
" + toString(cycles));
}
}
..
I want to check this in other modules too, without
- copying the Junit Test to other modules
- introducing a dependency to mymodules-test.jar
Is there any plugin, that has this (JDepend) feature?
Or any other idea, to check in general for cyclic dependencies in all
modules?
Thanx, Torsten