#18 Pattern names in XML report


I have created a patch that might be of some use to other Macker
users. The patch adds the name of the pattern to each violation in the
violation report. Instead of only seeing from class to class, the name of
the pattern is also added so that you can see which pattern is involved
in the rule violation.

A coworker of mine, Michael Sassin, and I use the patterns to define
modules and the rules to enforce dependencies between the modules.
This patch helps identify classes that are not part of a pattern/module or
classes that might be a part of two different patterns/modules.

The XML generated looks like:

<access-rule-violation severity="error">
<message>Violation of rules in module in "common-utils"!</
<from module="common-utils">
<to module="top-level-module">

This is a patch against the CVS repository. Here's a summary of the

AccessRuleViolation - I added the EvaluationContext to the violation so
that when when a violation is encountered, I can essentially re-run the
rule test when the XmlReportingListener executes. This seems like
somewhat of a hack... but it works. Maybe you know of a better way to
implement this.

XmlReportingListener - I added a new method called
findModuleName that uses the EvaluationContext from the
AccessRuleViolation to find the name of the module for the from and to

RuleSet - Added a method to return all of the patterns (module names)

RecordingTest - seems to fail on Windows. Made simple fix.

html-basic.xsl - Added the module to the HTML report.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks