Part 5: Using the Audit
The previous parts of this tutorial showed how to create and deploy a custom audit, Empty Method Audit. This final part shows how to test your work.
After you deploy any audit, you should close and restart Together,
so it can load your new audit into the audit set.
- After Together has been restarted, you can see the new Empty Method Audit. From the main menu, choose Window > Preferences.
- In the tree on the left, choose Modeling > Quality
Assurance.
- Click the Audit tab, and open the Coding style branch.
The audits are sorted alphabetically. Scroll through the list until you
see the Empty Method Audit, which is checked. This means that it is part
of the current audit set. Click OK.
- To test the new audit, create a class with a method that has no statements in its body.
- Right click on the class in the UML Explorer, and choose
Quality Assurance > Audits.
- The results of running the audit set with the new Empty Method Audit includes a report in the audit table that the method in the class has failed. You can use the audit report in the table the same as any other audit. Click on the audit in the table to go directly to the offending code.
Shown below are the results of running the audit on a class that has two
methods. One method has a statement in its body, and the other one does
not.
When you complete this tutorial, you are ready to use the other check methods to implement your own custom audits. For more information, browse the