net.sf.jsequnit.example
Class SequenceSample

java.lang.Object
  extended by net.sf.jsequnit.example.SequenceSample

public class SequenceSample
extends Object

This class shows several examples how to use JSeqUnit.

Author:
jacek.ratzinger

Constructor Summary
SequenceSample()
           
 
Method Summary
 String boundaryMethod()
          This example demonstrates the usage of the 'upto=...' parameter.
 void calledByBar()
           
 void calledByFoo()
           
 String excludeMethodsFromDiagram()
          This example demonstrates the usage of the 'omit=...' parameter.
 String excludeMethodsFromDiagramWithDefaultExcludes()
          This example demonstrates the usage of default excludes.
 String includeMethodsInDiagram()
          This example demonstrates the usage of the 'add=...' parameter.
 boolean onlyIncludePublicMethodCalls()
          This example shows the usage of the 'public-only' parameter.
 void publicMethod()
           
 boolean simpleSequenceDiagram()
          This is a simple JavaDoc tag, that uses the given JUnit test method to trace the method execution and to generate the resulting sequence diagram.
 boolean useOtherRootMethod()
          This example shows how to specify a method as a starting point of the sequence diagram.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceSample

public SequenceSample()
Method Detail

simpleSequenceDiagram

public boolean simpleSequenceDiagram()
This is a simple JavaDoc tag, that uses the given JUnit test method to trace the method execution and to generate the resulting sequence diagram.

Sequence Diagram:

useOtherRootMethod

public boolean useOtherRootMethod()
This example shows how to specify a method as a starting point of the sequence diagram. In this case the documented method is not used as the first method to appear in the sequence diagram, but the method specified by the trace parameter.

Sequence Diagram:

excludeMethodsFromDiagram

public String excludeMethodsFromDiagram()
This example demonstrates the usage of the 'omit=...' parameter. This method calls Foo.callBack() and Bar.callBack(), which in turn call the methods calledByFoo() and calledByBar() respectively. The 'omit' parameter prevents the appearance of Foo.callBack() and Bar.callBack() in the sequence diagram. However, the consecutive method calls (i.e. calledByFoo() and calledByBar()) are still included in the sequence diagram.

Sequence Diagram:

excludeMethodsFromDiagramWithDefaultExcludes

public String excludeMethodsFromDiagramWithDefaultExcludes()
This example demonstrates the usage of default excludes. It does the same as the previous example excludeMethodsFromDiagram(), This time we don't specify the excludes for the package net.sf.jsequnit.example.bar and the contained class Bar as parameter to the sequence diagram tag, but rely on the default excludes specified by the Java property: -Djsequnit.default.excludes=java*,javax.*,sun.*,com.sun.*,net.sf.jsequnit.example.bar.*

Sequence Diagram:

includeMethodsInDiagram

public String includeMethodsInDiagram()
This example demonstrates the usage of the 'add=...' parameter. Like the excludeMethodsFromDiagram() method, this method calls Foo.callBack() and Bar.callBack(). The 'add' parameter causes that only methods of this class SequenceSample are included and thus the methods of Foo and Bar are not part of the resulting sequence diagram.

Sequence Diagram:

boundaryMethod

public String boundaryMethod()
This example demonstrates the usage of the 'upto=...' parameter. In the course of the method execution the method callingMethod() executes the method calledMethd(). The 'upto' parameter instructs JSeqUnit to include the method callingMethod() into the sequence diagram, but the sub-sequent methods (i.e. calledMethod()) are not included in the sequence diagram.

Sequence Diagram:

onlyIncludePublicMethodCalls

public boolean onlyIncludePublicMethodCalls()
This example shows the usage of the 'public-only' parameter. A private method named privateMethod() and a public method named publicMethod() are called. The 'public-only' parameter causes that the publicMethod() is as usual part of the sequence diagram, but the privateMethod() is excluded.

Sequence Diagram:

calledByFoo

public void calledByFoo()

calledByBar

public void calledByBar()

publicMethod

public void publicMethod()


Copyright © 2011. All Rights Reserved.