inplace introduce param: no need to correct caret position with or without conflict

This commit is contained in:
anna
2011-07-15 14:20:57 +04:00
parent a2c55164f2
commit bc579f1e58
6 changed files with 46 additions and 6 deletions

View File

@@ -91,9 +91,6 @@ public abstract class AbstractInplaceIntroduceTest extends LightCodeInsightTestC
state.gotoEnd(false);
checkResultByFile(getBasePath() + name + "_after.java");
}
catch (Throwable e) {
e.printStackTrace();
}
finally {
myEditor.getSettings().setVariableInplaceRenameEnabled(enabled);
templateManager.setTemplateTesting(false);

View File

@@ -65,6 +65,29 @@ public class InplaceIntroduceParameterTest extends AbstractInplaceIntroduceTest
doTestEscape();
}
public void testExtractParamOverLocal() throws Exception {
doTest(new Pass<AbstractInplaceIntroducer>() {
@Override
public void pass(AbstractInplaceIntroducer abstractInplaceIntroducer) {
}
});
}
public void testExtractConflictingParamOverLocal() throws Exception {
try {
doTest(new Pass<AbstractInplaceIntroducer>() {
@Override
public void pass(AbstractInplaceIntroducer abstractInplaceIntroducer) {
type("p");
}
});
}
catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
assertEquals("There is already a parameter <b><code>p</code></b>. It will conflict with an introduced parameter", e.getMessage());
return;
}
fail("Conflict expected");
}
private static class MyIntroduceParameterHandler extends IntroduceParameterHandler implements MyIntroduceHandler {