test for invoke return type

This commit is contained in:
Egor.Ushakov
2014-09-08 15:31:50 +04:00
parent 8a144d30d5
commit d20820b0f8
2 changed files with 34 additions and 0 deletions
@@ -0,0 +1,9 @@
package my;
class Sample {
static void foo() {
int x =5;
int y =5;
int <caret>z =5;
}
}
@@ -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();