net.sf.jsequnit.diagram
Class DiagramCreator

java.lang.Object
  extended by net.sf.jsequnit.diagram.DiagramCreator

public class DiagramCreator
extends Object

Generates sequence diagrams based on tracing of test executions. It uses TestMethodRunnerFactory to generate a VirtualMachine. The method calls in this VM are traced similar to a debugger.

Author:
jacek.ratzinger

Constructor Summary
DiagramCreator()
           
 
Method Summary
 void createSequenceDiagram(String qualifiedTestMethod, String qualifiedTraceMethod, List<String> includes, List<String> excludes, List<String> boundaryMethods, boolean isPublicOnly, String testExecutionClasspath, String outputFileName)
          Creates a sequenced diagram based on the trace of the executed test method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiagramCreator

public DiagramCreator()
Method Detail

createSequenceDiagram

public void createSequenceDiagram(String qualifiedTestMethod,
                                  String qualifiedTraceMethod,
                                  List<String> includes,
                                  List<String> excludes,
                                  List<String> boundaryMethods,
                                  boolean isPublicOnly,
                                  String testExecutionClasspath,
                                  String outputFileName)
                           throws NoSuchMethodException,
                                  IOException
Creates a sequenced diagram based on the trace of the executed test method. The following sequence diagram shows how this method works.

Parameters:
qualifiedTestMethod - The fully qualified name of the test method that should be executed.
qualifiedTraceMethod - The fully qualified name of the method, where the tracing should start. This is the first method to appear / is called in the resulting sequence diagram.
includes - A list of packages, classes, and/or methods that should be included in the sequence diagram. This is a simplified regular expression that must either be an exact match or end with an asterix (*). For example foo.Foo or baa.*. Multiple exclude patterns are separated by a comma (,).
excludes - A list of packages, classes, and/or methods that should be excluded from the sequence diagram. This is a simplified regular expression that must either be an exact match or end with an asterix (*). For example foo.Foo or baa.*. Multiple exclude patterns are separated by a comma (,).
boundaryMethods - A list of methods where tracing should stop. In contrast to the exclude parameter, where method calls are excluded, but subsequent calls of the excluded methods still appear in the sequence diagram, the boundary methods are included in the resulting diagram, but all its sub calls are omitted.
isPublicOnly - If true only public methods are included in the resulting sequence diagram.
outputFileName - The full path to the image file for the sequence diagram.
outputFileName2 -
Throws:
NoSuchMethodException - if the JVM cannot find one of the given methods.
IOException - if an error occurs while writing the image file.
Sequence Diagram:


Copyright © 2011. All Rights Reserved.