mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IGQuickFixesTestCase generalized; cleanup
This commit is contained in:
+11
-6
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user