Cleanup (platform tests moved to platform)

This commit is contained in:
Roman Shevchenko
2014-02-20 20:53:37 +01:00
parent 9c85eb9287
commit f2ed5a62ca
4 changed files with 24 additions and 21 deletions
@@ -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"));
@@ -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);
}
}
@@ -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);
@@ -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;