From e07af960db9e5c1426d02b651fc48817ab5e53b9 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Fri, 27 Aug 2010 17:42:14 +0400 Subject: [PATCH] cosmetic --- .../JavaIntroduceVariableTest.java | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/refactoring/JavaIntroduceVariableTest.java b/java/java-tests/testSrc/com/intellij/refactoring/JavaIntroduceVariableTest.java index 6e3806ed5550..de23b90fcfe0 100644 --- a/java/java-tests/testSrc/com/intellij/refactoring/JavaIntroduceVariableTest.java +++ b/java/java-tests/testSrc/com/intellij/refactoring/JavaIntroduceVariableTest.java @@ -30,9 +30,18 @@ import com.intellij.testFramework.LightCodeInsightTestCase; * @author Konstantin Bulenkov */ public class JavaIntroduceVariableTest extends LightCodeInsightTestCase { - @Override - public void setUp() throws Exception { - super.setUp(); + public void testIntroduceBasedOnLiterals() throws Exception { + doTest("getA(\"simple\")", "simple"); + doTest("getA(\"SimpleName\")", "simpleName", "name"); + doTest("getA(\"simpleName\")", "simpleName", "name"); + doTest("getA(\"simpleClass\")", "simpleClass", "aClass"); + doTest("getA(\"short\")", "aShort"); + doTest("getA(\"boolean\")", "aBoolean"); + doTest("getA().getB(1, \"name\")", "name"); + doTest("getA(\"NAME\")", "name"); + doTest("getA(\"name\")", VariableKind.STATIC_FINAL_FIELD, "NAME"); + doTest("getA(\"SimpleName\")", VariableKind.STATIC_FINAL_FIELD, "SIMPLE_NAME"); + doTest("get(getB().getA(\"SimpleName\").getC())", "simpleName", "name"); } protected static void doTest(String expression, VariableKind kind, PsiType type, String...results) throws Exception { @@ -59,18 +68,4 @@ public class JavaIntroduceVariableTest extends LightCodeInsightTestCase { protected static void doTest(String expression, VariableKind kind, String...results) throws Exception { doTest(expression, kind, PsiType.getJavaLangString(getPsiManager(), GlobalSearchScope.allScope(getProject())), results); } - - public void testIntroduceBasedOnLiterals() throws Exception { - doTest("getA(\"simple\")", "simple"); - doTest("getA(\"SimpleName\")", "simpleName", "name"); - doTest("getA(\"simpleName\")", "simpleName", "name"); - doTest("getA(\"simpleClass\")", "simpleClass", "aClass"); - doTest("getA(\"short\")", "aShort"); - doTest("getA(\"boolean\")", "aBoolean"); - doTest("getA().getB(1, \"name\")", "name"); - doTest("getA(\"NAME\")", "name"); - doTest("getA(\"name\")", VariableKind.STATIC_FINAL_FIELD, "NAME"); - doTest("getA(\"SimpleName\")", VariableKind.STATIC_FINAL_FIELD, "SIMPLE_NAME"); - doTest("get(getB().getA(\"SimpleName\").getC())", "simpleName", "name"); - } }