IDEA-31831 Intention aciton: Move initializer to setUp(). Implemented

This commit is contained in:
Danila Ponomarenko
2012-05-21 17:27:52 +04:00
parent 2ae9beb63a
commit ca3ef2eaaa
18 changed files with 460 additions and 141 deletions

View File

@@ -0,0 +1,15 @@
// "Move initializer to setUp method" "true"
package junit.framework;
public class X extends TestCase {
int i;
public void setUp() throws Exception {
super.setUp();
i = 7;
}
}
//HACK: making test possible without attaching jUnit
public abstract class TestCase {
}

View File

@@ -0,0 +1,13 @@
// "Move initializer to setUp method" "true"
public class X {
<caret>int i;
@org.testng.annotations.BeforeMethod
public void setUp() throws Exception {
i = 7;
}
@org.testng.annotations.Test
public void test() {
}
}

View File

@@ -0,0 +1,13 @@
// "Move initializer to setUp method" "true"
public class X {
<caret>int i;
@org.junit.Before
public void setUp() throws Exception {
i = 7;
}
@org.junit.Test
public void test() {
}
}

View File

@@ -0,0 +1,10 @@
// "Move initializer to setUp method" "true"
package junit.framework;
public class X extends TestCase {
<caret>int i = 7;
}
//HACK: making test possible without attaching jUnit
public abstract class TestCase {
}

View File

@@ -0,0 +1,4 @@
// "Move initializer to setUp method" "false"
public class X {
<caret>int i = 7;
}

View File

@@ -0,0 +1,8 @@
// "Move initializer to setUp method" "true"
public class X {
<caret>int i = 7;
@org.testng.annotations.Test
public void test() {
}
}

View File

@@ -0,0 +1,8 @@
// "Move initializer to setUp method" "true"
public class X {
<caret>int i = 7;
@org.junit.Test
public void test() {
}
}