test++
authorDmitry Jemerov <yole@intellij.com>
Thu, 10 Sep 2009 16:13:55 +0000 (20:13 +0400)
committerDmitry Jemerov <yole@intellij.com>
Thu, 10 Sep 2009 16:13:55 +0000 (20:13 +0400)
49 files changed:
java/java-tests/testData/refactoring/extractClass/fieldReference/after/Test.java [moved from testData/refactoring/extractClass/fieldReference/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/fieldReference/before/Test.java [moved from testData/refactoring/extractClass/fieldReference/before/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/generateGetters/after/Extracted.java [moved from testData/refactoring/extractClass/generateGetters/after/Extracted.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/generateGetters/after/Test.java [moved from testData/refactoring/extractClass/generateGetters/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/generateGetters/before/Test.java [moved from testData/refactoring/extractClass/generateGetters/before/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/getters/after/Extracted.java [moved from testData/refactoring/extractClass/getters/after/Extracted.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/getters/after/Test.java [moved from testData/refactoring/extractClass/getters/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/getters/before/Test.java [moved from testData/refactoring/extractClass/getters/before/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/hierarchy/after/A.java [moved from testData/refactoring/extractClass/hierarchy/after/A.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/hierarchy/after/Extracted.java [moved from testData/refactoring/extractClass/hierarchy/after/Extracted.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/hierarchy/after/Test.java [moved from testData/refactoring/extractClass/hierarchy/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/hierarchy/before/A.java [moved from testData/refactoring/extractClass/hierarchy/before/A.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/hierarchy/before/Test.java [moved from testData/refactoring/extractClass/hierarchy/before/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/inheritanceDelegation/after/Extracted.java [moved from testData/refactoring/extractClass/inheritanceDelegation/after/Extracted.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/inheritanceDelegation/after/I.java [moved from testData/refactoring/extractClass/inheritanceDelegation/after/I.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/inheritanceDelegation/after/Test.java [moved from testData/refactoring/extractClass/inheritanceDelegation/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/inheritanceDelegation/before/I.java [moved from testData/refactoring/extractClass/inheritanceDelegation/before/I.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/inheritanceDelegation/before/Test.java [moved from testData/refactoring/extractClass/inheritanceDelegation/before/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/inner/after/Extracted.java [moved from testData/refactoring/extractClass/inner/after/Extracted.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/inner/after/Test.java [moved from testData/refactoring/extractClass/inner/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/inner/before/Test.java [moved from testData/refactoring/extractClass/inner/before/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/multipleGetters/after/Extracted.java [moved from testData/refactoring/extractClass/multipleGetters/after/Extracted.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/multipleGetters/after/Test.java [moved from testData/refactoring/extractClass/multipleGetters/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/multipleGetters/before/Test.java [moved from testData/refactoring/extractClass/multipleGetters/before/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/multipleGetters1/after/Test.java [moved from testData/refactoring/extractClass/multipleGetters1/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/multipleGetters1/before/Test.java [moved from testData/refactoring/extractClass/multipleGetters1/before/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/noDelegation/after/Extracted.java [moved from testData/refactoring/extractClass/noDelegation/after/Extracted.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/noDelegation/after/Test.java [moved from testData/refactoring/extractClass/noDelegation/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/noDelegation/before/Test.java [moved from testData/refactoring/extractClass/noDelegation/before/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/noFieldDelegation/after/Extracted.java [moved from testData/refactoring/extractClass/noFieldDelegation/after/Extracted.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/noFieldDelegation/after/Test.java [moved from testData/refactoring/extractClass/noFieldDelegation/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/noFieldDelegation/before/Test.java [moved from testData/refactoring/extractClass/noFieldDelegation/before/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/publicFieldDelegation/after/Extracted.java [moved from testData/refactoring/extractClass/publicFieldDelegation/after/Extracted.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/publicFieldDelegation/after/Test.java [moved from testData/refactoring/extractClass/publicFieldDelegation/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/publicFieldDelegation/before/Test.java [moved from testData/refactoring/extractClass/publicFieldDelegation/before/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/refInJavadoc/after/Extracted.java [moved from testData/refactoring/extractClass/refInJavadoc/after/Extracted.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/refInJavadoc/after/Test.java [moved from testData/refactoring/extractClass/refInJavadoc/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/refInJavadoc/before/Test.java [moved from testData/refactoring/extractClass/refInJavadoc/before/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/static/after/Extracted.java [moved from testData/refactoring/extractClass/static/after/Extracted.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/static/after/Test.java [moved from testData/refactoring/extractClass/static/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/static/before/Test.java [moved from testData/refactoring/extractClass/static/before/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/usedInConstructor/after/Test.java [moved from testData/refactoring/extractClass/usedInConstructor/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/usedInConstructor/before/Test.java [moved from testData/refactoring/extractClass/usedInConstructor/before/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/usedInInitializer/after/Test.java [moved from testData/refactoring/extractClass/usedInInitializer/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/usedInInitializer/before/Test.java [moved from testData/refactoring/extractClass/usedInInitializer/before/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/varargs/after/Extracted.java [moved from testData/refactoring/extractClass/varargs/after/Extracted.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/varargs/after/Test.java [moved from testData/refactoring/extractClass/varargs/after/Test.java with 100% similarity]
java/java-tests/testData/refactoring/extractClass/varargs/before/Test.java [moved from testData/refactoring/extractClass/varargs/before/Test.java with 100% similarity]
java/java-tests/testSrc/com/intellij/refactoring/ExtractClassTest.java [moved from refactoring/tests/com/intellij/refactoring/ExtractClassTest.java with 87% similarity]

similarity index 87%
rename from refactoring/tests/com/intellij/refactoring/ExtractClassTest.java
rename to java/java-tests/testSrc/com/intellij/refactoring/ExtractClassTest.java
index a8fb194270d6cec5a45e5db48cbb22b7b6cc3a25..7b7ec5da6ef7fa1656219b6ccc456d29e24a2b7e 100644 (file)
@@ -10,7 +10,9 @@ import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.PsiClass;
 import com.intellij.psi.PsiField;
 import com.intellij.psi.PsiMethod;
+import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.refactoring.extractclass.ExtractClassProcessor;
+import com.intellij.JavaTestUtil;
 import junit.framework.Assert;
 
 import java.util.ArrayList;
@@ -20,6 +22,11 @@ public class ExtractClassTest extends MultiFileTestCase{
     return "/refactoring/extractClass/";
   }
 
+  @Override
+  protected String getTestDataPath() {
+    return JavaTestUtil.getJavaTestDataPath();
+  }
+
   private void doTestMethod() throws Exception {
     doTestMethod(null);
   }
@@ -31,7 +38,7 @@ public class ExtractClassTest extends MultiFileTestCase{
   private void doTestMethod(final String methodName, final String conflicts) throws Exception {
     doTest(new PerformAction() {
       public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
-        PsiClass aClass = myJavaFacade.findClass("Test");
+        PsiClass aClass = myJavaFacade.findClass("Test", GlobalSearchScope.projectScope(myProject));
 
         assertNotNull("Class Test not found", aClass);
 
@@ -74,7 +81,7 @@ public class ExtractClassTest extends MultiFileTestCase{
   private void doTestFieldAndMethod(final String methodName) throws Exception {
     doTest(new PerformAction() {
       public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
-        PsiClass aClass = myJavaFacade.findClass("Test");
+        PsiClass aClass = myJavaFacade.findClass("Test", GlobalSearchScope.projectScope(myProject));
 
         assertNotNull("Class Test not found", aClass);
 
@@ -96,7 +103,7 @@ public class ExtractClassTest extends MultiFileTestCase{
   private void doTestField(final String conflicts, final boolean generateGettersSetters) throws Exception {
     doTest(new PerformAction() {
       public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
-        PsiClass aClass = myJavaFacade.findClass("Test");
+        PsiClass aClass = myJavaFacade.findClass("Test", GlobalSearchScope.projectScope(myProject));
 
         assertNotNull("Class Test not found", aClass);
 
@@ -110,8 +117,8 @@ public class ExtractClassTest extends MultiFileTestCase{
     });
   }
 
-  private void doTest(final PsiClass aClass, final ArrayList<PsiMethod> methods, final ArrayList<PsiField> fields, final String conflicts,
-                      boolean generateGettersSetters) {
+  private static void doTest(final PsiClass aClass, final ArrayList<PsiMethod> methods, final ArrayList<PsiField> fields, final String conflicts,
+                             boolean generateGettersSetters) {
     try {
       ExtractClassProcessor processor = new ExtractClassProcessor(aClass, fields, methods, new ArrayList<PsiClass>(), "", "Extracted", generateGettersSetters);
       processor.run();
@@ -147,7 +154,7 @@ public class ExtractClassTest extends MultiFileTestCase{
   public void testPublicFieldDelegation() throws Exception {
     doTest(new PerformAction() {
       public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
-        PsiClass aClass = myJavaFacade.findClass("Test");
+        PsiClass aClass = myJavaFacade.findClass("Test", GlobalSearchScope.projectScope(myProject));
 
         assertNotNull("Class Test not found", aClass);
 
@@ -165,7 +172,7 @@ public class ExtractClassTest extends MultiFileTestCase{
   private void doTestInnerClass() throws Exception {
     doTest(new PerformAction() {
       public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
-        PsiClass aClass = myJavaFacade.findClass("Test");
+        PsiClass aClass = myJavaFacade.findClass("Test", GlobalSearchScope.projectScope(myProject));
 
         assertNotNull("Class Test not found", aClass);