Let's create an example class containing a method with the following JavaDoc comment:
/**
* @sequence.diagram test=net.sf.jsequnit.example.SequenceSampleTest#testSimpleSequenceDiagram()
*/
public boolean simpleSequenceDiagram() {
simpleMethod();
callingMethod();
return true;
}
Now providing the fitting test class with the test method indicated by the JavaDoc tag:
/**
* Test method to generate sequence diagram for {@link net.sf.jsequnit.example.SequenceSample#simpleSequenceDiagram()}
*/
@Test
public void testSimpleSequenceDiagram() {
SequenceSample instance = new SequenceSample();
boolean result = instance.simpleSequenceDiagram();
Assert.assertTrue(result);
}
When running the JavaDoc with the SequenceDoclet
The following sequence diagram is generated:
and integrated in the generated JavaDoc documentation