inline parameter: check static access (IDEA-52170)

This commit is contained in:
anna
2010-02-11 17:56:31 +03:00
parent 7c2d78c47c
commit 292373e213
5 changed files with 102 additions and 0 deletions
@@ -192,6 +192,33 @@ public class InlineParameterTest extends LightCodeInsightTestCase {
}
}
public void testRefNonStatic() throws Exception {
try {
doTest(false);
}
catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
assertEquals("Parameter initializer depends on method <b><code>provideObject()</code></b> which is not available inside the static method", e.getMessage());
}
}
public void testRefNonStaticClass() throws Exception {
try {
doTest(false);
}
catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
assertEquals("Parameter initializer depends on non static class which is not available inside static method", e.getMessage());
}
}
public void testRefThisFromStatic() throws Exception {
try {
doTest(false);
}
catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
assertEquals("Parameter initializer depends on this which is not available inside the static method", e.getMessage());
}
}
private void doTest(final boolean createLocal) throws Exception {
getProject().putUserData(InlineParameterExpressionProcessor.CREATE_LOCAL_FOR_TESTS,createLocal);