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.

@Before

Name: Before
Context: Java
Description: JUnit setUp method

Download as XML

@After

Name: After
Context: Java
Description: JUnit tearDown method

Download as XML

Leave a Reply

Your email address will not be published. Required fields are marked *

Please type the characters of this captcha image in the input box

Please type the characters of this captcha image in the input box