use of com.intellij.testFramework.fixtures.impl.TempDirTestFixtureImpl in project intellij-community by JetBrains.
the class FindManagerTest method testFindInCurrentFileOutsideProject.
public void testFindInCurrentFileOutsideProject() throws Exception {
final TempDirTestFixture tempDirFixture = new TempDirTestFixtureImpl();
tempDirFixture.setUp();
try {
VirtualFile file = tempDirFixture.createFile("a.txt", "foo bar foo");
FindModel findModel = FindManagerTestUtils.configureFindModel("foo");
findModel.setWholeWordsOnly(true);
findModel.setCustomScope(true);
findModel.setCustomScope(new LocalSearchScope(PsiManager.getInstance(myProject).findFile(file)));
assertSize(2, findUsages(findModel));
} finally {
tempDirFixture.tearDown();
}
}
use of com.intellij.testFramework.fixtures.impl.TempDirTestFixtureImpl in project intellij-community by JetBrains.
the class ModuleCompilerUtilTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
myTempDirTestFixture = new TempDirTestFixtureImpl();
myTempDirTestFixture.setUp();
}
use of com.intellij.testFramework.fixtures.impl.TempDirTestFixtureImpl in project intellij-community by JetBrains.
the class FindManagerTest method testFindInDirectoryOutsideProject.
public void testFindInDirectoryOutsideProject() throws Exception {
final TempDirTestFixture tempDirFixture = new TempDirTestFixtureImpl();
tempDirFixture.setUp();
try {
tempDirFixture.createFile("a.txt", "foo bar foo");
FindModel findModel = FindManagerTestUtils.configureFindModel("foo");
findModel.setWholeWordsOnly(true);
findModel.setProjectScope(false);
findModel.setDirectoryName(tempDirFixture.getFile("").getPath());
assertSize(2, findUsages(findModel));
} finally {
tempDirFixture.tearDown();
}
}
use of com.intellij.testFramework.fixtures.impl.TempDirTestFixtureImpl in project intellij-community by JetBrains.
the class GroovyGotoImplementationTest method testNoGotoImplementationOutsideSourceRoot.
public void testNoGotoImplementationOutsideSourceRoot() throws Throwable {
final TempDirTestFixture dirFixture = new TempDirTestFixtureImpl();
dirFixture.setUp();
new WriteCommandAction(getProject()) {
@Override
protected void run(@NotNull Result result) throws Throwable {
final VirtualFile outside = dirFixture.getFile("").createChildDirectory(this, "outside");
PsiTestUtil.addContentRoot(myModule, outside);
VirtualFile out = outside.createChildData(this, "Outside.groovy");
VfsUtil.saveText(out, "class Bar {}\n class Goo extends Bar {}");
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
}
}.execute();
try {
PsiFile inProject = myFixture.addFileToProject("Foo.groovy", "class <caret>Foo {}\n class Bar extends Foo {}");
myFixture.configureFromExistingVirtualFile(inProject.getVirtualFile());
final PsiElement[] impls = CodeInsightTestUtil.gotoImplementation(myFixture.getEditor(), inProject).targets;
assertEquals(1, impls.length);
} finally {
dirFixture.tearDown();
}
}
Aggregations