Using IntelliJ Structural Search And Replace

Upgrading from JUnit 3.7 to 3.8

Recently had to upgrade an entire codebase from 3.7 (very old) to 3.8.1 (quite old) The main annoyance was a contructor that's no longer needed, just gets in the way.

Search Pattern

Variables

TESTCASE = junit.framework.TestCase , replace in type hierarchy = true
constructor = min 0, max unlimited
content = min 0, max unlimited

Replacement Pattern

Removing empty setUp()

Search Pattern

Variables

TESTCASE = junit.framework.TestCase
content = min 0, max unlimited

Replacement Pattern

Tidy Up

Then just need to fix manual calls to constructors of the test classes (shouldn't be many...)

Remove empty constructors

Search Pattern

Variables

content - unlimited
extends - unlimited

Replace Pattern

Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account. You can also Sign Up for a new account.


Browse Space

- Pages
- Blog
- Labels
- Attachments
- Bookmarks
- Mail
- Advanced
- Activity

Explore Confluence

- Popular Labels
- Notation Guide

Your Account

Log In

 

Other Features

Add Content

- Add Comment