GenericsHighlightingTest: replace package of copied java.util.Collections
authorpeter <peter@jetbrains.com>
Thu, 12 Feb 2015 13:55:04 +0000 (14:55 +0100)
committerpeter <peter@jetbrains.com>
Thu, 12 Feb 2015 13:58:00 +0000 (14:58 +0100)
java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java

index 87677f08bf2a58ed91cdc0420d22a9be9e242d38..ac8bb477b0278e26771fcc15bf47da333cb0863d 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.codeInspection.unusedImport.UnusedImportLocalInspection;
 import com.intellij.openapi.projectRoots.JavaSdkVersion;
 import com.intellij.openapi.projectRoots.Sdk;
 import com.intellij.openapi.roots.LanguageLevelProjectExtension;
 import com.intellij.openapi.projectRoots.JavaSdkVersion;
 import com.intellij.openapi.projectRoots.Sdk;
 import com.intellij.openapi.roots.LanguageLevelProjectExtension;
+import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.pom.java.LanguageLevel;
 import com.intellij.psi.PsiClass;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.pom.java.LanguageLevel;
 import com.intellij.psi.PsiClass;
 import com.intellij.psi.search.GlobalSearchScope;
@@ -459,7 +460,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
     assertNotNull(collectionsClass);
     collectionsClass = (PsiClass)collectionsClass.getNavigationElement();
     final String text = collectionsClass.getContainingFile().getText();
     assertNotNull(collectionsClass);
     collectionsClass = (PsiClass)collectionsClass.getNavigationElement();
     final String text = collectionsClass.getContainingFile().getText();
-    configureFromFileText("Collections.java", text.replaceAll("\r", "\n"));
+    configureFromFileText("Collections.java", StringUtil.convertLineSeparators(StringUtil.replace(text, "package java.util;", "package java.utilx; import java.util.*;")));
     doTestConfiguredFile(false, false, null);
   }
 }
     doTestConfiguredFile(false, false, null);
   }
 }