Eclipse templates for JUnit setUp() and tearDown() methods

In a previous post, I suggested Java code templates for standard UIMA/uimaFit structures.
In this post, I add two more templates, this time for JUnit’s “setUp” and “tearDown” methods.

To add these templates to your Eclipse workspace, open the Eclipse preferences via Windows -> Preferences. And navigate to Java -> Editor -> Templates.
Either you use the provided XML files and select Import… or you create a new template with New… and copy the text from below.


Name: Before
Context: Java
Description: JUnit setUp method

Download as XML


Name: After
Context: Java
Description: JUnit tearDown method

Download as XML

Leave a Reply