Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " extends TestCase"
- @Override
- protected void setUp() throws Exception { }
- @Before
- protected void setUp() throws Exception { }
- @Override
- protected void tearDown() throws Exception { }
- @After
- protected void tearDown() throws Exception { }
- // Add @Test
- Replace:
- ^[ t]+(public +void +test)
- With:
- @Testn $1
- Regular Expression: on
- Case sensitive: on
- File name filter:
- *Test.java
- // Remove double @Test's on already @Test annotated files
- Replace:
- ^[ t]+@Testn[ t]+@Test
- With:
- @Test
- Regular Expression: on
- Case sensitive: on
- File name filter:
- *Test.java
- // Remove all empty setUp's
- Replace:
- ^[ *]+((public|protected) +)?void +setUp()[^{]*{s*(super.setUp();)?s*}n([ t]*n)?
- With nothing
- Regular Expression: on
- Case sensitive: on
- File name filter:
- *Test.java
- // Add @Before to all setUp's
- Replace:
- ^([ t]+@Overriden)?[ t]+((public|protected) +)?(void +setUp())
- With:
- @Beforen public void setUp()
- Regular Expression: on
- Case sensitive: on
- File name filter:
- *Test.java
- // Remove double @Before's on already @Before annotated files
- Replace:
- ^[ t]+@Beforen[ t]+@Before
- With:
- @Before
- Regular Expression: on
- Case sensitive: on
- File name filter:
- *Test.java
- // Remove all empty tearDown's
- Replace:
- ^[ *]+((public|protected) +)?void +tearDown()[^{]*{s*(super.tearDown();)?s*}n([ t]*n)?
- With nothing
- Regular Expression: on
- Case sensitive: on
- File name filter:
- *Test.java
- // Add @After to all tearDown's
- Replace:
- ^([ t]+@Overriden)?[ t]+((public|protected) +)?(void +tearDown())
- With:
- @Aftern public void tearDown()
- Regular Expression: on
- Case sensitive: on
- File name filter:
- *Test.java
- // Remove double @After's on already @After annotated files
- Replace:
- ^[ t]+@Aftern[ t]+@After
- With:
- @After
- Regular Expression: on
- Case sensitive: on
- File name filter:
- *Test.java
- // Remove old imports, add new imports
- Replace:
- ^([ t]*import[ t]+junit.framework.Assert;n)?[ t]*import[ t]+junit.framework.TestCase;
- With:
- import org.junit.After;nimport org.junit.Before;nimport org.junit.Test;nimport static org.junit.Assert.*;
- Regular Expression: on
- Case sensitive: on
- File name filter:
- *Test.java
- // Remove all extends TestCase
- Replace:
- [ t]+extends[ t]+TestCase[ t]+{
- With:
- {
- Regular Expression: on
- Case sensitive: on
- File name filter:
- *Test.java
- // Look for import junit.framework;
- Find:
- import junit.framework
- Manually fix
- Regular Expression: on
- Case sensitive: on
- // Look for ignored tests (FIXME, disabled, ...)
- Find:
- public[ t]+void[ t]+w+test
- Manually fix
- Regular Expression: on
- Case sensitive: on
- // Look for dummy/empty tests
- Find:
- public[ t]+void[ t]+test[wd]*(s*)s*{s*(//[^n]*)?s*}
- Manually fix
- Regular Expression: on
- Case sensitive: on
- public void test
- @Testn public void test
- @Overriden.*protected void onSetUp
- @Beforen protected void onSetUp
- @Overriden.*protected void onTearDown
- @Aftern protected void onTearDown
Add Comment
Please, Sign In to add comment