GroboUtils

About GroboUtils

Sourceforge
Project

For Developers

GroboTestingAutodoc version 1.0.0alpha2

Using AutoDoc

Author:Matt Albrecht

Adding AutoDoc To Your Tests

To get started with using AutoDoc, first declare an instance of the AutoDoc facade in your test:

1:import net.sourceforge.groboutils.autodoc.v1.AutoDoc;
2:public class MyUTest extends TestCase
3:{
4:    private static final Class THIS_CLASS = MyUTest.class;
5:    private static final AutoDoc DOC = new AutoDoc( THIS_CLASS );
This will create a new AutoDoc instance that has associations with its generated documentation to this class, much like standard logging frameworks.

Then, whenever you need a bit of documentation in your test, you can reference this DOC instance.

To add logging, use something like:

1:            DOC.getLog().info("===== Adding test for "+testname);
The different levels of logging are debug, info, and warn. Each may take, as arguments: (Object), (Object[]), (Object, Throwable), and (Object[], Throwable).

To reference a bug or problem tracker ticket, use:

1:        DOC.getIT().testsIssue( 526454 );
It takes as arguments a method name (String) followed by the ticket ID (String or long), or the ticket ID by itself. If the ticket ID is given alone, then the method name is dynamically discovered using stack trace evaluation.




SourceForge Logo
This space graciously provided by the SourceForge project
Copyright © 2002-2004 GroboUtils Project.
All rights reserved.