Defining what to exclude in all sequence diagrams

The omit parameter exludes the given methods from the defined sequence diagram. Additionally, JSeqUnit excludes by default the following packages from sequence diagrams:

This reduces the size of the resulting sequence diagrams and improves the speed of the sequence diagram generation.
However, sometimes it could be desirable to have such classes and methods as part of the sequence diagrams (e.g. when the Java folks use JSeqUnit :-), or it could be convenient to exclude other packages from all sequence diagrams of a given project (e.g. projects based on the eclipse/osgi plugin framework: org.eclipse.*, org.osgi.*).
The property jsequnit.default.excludes can be used to change these default excludes. e.g. -J-Djsequnit.default.excludes=java.*,javax.*,sun.*,com.sun.*,org.eclipse.*,org.osgi.*

Example

Given the Java class net.sf.jsequnit.example.SequenceSample containing a method excludeMethodsFromDiagramWithDefaultExcludes that calls methods of the following classes:

  • net.sf.jsequnit.example.SequenceSample
  • net.sf.jsequnit.example.foo.Foo
  • net.sf.jsequnit.example.bar.Bar

where the JavaDoc of the method contains a sequence diagram tag only with a 'test=...' parameter, but without specifying excludes for the class net.sf.jsequnit.example.bar.Bar:

      @sequence.diagram
	    test=net.sf.jsequnit.example.SequenceSampleTest#testExcludeMethodsFromDiagramWithDefaultExcludes()
	    omit=net.sf.jsequnit.example.foo.Foo
    

when JSeqUnit is executed with the following JavaDoc command

    javadoc 
      -J-Djsequnit.default.excludes=java*,javax.*,sun.*,com.sun.*,net.sf.jsequnit.example.bar.*
      -taglet net.sf.jsequnit.javadoc.SequenceTaglet 
      -tagletpath target/classes;target/test-classes;target/jsequnit-2.0.jar;target/lib/junit-4.10.jar;target/lib/jseq-0.6.jar;target/lib/sdedit-light-3.1.jar 
      -sourcepath src/site/example/main
      -d target/test-dir 
      net.sf.jsequnit.example
    

we get a sequence diagram containing methods calledByFoo and calledByBar of the class net.sf.jsequnit.example.SequenceSample, but without method calls to callBack of classes net.sf.jsequnit.example.foo.Foo and net.sf.jsequnit.example.bar.Bar.

Configuring Default Excludes in Maven

Add the parameter 'additionalJOption' to the maven-javadoc-plugin, to configure default excludes. The following example shows how to add the packages 'org.eclipse.*, org.osgi.*' to the default excludes.

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
      	  <execution>
            <id>generate-javadoc</id>
            <phase>site</phase>
            <goals>
              <goal>javadoc</goal>
            </goals>
            <configuration>
              <additionalJOption>-J-Djsequnit.default.excludes=java.*,javax.*,sun.*,com.sun.*,org.eclipse.*,org.osgi.*</additionalJOption>
              <taglet>net.sf.jsequnit.javadoc.SequenceTaglet</taglet>
              <tagletArtifact>
                <groupId>net.sf.jsequnit</groupId>
                <artifactId>jsequnit</artifactId>
                <version>2.0</version>
              </tagletArtifact>
              <tagletPath>${project.build.outputDirectory};${project.build.testOutputDirectory}</docletPath>
            </configuration>
          </execution>
        </executions>
      </plugin>