From c61a8b45d4c388108ca5f996a77cef3a2a7830b7 Mon Sep 17 00:00:00 2001 From: nik Date: Tue, 29 Sep 2009 18:00:20 +0400 Subject: [PATCH 1/5] fix tests on linux - 1 --- .../com/intellij/refactoring/rename/RenameUtil.java | 5 ++--- .../intellij/lang/xpath/xslt/XsltHighlightingTest.java | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/RenameUtil.java b/platform/lang-impl/src/com/intellij/refactoring/rename/RenameUtil.java index 53508d21b178..9e7cc2b2e080 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/rename/RenameUtil.java +++ b/platform/lang-impl/src/com/intellij/refactoring/rename/RenameUtil.java @@ -12,6 +12,7 @@ import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.TextRange; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.pom.PomTargetPsiElement; import com.intellij.psi.*; import com.intellij.psi.meta.PsiMetaData; import com.intellij.psi.meta.PsiMetaOwner; @@ -23,10 +24,8 @@ import com.intellij.refactoring.util.*; import com.intellij.usageView.UsageInfo; import com.intellij.util.IncorrectOperationException; import com.intellij.util.containers.HashMap; -import com.intellij.pom.PomTargetPsiElement; import org.jetbrains.annotations.NotNull; -import java.io.File; import java.util.*; public class RenameUtil { @@ -283,7 +282,7 @@ public class RenameUtil { return inputValidator.value(newName); } if (psiElement instanceof PsiFile || psiElement instanceof PsiDirectory) { - return newName.indexOf(File.separatorChar) < 0 && newName.indexOf('/') < 0; + return newName.indexOf('\\') < 0 && newName.indexOf('/') < 0; } if (psiElement instanceof PomTargetPsiElement) { return !StringUtil.isEmptyOrSpaces(newName); diff --git a/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/xslt/XsltHighlightingTest.java b/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/xslt/XsltHighlightingTest.java index cdaf126053a3..eb9fe399eeeb 100644 --- a/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/xslt/XsltHighlightingTest.java +++ b/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/xslt/XsltHighlightingTest.java @@ -62,23 +62,23 @@ public class XsltHighlightingTest extends TestBase { doXsltHighlighting(); } - public void testInValidPattern1() throws Throwable { + public void testInvalidPattern1() throws Throwable { doXsltHighlighting(); } - public void testInValidPattern2() throws Throwable { + public void testInvalidPattern2() throws Throwable { doXsltHighlighting(); } - public void testInValidPattern3() throws Throwable { + public void testInvalidPattern3() throws Throwable { doXsltHighlighting(); } - public void testInValidPattern4() throws Throwable { + public void testInvalidPattern4() throws Throwable { doXsltHighlighting(); } - public void testInValidPattern5() throws Throwable { + public void testInvalidPattern5() throws Throwable { doXsltHighlighting(); } From 86ef7c3887d34a47542741219fb4723b926543f5 Mon Sep 17 00:00:00 2001 From: Peter Gromov Date: Wed, 30 Sep 2009 13:57:31 +0400 Subject: [PATCH 2/5] remove obsolete JetGroovy build files --- plugins/groovy/Groovy.ipr | 607 --------------------- plugins/groovy/build.xml | 347 ------------ plugins/groovy/groovy.iml | 149 ----- plugins/groovy/groovy.properties.prototype | 15 - plugins/groovy/packagePlugin.xml | 461 ---------------- 5 files changed, 1579 deletions(-) delete mode 100644 plugins/groovy/Groovy.ipr delete mode 100644 plugins/groovy/build.xml delete mode 100644 plugins/groovy/groovy.iml delete mode 100644 plugins/groovy/groovy.properties.prototype delete mode 100644 plugins/groovy/packagePlugin.xml diff --git a/plugins/groovy/Groovy.ipr b/plugins/groovy/Groovy.ipr deleted file mode 100644 index 5a807b3de73c..000000000000 --- a/plugins/groovy/Groovy.ipr +++ /dev/null @@ -1,607 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/groovy/build.xml b/plugins/groovy/build.xml deleted file mode 100644 index aabb7d2b2d54..000000000000 --- a/plugins/groovy/build.xml +++ /dev/null @@ -1,347 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/groovy/groovy.iml b/plugins/groovy/groovy.iml deleted file mode 100644 index 35558279d71c..000000000000 --- a/plugins/groovy/groovy.iml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/groovy/groovy.properties.prototype b/plugins/groovy/groovy.properties.prototype deleted file mode 100644 index 161f3b9d8119..000000000000 --- a/plugins/groovy/groovy.properties.prototype +++ /dev/null @@ -1,15 +0,0 @@ -# Path to Groovy distribution -path.variable.groovy_sdk_path=D:/dev/Groovy-1.5.6 - -# Path to IDEA distribution, used in groovy module SDK -jdk.home.jetgroovy_idea_sdk=C:/Program Files/JetBrains/IntelliJ IDEA 9712 - -# Path to JDK 1.6 (or higher) installation -jdk.home.jetgroovy_compile_with_jdk=D:/dev/jdk1.6 - -# rt module needs to be run against any JDK the user will have in her Groovy project in IntelliJ IDEA. -# So it should compile against JDK 1.4. Ideally, this variable should point to such a JDK. -jdk.home.jetgroovy_runtime_jdk=C:/sdks/j2sdk1.4.2_08 - -# Whether to skip the tests or not -skip.tests=true \ No newline at end of file diff --git a/plugins/groovy/packagePlugin.xml b/plugins/groovy/packagePlugin.xml deleted file mode 100644 index b0781c53318b..000000000000 --- a/plugins/groovy/packagePlugin.xml +++ /dev/null @@ -1,461 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 634b14732bfb5356aa62c2fada52ad7e75b159c9 Mon Sep 17 00:00:00 2001 From: Peter Gromov Date: Wed, 30 Sep 2009 14:03:15 +0400 Subject: [PATCH 3/5] fix GroovyMoveClassTest --- .../plugins/groovy/refactoring/move/GroovyMoveClassTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/move/GroovyMoveClassTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/move/GroovyMoveClassTest.java index 70d64bfe844c..415ef440e132 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/move/GroovyMoveClassTest.java +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/move/GroovyMoveClassTest.java @@ -22,6 +22,7 @@ import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.fileEditor.FileDocumentManager; +import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.VirtualFileManager; import com.intellij.psi.*; @@ -200,8 +201,8 @@ public class GroovyMoveClassTest extends LightCodeInsightFixtureTestCase { final byte[] bytes1 = contentsToByteArray(f1); final byte[] bytes2 = f2.contentsToByteArray(); - String s1 = new String(bytes1); - String s2 = new String(bytes2); + String s1 = StringUtil.convertLineSeparators(new String(bytes1)); + String s2 = StringUtil.convertLineSeparators(new String(bytes2)); try { assertEquals(s1, s2); From 39635b7e67b4e6d1070ef39c8a8a32b6bf873301 Mon Sep 17 00:00:00 2001 From: Peter Gromov Date: Wed, 30 Sep 2009 14:30:47 +0400 Subject: [PATCH 4/5] rethrow PCE correctly when indexing --- .../com/intellij/util/indexing/FileBasedIndex.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java index 4283ed5ae910..a98209593311 100644 --- a/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java +++ b/platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java @@ -24,10 +24,7 @@ import com.intellij.openapi.project.*; import com.intellij.openapi.roots.CollectingContentIterator; import com.intellij.openapi.roots.ContentIterator; import com.intellij.openapi.roots.ProjectRootManager; -import com.intellij.openapi.util.Factory; -import com.intellij.openapi.util.Key; -import com.intellij.openapi.util.Pair; -import com.intellij.openapi.util.ShutDownTracker; +import com.intellij.openapi.util.*; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.vfs.*; @@ -1100,6 +1097,8 @@ public class FileBasedIndex implements ApplicationComponent { PsiFile psiFile = null; + final Ref pce = Ref.create(null); + final List tasks = new ArrayList(); for (final ID indexId : myIndices.keySet()) { if (shouldIndexFile(file, indexId)) { @@ -1132,8 +1131,7 @@ public class FileBasedIndex implements ApplicationComponent { updateSingleIndex(indexId, file, _fc); } catch (ProcessCanceledException e) { - LOG.info("Re-scheduling file indexing for " + file.getPresentableUrl(), e); - myChangedFilesUpdater.scheduleForUpdate(file); + pce.set(e); } catch (StorageException e) { requestRebuild(indexId); @@ -1164,6 +1162,10 @@ public class FileBasedIndex implements ApplicationComponent { } } + if (!pce.isNull()) { + throw pce.get(); + } + if (psiFile != null) { psiFile.putUserData(PsiFileImpl.BUILDING_STUB, null); } From 95ca96cce5064040a00f935e21ae731a7db0a807 Mon Sep 17 00:00:00 2001 From: nik Date: Wed, 30 Sep 2009 14:52:58 +0400 Subject: [PATCH 5/5] fixed tests on linux - 3 --- .../after/Test.java | 0 .../before/Test.java | 0 .../refactoring/TurnRefsToSuperTest.java | 2 +- .../dom/MavenModelReadingAndWritingTest.java | 48 +++++++++---------- 4 files changed, 25 insertions(+), 25 deletions(-) rename java/java-tests/testData/refactoring/turnRefsToSuper/{IDEADEV5517Noop => IDEADEV5517NOOP}/after/Test.java (100%) rename java/java-tests/testData/refactoring/turnRefsToSuper/{IDEADEV5517Noop => IDEADEV5517NOOP}/before/Test.java (100%) diff --git a/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517Noop/after/Test.java b/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517NOOP/after/Test.java similarity index 100% rename from java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517Noop/after/Test.java rename to java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517NOOP/after/Test.java diff --git a/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517Noop/before/Test.java b/java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517NOOP/before/Test.java similarity index 100% rename from java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517Noop/before/Test.java rename to java/java-tests/testData/refactoring/turnRefsToSuper/IDEADEV5517NOOP/before/Test.java diff --git a/java/java-tests/testSrc/com/intellij/refactoring/TurnRefsToSuperTest.java b/java/java-tests/testSrc/com/intellij/refactoring/TurnRefsToSuperTest.java index d8a9a421f2b5..629204a2489f 100644 --- a/java/java-tests/testSrc/com/intellij/refactoring/TurnRefsToSuperTest.java +++ b/java/java-tests/testSrc/com/intellij/refactoring/TurnRefsToSuperTest.java @@ -101,7 +101,7 @@ public class TurnRefsToSuperTest extends MultiFileTestCase { doTest("Xyz", "Xint", false); } - public void testIDEADEV5517Noop() throws Exception { + public void testIDEADEV5517NOOP() throws Exception { doTest("Xyz", "Xint", false); } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenModelReadingAndWritingTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenModelReadingAndWritingTest.java index bc9d3bfc4f13..1aef5921d0b9 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenModelReadingAndWritingTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenModelReadingAndWritingTest.java @@ -43,15 +43,15 @@ public class MavenModelReadingAndWritingTest extends MavenImportingTestCase { } }, null, null); - assertEquals("\r\n" + - "\r\n" + - " 4.0.0\r\n" + - " foo\r\n" + - " bar\r\n" + - " baz\r\n" + - "", - VfsUtil.loadText(myProjectPom)); + assertSameLines("\r\n" + + "\r\n" + + " 4.0.0\r\n" + + " foo\r\n" + + " bar\r\n" + + " baz\r\n" + + "", + VfsUtil.loadText(myProjectPom)); } public void testAddingADependency() throws Exception { @@ -68,21 +68,21 @@ public class MavenModelReadingAndWritingTest extends MavenImportingTestCase { } }, null, null); - assertEquals("\r\n" + - "\r\n" + - " 4.0.0\r\n" + - " test\r\n" + - " project\r\n" + - " 1\r\n" + - " \r\n" + - " \r\n" + - " group\r\n" + - " artifact\r\n" + - " version\r\n" + - " \r\n" + - " \r\n" + - "", VfsUtil.loadText(myProjectPom)); + assertSameLines("\r\n" + + "\r\n" + + " 4.0.0\r\n" + + " test\r\n" + + " project\r\n" + + " 1\r\n" + + " \r\n" + + " \r\n" + + " group\r\n" + + " artifact\r\n" + + " version\r\n" + + " \r\n" + + " \r\n" + + "", VfsUtil.loadText(myProjectPom)); } private MavenDomProjectModel getDomModel() {