create property:both getter nad setter from usage (IDEA-73186); return cursor to the initial state

This commit is contained in:
anna
2012-07-12 21:01:39 +02:00
parent b2530c8d58
commit f3f98b6f54
10 changed files with 172 additions and 5 deletions
@@ -1,6 +1,7 @@
// "Create Getter" "true"
public class Test {
Integer field;
public foo() {
getField();
}
@@ -0,0 +1,16 @@
// "Create Property" "true"
class Calculator {
int i;
public void printError() {
setI(0);
}
public void setI(int i) {
this.i = i;
}
public int getI() {
return i;
}
}
@@ -0,0 +1,16 @@
// "Create Property" "true"
class Calculator {
private int i;
public void printError() {
setI(0);
}
public void setI(int i) {
this.i = i;
}
public int getI() {
return i;
}
}
@@ -0,0 +1,8 @@
// "Create Property" "false"
class Calculator {
int i;
public void printError() {
set<caret>I(0);
}
public int getI() {return i;}
}
@@ -0,0 +1,7 @@
// "Create Property" "true"
class Calculator {
int i;
public void printError() {
set<caret>I(0);
}
}
@@ -0,0 +1,6 @@
// "Create Property" "true"
class Calculator {
public void printError() {
set<caret>I(0);
}
}
@@ -0,0 +1,26 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.codeInsight.daemon.quickFix;
public class CreatePropertyFromUsageTest extends LightQuickFix15TestCase {
public void test() throws Exception { doAllTests(); }
@Override
protected String getBasePath() {
return "/codeInsight/daemonCodeAnalyzer/quickFix/createPropertyFromUsage";
}
}