本文整理汇总了Java中com.intellij.testFramework.fixtures.CodeInsightTestFixture类的典型用法代码示例。如果您正苦于以下问题:Java CodeInsightTestFixture类的具体用法?Java CodeInsightTestFixture怎么用?Java CodeInsightTestFixture使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CodeInsightTestFixture类属于com.intellij.testFramework.fixtures包,在下文中一共展示了CodeInsightTestFixture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCodeInsightFixture
import com.intellij.testFramework.fixtures.CodeInsightTestFixture; //导入依赖的package包/类
protected CodeInsightTestFixture createCodeInsightFixture(final String relativeTestDataPath)
throws Exception {
final String testDataPath = new File(getTestDataPath(), relativeTestDataPath).getAbsolutePath();
final CodeInsightTestFixture codeInsightFixture =
JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(myProjectFixture);
codeInsightFixture.setTestDataPath(testDataPath);
final TempDirTestFixture tempDir = codeInsightFixture.getTempDirFixture();
myModuleBuilder.addSourceContentRoot(tempDir.getTempDirPath());
codeInsightFixture.setUp();
final VirtualFile dir = LocalFileSystem.getInstance().refreshAndFindFileByPath(testDataPath);
Assert.assertNotNull("Test data directory not found: " + testDataPath, dir);
VfsUtil.processFilesRecursively(dir, new CommonProcessors.CollectProcessor<VirtualFile>());
dir.refresh(false, true);
tempDir.copyAll(
testDataPath,
"",
new VirtualFileFilter() {
@Override
public boolean accept(VirtualFile file) {
return !file.getName().contains("_after");
}
});
return codeInsightFixture;
}
示例2: createCodeInsightFixture
import com.intellij.testFramework.fixtures.CodeInsightTestFixture; //导入依赖的package包/类
@Override
public CodeInsightTestFixture createCodeInsightFixture(String dataPath, String projectFileName) {
TempDirTestFixtureImpl tempDirTestFixture = new TempDirTestFixtureImpl();
CodeInsightTestFixture fixture = IdeaTestFixtureFactory
.getFixtureFactory()
.createCodeInsightFixture(new ImportProjectTestFixture(dataPath, projectFileName, tempDirTestFixture), tempDirTestFixture);
fixture.setTestDataPath(dataPath);
return fixture;
}
示例3: createFileByText
import com.intellij.testFramework.fixtures.CodeInsightTestFixture; //导入依赖的package包/类
/**
* Creates command file by text and {@link #createCommands() fills it with commands}
* @param testFixture fixture
* @param text command text
* @return command file
* @see #createCommands()
*/
@NotNull
static CommandLineFile createFileByText(@NotNull final CodeInsightTestFixture testFixture, @NotNull final String text) {
final CommandLineFile file =
(CommandLineFile)testFixture.configureByText(CommandLineFileType.INSTANCE, text);
file.setCommands(createCommands());
return file;
}
示例4: createContentFixture
import com.intellij.testFramework.fixtures.CodeInsightTestFixture; //导入依赖的package包/类
protected CodeInsightTestFixture createContentFixture(IdeaTestFixtureFactory factory) {
final TestFixtureBuilder<IdeaProjectTestFixture> builder = factory.createFixtureBuilder(getName());
final EmptyModuleFixtureBuilder moduleBuilder = builder.addModule(EmptyModuleFixtureBuilder.class);
final IdeaProjectTestFixture fixture = builder.getFixture();
final CodeInsightTestFixture testFixture = factory.createCodeInsightFixture(fixture);
final String root = testFixture.getTempDirPath();
moduleBuilder.addContentRoot(root);
moduleBuilder.addSourceRoot("/");
return testFixture;
}
示例5: createFixture
import com.intellij.testFramework.fixtures.CodeInsightTestFixture; //导入依赖的package包/类
protected CodeInsightTestFixture createFixture(IdeaTestFixtureFactory factory) {
final TestFixtureBuilder<IdeaProjectTestFixture> builder = factory.createLightFixtureBuilder();
final IdeaProjectTestFixture fixture = builder.getFixture();
final CodeInsightTestFixture testFixture;
testFixture = factory.createCodeInsightFixture(fixture);
return testFixture;
}
示例6: createContentFixture
import com.intellij.testFramework.fixtures.CodeInsightTestFixture; //导入依赖的package包/类
protected CodeInsightTestFixture createContentFixture(IdeaTestFixtureFactory factory) {
final TestFixtureBuilder<IdeaProjectTestFixture> builder = factory.createFixtureBuilder(getName());
final EmptyModuleFixtureBuilder moduleBuilder = builder.addModule(EmptyModuleFixtureBuilder.class);
final IdeaProjectTestFixture fixture = builder.getFixture();
final CodeInsightTestFixture testFixture;
testFixture = factory.createCodeInsightFixture(fixture);
final String root = testFixture.getTempDirPath();
moduleBuilder.addContentRoot(root);
moduleBuilder.addSourceRoot("/");
return testFixture;
}
示例7: createCreateParameterInfoContext
import com.intellij.testFramework.fixtures.CodeInsightTestFixture; //导入依赖的package包/类
private static CreateParameterInfoContext createCreateParameterInfoContext(CodeInsightTestFixture fixture)
{
return new ShowParameterInfoContext(fixture.getEditor(), fixture.getProject(), fixture.getFile(), fixture.getEditor().getCaretModel().getOffset(), 0)
{
@Override
public void showHint(final PsiElement element, final int offset, final ParameterInfoHandler handler)
{
}
};
}
示例8: FixtureChain
import com.intellij.testFramework.fixtures.CodeInsightTestFixture; //导入依赖的package包/类
FixtureChain(final CodeInsightTestFixture myFixture) {
fixture = myFixture;
}
示例9: getFixture
import com.intellij.testFramework.fixtures.CodeInsightTestFixture; //导入依赖的package包/类
protected CodeInsightTestFixture getFixture() {
return fixture;
}
示例10: FileStructureTestFixture
import com.intellij.testFramework.fixtures.CodeInsightTestFixture; //导入依赖的package包/类
public FileStructureTestFixture(CodeInsightTestFixture fixture) {
myFixture = fixture;
}
示例11: createFixture
import com.intellij.testFramework.fixtures.CodeInsightTestFixture; //导入依赖的package包/类
@Override
protected CodeInsightTestFixture createFixture(@NotNull IdeaTestFixtureFactory factory) {
return createContentFixture(factory);
}
示例12: createFixture
import com.intellij.testFramework.fixtures.CodeInsightTestFixture; //导入依赖的package包/类
protected CodeInsightTestFixture createFixture(@NotNull IdeaTestFixtureFactory factory) {
final TestFixtureBuilder<IdeaProjectTestFixture> builder = factory.createLightFixtureBuilder();
final IdeaProjectTestFixture fixture = builder.getFixture();
return factory.createCodeInsightFixture(fixture);
}
示例13: getFixture
import com.intellij.testFramework.fixtures.CodeInsightTestFixture; //导入依赖的package包/类
@Override
public CodeInsightTestFixture getFixture() {
return myTestFixture;
}
示例14: createFixture
import com.intellij.testFramework.fixtures.CodeInsightTestFixture; //导入依赖的package包/类
@Override
protected final CodeInsightTestFixture createFixture(@NotNull IdeaTestFixtureFactory factory) {
return createContentFixture(factory);
}
示例15: EditorTestHelper
import com.intellij.testFramework.fixtures.CodeInsightTestFixture; //导入依赖的package包/类
public EditorTestHelper(Project project, CodeInsightTestFixture testFixture) {
this.project = project;
this.testFixture = testFixture;
}