|
First things first : We'd love to have any help , or extensions that you put together.
Click
here
for more details
How Code Pictures / NoUnit works
Code Pictures work in two steps:
(1) Convert Java -> XML
(2) Convert XML to HTML report.
Easy! We read Java byte code (because it is nice and tidy already) and generate an
XML document from it. We then transform this XML into whatever HTML report / Code
Picture / other output that we want. We can either do this in Java , or via an XSLT transformation
(using Xerces and Xalan from Apache). The latter is probably better is it separates
code from presentation , and is easier for everybody else to see what is going on.
Looking at the Code / Javadoc
Some good start points to look at the code / Javadoc are:
net.firstpartners.nounit.ui.command.CommandLineProcessor where the code starts
running from the command line.
net.firstpartners.nounit.ui.common.Processor controls all the main steps of the
conversion / transformation
package net.firstpartners.nounit.reader.bytecode contains all the 'Readers' of
Java byte code , and the 'Factories' that make code snippets out of them.
package net.firstpartners.nounit.snippet contains all the 'Snippets' i.e.
Classes that think they are pieces of Java Code (Methods , Classes etc). They are XML
aware - calling toXML() returns a representation of themselves in XML.
package net.firstpartners.nounit.report takes the XML generated by the Snippets
and makes Code Picture Reports out of them.
net.firstpartners.nounit.report.CallsReport and
net.firstpartners.nounit.report.SimpleReport are 'Pluggable' reports (they are command
line parameters) allowing the user to choose how much processing of the XML is done in java. We can
extend these reports easily.
Extending NoUnit and Code Pictures
You've lots of choices in extending NoUnit and writing Code Pictures to suit your needs.
In increasing order of difficulty , they are:
1. Change an Existing XSLT report.
Probably the best and easiest. XSL is
relatively easy to learn , and there a lot of tools and resources out there on
the web. You can even hack away at the samples provided!! Once you have created
your new report , simply pass it in as a Command Line Parameter.
(More details)
2. Create a new Java Report Class.
If you prefer working in Java , or simply
need more power then go with this option. Look at the way SimpleReport and CallsReport
are done , and write the class in a similar fashion. You can even do everything in Java
if you prefer (and not call the XSLT transformation). Once your report class
is written , pass it in as a Command Line Parameter.
(More details)
3. Information not available in the current XML. What if the information you require
isn't being read by the current Java Readers? What if the information is available
only in source , and not byte code? Then , please help us upgrade the
net.firstpartners.nounit.reader and sub-packages to read in all the
information in the Java source.
Remember! NoUnit and Code Pictures can give you lots of different views of your code ,
not just JUnit test coverage (More details).
Helping the NoUnit Project
NoUnit and Code Pictures have a lot of potential.
The NoUnit SourceForge home page
is the best place to get the latest news , updates , requests , and bug fixes on the
NoUnit project.
|