From e3a8381deffc3d945d455f7653b66576a13f98c8 Mon Sep 17 00:00:00 2001 From: Andrey Vokin Date: Mon, 30 Jul 2012 13:31:41 +0400 Subject: [PATCH] CodeInsightTestCase and RubyUsefulTestCase separated --- .../testFramework/CodeInsightTestCase.java | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/platform/testFramework/src/com/intellij/testFramework/CodeInsightTestCase.java b/platform/testFramework/src/com/intellij/testFramework/CodeInsightTestCase.java index f8b28b832dcb..90647541a407 100644 --- a/platform/testFramework/src/com/intellij/testFramework/CodeInsightTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/CodeInsightTestCase.java @@ -1,7 +1,23 @@ +/* + * Copyright 2000-2012 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.testFramework; -import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.psi.*; +import com.intellij.psi.PsiDocumentManager; +import com.intellij.psi.PsiFile; +import com.intellij.psi.PsiReference; import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase; import org.jetbrains.annotations.NonNls; @@ -30,19 +46,4 @@ public class CodeInsightTestCase extends LightPlatformCodeInsightFixtureTestCase final int offset = findOffsetBySignature(signature); return myFixture.getFile().findReferenceAt(offset); } - - protected PsiElement findPsiBySignature(final String signature) { - return findPsiBySignature(signature, myFixture.getFile()); - } - - protected PsiElement findPsiBySignature(final String signature, final PsiFile psiFile) { - final int offset = findOffsetBySignature(signature, psiFile); - return psiFile.findElementAt(offset); - } - - protected PsiElement findPsiBySignature(final String signature, final VirtualFile file) { - final PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(file); - final int offset = findOffsetBySignature(signature, psiFile); - return psiFile.findElementAt(offset); - } }