diff --git a/java/java-tests/testSrc/com/intellij/module/ModulePointerTest.java b/platform/platform-tests/testSrc/com/intellij/module/ModulePointerTest.java similarity index 96% rename from java/java-tests/testSrc/com/intellij/module/ModulePointerTest.java rename to platform/platform-tests/testSrc/com/intellij/module/ModulePointerTest.java index 55bc15f7c0b6..1d9bca4db747 100644 --- a/java/java-tests/testSrc/com/intellij/module/ModulePointerTest.java +++ b/platform/platform-tests/testSrc/com/intellij/module/ModulePointerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,12 +19,12 @@ import com.intellij.openapi.Disposable; import com.intellij.openapi.application.Result; import com.intellij.openapi.application.WriteAction; import com.intellij.openapi.module.*; -import com.intellij.testFramework.PlatformTestCase; +import com.intellij.testFramework.PlatformLangTestCase; /** * @author nik */ -public class ModulePointerTest extends PlatformTestCase { +public class ModulePointerTest extends PlatformLangTestCase { public void testCreateByName() throws Exception { final ModulePointer pointer = getPointerManager().create("m"); assertSame(pointer, getPointerManager().create("m")); diff --git a/java/java-tests/testSrc/com/intellij/patterns/VirtualFilePatternsTest.groovy b/platform/platform-tests/testSrc/com/intellij/patterns/VirtualFilePatternsTest.java similarity index 58% rename from java/java-tests/testSrc/com/intellij/patterns/VirtualFilePatternsTest.groovy rename to platform/platform-tests/testSrc/com/intellij/patterns/VirtualFilePatternsTest.java index 18d5622132b6..9e0b96788697 100644 --- a/java/java-tests/testSrc/com/intellij/patterns/VirtualFilePatternsTest.groovy +++ b/platform/platform-tests/testSrc/com/intellij/patterns/VirtualFilePatternsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,19 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.patterns -import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase +package com.intellij.patterns; + +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase; + /** * @author peter */ -public class VirtualFilePatternsTest extends LightCodeInsightFixtureTestCase { - +public class VirtualFilePatternsTest extends LightPlatformCodeInsightFixtureTestCase { public void testWithSuperParent() { - def file = myFixture.addFileToProject("foo/bar.txt", "").virtualFile - assert PlatformPatterns.virtualFile().withSuperParent(1, PlatformPatterns.virtualFile().withName("foo")).accepts(file) - assert !PlatformPatterns.virtualFile().withSuperParent(1, PlatformPatterns.virtualFile().withName("bar")).accepts(file) - assert !PlatformPatterns.virtualFile().withSuperParent(2, PlatformPatterns.virtualFile().withName("bar")).accepts(file) - assert !PlatformPatterns.virtualFile().withSuperParent(10, PlatformPatterns.virtualFile().withName("bar")).accepts(file) - assert !PlatformPatterns.virtualFile().withSuperParent(10, PlatformPatterns.virtualFile().withName("foo")).accepts(file) + VirtualFile file = myFixture.addFileToProject("foo/bar.txt", "").getVirtualFile(); + assert PlatformPatterns.virtualFile().withSuperParent(1, PlatformPatterns.virtualFile().withName("foo")).accepts(file); + assert !PlatformPatterns.virtualFile().withSuperParent(1, PlatformPatterns.virtualFile().withName("bar")).accepts(file); + assert !PlatformPatterns.virtualFile().withSuperParent(2, PlatformPatterns.virtualFile().withName("bar")).accepts(file); + assert !PlatformPatterns.virtualFile().withSuperParent(10, PlatformPatterns.virtualFile().withName("bar")).accepts(file); + assert !PlatformPatterns.virtualFile().withSuperParent(10, PlatformPatterns.virtualFile().withName("foo")).accepts(file); } } diff --git a/java/java-tests/testSrc/com/intellij/psi/PsiDocumentManagerImplTest.java b/platform/platform-tests/testSrc/com/intellij/psi/PsiDocumentManagerImplTest.java similarity index 98% rename from java/java-tests/testSrc/com/intellij/psi/PsiDocumentManagerImplTest.java rename to platform/platform-tests/testSrc/com/intellij/psi/PsiDocumentManagerImplTest.java index db2a5f1a8695..6ccb0581ae96 100644 --- a/java/java-tests/testSrc/com/intellij/psi/PsiDocumentManagerImplTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/PsiDocumentManagerImplTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ import com.intellij.psi.impl.PsiDocumentManagerImpl; import com.intellij.psi.impl.source.PsiFileImpl; import com.intellij.testFramework.LeakHunter; import com.intellij.testFramework.LightVirtualFile; -import com.intellij.testFramework.PlatformTestCase; +import com.intellij.testFramework.PlatformLangTestCase; import com.intellij.util.Processor; import com.intellij.util.concurrency.Semaphore; import com.intellij.util.ui.UIUtil; @@ -42,7 +42,7 @@ import java.io.File; import java.lang.ref.Reference; import java.util.concurrent.atomic.AtomicInteger; -public class PsiDocumentManagerImplTest extends PlatformTestCase { +public class PsiDocumentManagerImplTest extends PlatformLangTestCase { private PsiDocumentManagerImpl getPsiDocumentManager() { return (PsiDocumentManagerImpl)PsiDocumentManager.getInstance(getProject()); } @@ -72,7 +72,7 @@ public class PsiDocumentManagerImplTest extends PlatformTestCase { } private static LightVirtualFile createFile() { - return new LightVirtualFile("foo.java"); + return new LightVirtualFile("foo.txt"); } public void testDocumentGced() throws Exception { @@ -195,7 +195,7 @@ public class PsiDocumentManagerImplTest extends PlatformTestCase { PsiManager alienManager = PsiManager.getInstance(alienProject); final String alienText = "alien"; - LightVirtualFile alienVirt = new LightVirtualFile("foo.java", alienText); + LightVirtualFile alienVirt = new LightVirtualFile("foo.txt", alienText); final PsiFile alienFile = alienManager.findFile(alienVirt); final PsiDocumentManagerImpl alienDocManager = (PsiDocumentManagerImpl)PsiDocumentManager.getInstance(alienProject); final Document alienDocument = alienDocManager.getDocument(alienFile); diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/LightPlatformCodeInsightFixtureTestCase.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/LightPlatformCodeInsightFixtureTestCase.java index fb027f186bcf..cfaf4d354bbf 100644 --- a/platform/testFramework/src/com/intellij/testFramework/fixtures/LightPlatformCodeInsightFixtureTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/LightPlatformCodeInsightFixtureTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,8 @@ import java.io.File; public abstract class LightPlatformCodeInsightFixtureTestCase extends UsefulTestCase { @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors") public LightPlatformCodeInsightFixtureTestCase() { - PlatformTestCase.autodetectPlatformPrefix(); + //PlatformTestCase.autodetectPlatformPrefix(); + PlatformTestCase.initPlatformLangPrefix(); } protected CodeInsightTestFixture myFixture;