mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Cleanup (platform tests moved to platform)
This commit is contained in:
+3
-3
@@ -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"));
|
||||
+13
-11
@@ -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);
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -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);
|
||||
+3
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user