mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
test for invoke return type
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
package my;
|
||||
|
||||
class Sample {
|
||||
static void foo() {
|
||||
int x =5;
|
||||
int y =5;
|
||||
int <caret>z =5;
|
||||
}
|
||||
}
|
||||
+25
@@ -74,6 +74,31 @@ public class ExtractMethodObject4DebuggerTest extends LightRefactoringTestCase {
|
||||
" }");
|
||||
}
|
||||
|
||||
public void testInvokeReturnType() throws Exception {
|
||||
doTest("x = 6; y = 6;", "Test test = new Test().invoke();\n" +
|
||||
" x = test.getX();\n" +
|
||||
" y = test.getY();",
|
||||
|
||||
"public static class Test {\n" +
|
||||
" private int x;\n" +
|
||||
" private int y;\n" +
|
||||
"\n" +
|
||||
" public int getX() {\n" +
|
||||
" return x;\n" +
|
||||
" }\n" +
|
||||
"\n" +
|
||||
" public int getY() {\n" +
|
||||
" return y;\n" +
|
||||
" }\n" +
|
||||
"\n" +
|
||||
" public Test invoke() {\n" +
|
||||
" x = 6;\n" +
|
||||
" y = 6;\n" +
|
||||
" return this;\n" +
|
||||
" }\n" +
|
||||
" }");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Sdk getProjectJDK() {
|
||||
return IdeaTestUtil.getMockJdk18();
|
||||
|
||||
Reference in New Issue
Block a user