--
~ Mike Nereson
package a;
import b.*;
public class A {
public int fooA(){
B b = new B();
return b.bar() + 5;
}
public int bla() {
return 0;
}
}
/////////////// 8<
package b;
import a.*;
public class B {
public int bar() {
A a = new A();
return a.bla();
}
}
//// 8<
<architecture>
<configuration>
<sources no-packages="exception">
<source not-found="exception">bin/a</source>
<source not-found="exception">bin/b</source>
</sources>
<cyclicaldependency test="true"></cyclicaldependency>
</configuration>
<rules>
<rule id="base">
<comment>nothing that could be violated so far</comment>
<packages>
<package>a</package>
<package>b</package>
</packages>
<violations>
<!--<violation>b</violation>-->
</violations>
</rule>
</rules>
</architecture>
//// 8<
test class (part of it; w/o boilerplate code):
public String getConfigurationFileName() {
return "architecture-rules.xml";
}
public void testArchitecture() {
assertTrue(doTests());
}
Mike Nereson schrieb:
--
Prof. Dr. Axel Böttcher
Fakultät für Informatik und Mathematik
Hochschule für Angewandte Wissenschaften - FH MünchenLothstr. 34, 80335 München
Tel. +49(0)89 1265-3725 Fax: +49(0)89 1265-3780
URL: http://www.cs.fhm.edu/~boettcha/
------------------------------------------------------------------------------