IGQuickFixesTestCase generalized; cleanup

This commit is contained in:
Roman Shevchenko
2011-02-08 12:16:45 +01:00
parent bca1ff64b2
commit f44455c237
6 changed files with 12 additions and 8 deletions
@@ -13,26 +13,31 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.siyeh.ig.fixes.bugs;
import com.siyeh.ig.bugs.CastConflictsWithInstanceofInspection;
/*
* User: anna
* Date: 16-Jun-2009
*/
package com.siyeh.ig.fixes.bugs;
public class CastConflictsWithInstanceofFixesTest extends IGQuickFixesTestCase {
@Override
public void setUp() throws Exception {
super.setUp();
myFixture.enableInspections(new CastConflictsWithInstanceofInspection());
}
public void testReplaceCastInDeclaration() throws Throwable {
public void testReplaceCastInDeclaration() {
doTest("replaceCastInDeclaration", "Replace cast");
}
public void testReplaceInstaneOf() throws Throwable {
public void testReplaceInstanceOf() {
doTest("replaceInstanceOf", "Replace instanceof");
}
@Override
protected String getRelativePath() {
return "bugs/castconflicts";
return "bugs/castConflicts";
}
}
@@ -36,7 +36,6 @@ public abstract class IGQuickFixesTestCase extends UsefulTestCase {
final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = fixtureFactory.createFixtureBuilder();
myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(testFixtureBuilder.getFixture());
myFixture.enableInspections(new CastConflictsWithInstanceofInspection());
final String dataPath = PluginPathManager.getPluginHomePath("InspectionGadgets") + "/test/com/siyeh/igfixes/";
myFixture.setTestDataPath(dataPath);
final JavaModuleFixtureBuilder builder = testFixtureBuilder.addModule(JavaModuleFixtureBuilder.class);
@@ -52,7 +51,7 @@ public abstract class IGQuickFixesTestCase extends UsefulTestCase {
super.tearDown();
}
protected void doTest(String testName, String hint) throws Throwable {
protected void doTest(String testName, String hint) {
myFixture.configureByFile(getRelativePath() + "/" + testName + ".java");
final IntentionAction action = myFixture.findSingleIntention(hint);
Assert.assertNotNull(action);