diff --git a/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517/after/Test.java b/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517/after/Test.java index 285b769dd470..8519e3c3f5d9 100644 --- a/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517/after/Test.java +++ b/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517/after/Test.java @@ -2,17 +2,17 @@ interface Int { void method(T x); } -class Sub implements Int { - public void method(Xint x) { +class Sub implements Int { + public void method(XInt x) { x.inInt(); } } -interface Xint { +interface XInt { void inInt(); } -class Xyz implements Xint { +class Xyz implements XInt { public void inInt() { } diff --git a/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517/before/Test.java b/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517/before/Test.java index 27c66a87a0ed..673c36539ceb 100644 --- a/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517/before/Test.java +++ b/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517/before/Test.java @@ -8,11 +8,11 @@ class Sub implements Int { } } -interface Xint { +interface XInt { void inInt(); } -class Xyz implements Xint { +class Xyz implements XInt { public void inInt() { } diff --git a/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517NOOP/after/Test.java b/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517NOOP/after/Test.java index 3da24068ef20..3359088fe79f 100644 --- a/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517NOOP/after/Test.java +++ b/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517NOOP/after/Test.java @@ -14,11 +14,11 @@ class Sub implements Int { } } -interface Xint { +interface XInt { void inInt(); } -class Xyz implements Xint { +class Xyz implements XInt { public void inInt() { } diff --git a/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517NOOP/before/Test.java b/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517NOOP/before/Test.java index 3da24068ef20..3359088fe79f 100644 --- a/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517NOOP/before/Test.java +++ b/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517NOOP/before/Test.java @@ -14,11 +14,11 @@ class Sub implements Int { } } -interface Xint { +interface XInt { void inInt(); } -class Xyz implements Xint { +class Xyz implements XInt { public void inInt() { } diff --git a/java/java-tests/testData/refactoring/turnRefsToSuper/anonymousWithTypeArguments/after/Clazz.java b/java/java-tests/testData/refactoring/turnRefsToSuper/anonymousWithTypeArguments/after/Clazz.java index 94ce2ffe56c6..ad5dffbf7d24 100644 --- a/java/java-tests/testData/refactoring/turnRefsToSuper/anonymousWithTypeArguments/after/Clazz.java +++ b/java/java-tests/testData/refactoring/turnRefsToSuper/anonymousWithTypeArguments/after/Clazz.java @@ -1,20 +1,20 @@ -interface Intf { +interface IntF { } -interface Factory { +interface Factory { E create(); void save(E obj); static class helper { - static Factory get2() { - return (Factory)new Factory() { - public Intf create() { return null; } - public void save(Intf obj) { } + static Factory get2() { + return (Factory)new Factory() { + public IntF create() { return null; } + public void save(IntF obj) { } }; } } } -public class Clazz implements Intf { +public class Clazz implements IntF { } diff --git a/java/java-tests/testData/refactoring/turnRefsToSuper/anonymousWithTypeArguments/before/Clazz.java b/java/java-tests/testData/refactoring/turnRefsToSuper/anonymousWithTypeArguments/before/Clazz.java index e2cd2a9721f5..9151a8246fa2 100644 --- a/java/java-tests/testData/refactoring/turnRefsToSuper/anonymousWithTypeArguments/before/Clazz.java +++ b/java/java-tests/testData/refactoring/turnRefsToSuper/anonymousWithTypeArguments/before/Clazz.java @@ -1,12 +1,12 @@ -interface Intf { +interface IntF { } -interface Factory { +interface Factory { E create(); void save(E obj); static class helper { - static Factory get2() { + static Factory get2() { return (Factory)new Factory() { public Clazz create() { return null; } public void save(Clazz obj) { } @@ -16,5 +16,5 @@ interface Factory { } -public class Clazz implements Intf { +public class Clazz implements IntF { } diff --git a/java/java-tests/testData/refactoring/turnRefsToSuper/typeArgumentsParam/after/Clazz.java b/java/java-tests/testData/refactoring/turnRefsToSuper/typeArgumentsParam/after/Clazz.java index ef0d6df502c4..092b88dff846 100644 --- a/java/java-tests/testData/refactoring/turnRefsToSuper/typeArgumentsParam/after/Clazz.java +++ b/java/java-tests/testData/refactoring/turnRefsToSuper/typeArgumentsParam/after/Clazz.java @@ -1,22 +1,21 @@ -interface Intf { +interface IntF { } -interface Factory { +interface Factory { E create(); void save(E obj); static class helper { - static Factory get() { + static Factory get() { return null; } } } - -public class Clazz implements Intf { +public class Clazz implements IntF { void bar() { - Intf y = Factory.helper.get().create(); + IntF y = Factory.helper.get().create(); Factory.helper.get().save(y); } } diff --git a/java/java-tests/testData/refactoring/turnRefsToSuper/typeArgumentsParam/before/Clazz.java b/java/java-tests/testData/refactoring/turnRefsToSuper/typeArgumentsParam/before/Clazz.java index fde99a08dac0..2601cb87c364 100644 --- a/java/java-tests/testData/refactoring/turnRefsToSuper/typeArgumentsParam/before/Clazz.java +++ b/java/java-tests/testData/refactoring/turnRefsToSuper/typeArgumentsParam/before/Clazz.java @@ -1,20 +1,19 @@ -interface Intf { +interface IntF { } -interface Factory { +interface Factory { E create(); void save(E obj); static class helper { - static Factory get() { + static Factory get() { return null; } } } - -public class Clazz implements Intf { +public class Clazz implements IntF { void bar() { Clazz y = Factory.helper.get().create(); Factory.helper.get().save(y); diff --git a/java/java-tests/testSrc/com/intellij/refactoring/TurnRefsToSuperTest.java b/java/java-tests/testSrc/com/intellij/refactoring/TurnRefsToSuperTest.java index ff9dae636d0b..490c7c3f3634 100644 --- a/java/java-tests/testSrc/com/intellij/refactoring/TurnRefsToSuperTest.java +++ b/java/java-tests/testSrc/com/intellij/refactoring/TurnRefsToSuperTest.java @@ -15,7 +15,6 @@ */ package com.intellij.refactoring; -import com.intellij.JavaTestUtil; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.CommonClassNames; @@ -25,146 +24,41 @@ import com.intellij.refactoring.turnRefsToSuper.TurnRefsToSuperProcessor; import org.jetbrains.annotations.NonNls; public class TurnRefsToSuperTest extends MultiFileTestCase { + public void testSuperClass() throws Exception { doTest("AClass", "ASuper", true); } + public void testMethodFromSuper() throws Exception { doTest("AClass", "ASuper", true); } + public void testRemoveImport() throws Exception { doTest("pack1.AClass", "pack1.AnInterface", true); } + public void testToArray() throws Exception { doTest("A", "I", true); } + public void testArrayElementAssignment() throws Exception { doTest("C", "I", true); } + public void testReturnValue() throws Exception { doTest("A", "I", true); } + public void testReturnValue2() throws Exception { doTest("A", "I", true); } + public void testCast() throws Exception { doTest("A", "I", true); } + public void testUseAsArg() throws Exception { doTest("AClass", "I", true); } + public void testClassUsage() throws Exception { doTest("A", "I", true); } + public void testInstanceOf() throws Exception { doTest("A", "I", false); } + public void testFieldTest() throws Exception { doTest("Component1", "IDoSomething", false); } + public void testScr34000() throws Exception { doTest("SimpleModel", "Model", false); } + public void testScr34020() throws Exception { doTest(CommonClassNames.JAVA_UTIL_LIST, CommonClassNames.JAVA_UTIL_COLLECTION, false); } + public void testCommonInheritor() throws Exception { doTest("Client.V", "Client.L", false); } + public void testCommonInheritorFail() throws Exception { doTest("Client.V", "Client.L", false); } + public void testCommonInheritorResults() throws Exception { doTest("Client.V", "Client.L", false); } + public void testCommonInheritorResultsFail() throws Exception { doTest("Client.V", "Client.L", false); } + public void testCommonInheritorResultsFail2() throws Exception { doTest("Client.V", "Client.L", false); } + public void testIDEA6505() throws Exception { doTest("Impl", "IB", false); } + public void testIDEADEV5517() throws Exception { doTest("Xyz", "XInt", false); } + public void testIDEADEV5517NOOP() throws Exception { doTest("Xyz", "XInt", false); } + public void testIDEADEV6136() throws Exception { doTest("A", "B", false); } + public void testIDEADEV25669() throws Exception { doTest("p.A", "p.Base", false); } + public void testIDEADEV23807() throws Exception { doTest("B", "A", false); } + public void testTypeArgumentsRH() throws Exception { doTest("IImpl", "I", false); } + public void testTypeArgumentsRH1() throws Exception { doTest("IImpl", "I", false); } + public void testAnonymousWithTypeArguments() throws Exception { doTest("Clazz", "IntF", false); } + public void testTypeArgumentsParam() throws Exception { doTest("Clazz", "IntF", false); } - @Override - protected String getTestDataPath() { - return JavaTestUtil.getJavaTestDataPath(); - } - - public void testSuperClass() throws Exception { - doTest("AClass", "ASuper", true); - } - - public void testMethodFromSuper() throws Exception { - doTest("AClass", "ASuper", true); - } - - public void testRemoveImport() throws Exception { - doTest("pack1.AClass", "pack1.AnInterface", true); - } - - public void testToArray() throws Exception { - doTest("A", "I", true); - } - - - public void testArrayElementAssignment() throws Exception { - doTest("C", "I", true); - } - - public void testReturnValue() throws Exception { - doTest("A", "I", true); - } - - public void testReturnValue2() throws Exception { - doTest("A", "I", true); - } - - public void testCast() throws Exception { - doTest("A", "I", true); - } - - - public void testUseAsArg() throws Exception { - doTest("AClass", "I", true); - } - - public void testClassUsage() throws Exception { - doTest("A", "I", true); - } - - public void testInstanceOf() throws Exception { - doTest("A", "I", false); - } - - public void testFieldTest() throws Exception { - doTest("Component1", "IDoSomething", false); - } - - public void testScr34000() throws Exception { - doTest("SimpleModel", "Model", false); - } - - public void testScr34020() throws Exception { - doTest(CommonClassNames.JAVA_UTIL_LIST, "java.util.Collection", false); - } - - public void testCommonInheritor() throws Exception { - doTest("Client.V", "Client.L", false); - } - - public void testCommonInheritorFail() throws Exception { - doTest("Client.V", "Client.L", false); - } - - public void testCommonInheritorResults() throws Exception { - doTest("Client.V", "Client.L", false); - } - - public void testCommonInheritorResultsFail() throws Exception { - doTest("Client.V", "Client.L", false); - } - - public void testCommonInheritorResultsFail2() throws Exception { - doTest("Client.V", "Client.L", false); - } - - - public void testIDEA6505() throws Exception { - doTest("Impl", "IB", false); - } - - public void testIDEADEV5517() throws Exception { - doTest("Xyz", "Xint", false); - } - - public void testIDEADEV5517NOOP() throws Exception { - doTest("Xyz", "Xint", false); - } - - public void testIDEADEV6136() throws Exception { - doTest("A", "B", false); - } - - public void testIDEADEV25669() throws Exception { - doTest("p.A", "p.Base", false); - } - - public void testIDEADEV23807() throws Exception { - doTest("B", "A", false); - } - - public void testTypeArgumentsRH() throws Exception { - doTest("IImpl", "I", false); - } - - public void testTypeArgumentsRH1() throws Exception { - doTest("IImpl", "I", false); - } - - public void testAnonymousWithTypeArguments() throws Exception { - doTest("Clazz", "Intf", false); - } - - public void testTypeArgumentsParam() throws Exception { - doTest("Clazz", "Intf", false); - } - - public void _testStaticCallArguments() throws Exception { - doTest("Impl", "Int", false); - } - - public void _testListArgs() throws Exception { - doTest("Impl", "Int", false); - } - - public void _testCovariantReturnTypes() throws Exception { - doTest("Impl", "Int", false); - } - - public void _testNewExpr() throws Exception { - doTest("Impl", "Int", false); - } + //todo[ann] fix and uncomment + //public void testStaticCallArguments() throws Exception { doTest("Impl", "Int", false); } + //public void testListArgs() throws Exception { doTest("Impl", "Int", false); } + //public void testCovariantReturnTypes() throws Exception { doTest("Impl", "Int", false); } + //public void testNewExpr() throws Exception { doTest("Impl", "Int", false); } private void doTest(@NonNls final String className, @NonNls final String superClassName, final boolean replaceInstanceOf) throws Exception { doTest(new PerformAction() {