UML diagrams compliment inline documentation (
javadoc ) and allow to better explore/understand a design. Moreover, you can print and bring them to table to discuss a design.
In this post, we will install and use the ObjectAid plugin for Eclipse to produce jUnit lib class diagrams. Then, we will be able to generate UML diagrams by simply dragging and dropping classes into the editor. We can further manipulate the diagram by selecting which references, operations or attributes to display.
Open Eclipse and go to Help > Install New Software
Click on add to add a new repository
ObjectAid UML Explorer
Next, select the ObjectAid Class Diagram plugin –
it is free – and click Next. The Sequence Diagram one requires a paid license.
Finish to confirm your choices and start the instalation process.
Click Ok on the security warningSelect Restart Now after the installation completes to restart Eclipse.
To create a new UML diagram we start the ObjectAid wizard with
Other… and start typing in the textbox
Class Diagram to filter the desired wizard. Click
Next, and enter a directory and name for the diagram.
Drop java source or compiled class files into the visual UML editor to start populating the diagram. Right click on a generated class to bring up a context menu and adjust visibility, operations attributes, etc as you like.
Below, we see the
Assert class from the jUnit library with all operations and fileds hidden.
From the context menu, we can add implementations and associations for a selected class. In the following screen, we add the interface
Test implemented by the
This is how part of the jUnit UML class diagram look after adding some more classes.
To auto layout the diagram right click anywhere within the editor and select
Layout Diagram. From the same menu, you can export the diagram to an image (
gif png jpeg ) by clicking the Save As Image… menu item
Have fun with the plugin, leave a comment if you like 🙂
- Windows command to start MySQL “system error 5”
- import org.junit.Test And @ test error reporting — solutions
- “Launch” appears when eclipse C + + CDT runs the program failed.binary not found”
- Failed to execute goal in Maven build org.apache.tomcat .maven:
- The usage of Java JUnit unit test and the solution of initialization error
- Eclipse: unable to open editor: no ID org.eclipse.jdt . ui.CompilationUnitEditor Editor descriptor for
- Spring configuration transaction, JUnit unit test error “failed to load ApplicationContext”
- Error in idea @ data entity class get / set
- Question: cannot create windows service for mysql.error : 0 (install MySQL)
- Spring integrates JUnit configuration
- When nodejs is installed: the error code is 2503
- How to run Python program directly with atom
- How to Fix IWAB0489E Error when deploying Web service to Axis runtime
- @Solution to override error
- Problem solving: PDF cannot be opened, and acrobat failed to connect to a DDE server appears
- Set code indent to space indent in eclipse
- LDAP: error code 21 – objectclass: value ා 0 invalid per syntax
- @How to solve eclipse error after setter and @ getter (@ data) annotation
- Solution to the flash of visual studio 2017 running program
- eclipse cdt Program “make” not found in PATH