本文整理汇总了Java中com.intellij.testFramework.PsiTestUtil.addLibrary方法的典型用法代码示例。如果您正苦于以下问题:Java PsiTestUtil.addLibrary方法的具体用法?Java PsiTestUtil.addLibrary怎么用?Java PsiTestUtil.addLibrary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.testFramework.PsiTestUtil
的用法示例。
在下文中一共展示了PsiTestUtil.addLibrary方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFindInFileUnderLibraryUnderProject
import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
public void testFindInFileUnderLibraryUnderProject() {
initProject("libUnderProject", "src");
String libDir = JavaTestUtil.getJavaTestDataPath() + "/find/libUnderProject/lib";
PsiTestUtil.addLibrary(myModule, "lib", libDir, new String[]{""}, ArrayUtil.EMPTY_STRING_ARRAY);
FindModel findModel = new FindModel();
findModel.setStringToFind("TargetWord");
findModel.setFromCursor(false);
findModel.setGlobal(true);
findModel.setMultipleFiles(true);
findModel.setWholeWordsOnly(false);
assertSize(2, findUsages(findModel));
findModel.setWholeWordsOnly(true);
assertSize(2, findUsages(findModel));
}
示例2: setupModule
import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
private Module setupModule(String moduleName, final String className) throws IOException {
final VirtualFile root1 = myFixture.getTempDirFixture().findOrCreateDir(moduleName);
final Module module = PsiTestUtil.addModule(getProject(), JavaModuleType.getModuleType(), moduleName, root1);
PsiTestUtil.removeAllRoots(module, IdeaTestUtil.getMockJdk18());
PsiTestUtil.addSourceRoot(module, root1, true);
myFixture.addFileToProject(moduleName + "/p/" + className + ".java",
"package p;\n" +
"public class " + className + " extends junit.framework.TestCase {\n" +
" public void testName1(){}" +
"}");
final String pathForClass = PathUtil.getJarPathForClass(TestCase.class);
PsiTestUtil.addLibrary(module,
"junit4",
StringUtil.getPackageName(pathForClass, File.separatorChar),
StringUtil.getShortName(pathForClass, File.separatorChar));
return module;
}
示例3: createModule
import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
@Override
protected Module createModule( @NotNull Project project, @NotNull String moduleFilePath )
{
Module module = super.createModule( project, moduleFilePath );
for( String jarFileName : getLibs() )
{
PsiTestUtil.addLibrary( module, getPath_LibRoot() + File.separatorChar + jarFileName );
}
PsiTestUtil.addLibrary( module, findToolsJar() );
return module;
}
示例4: setUp
import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
if (!ignoreCamelCoreLib) {
PsiTestUtil.addLibrary(myModule, "Maven: " + CAMEL_CORE_MAVEN_ARTIFACT, mavenArtifacts[0].getParent(), mavenArtifacts[0].getName());
}
disposeOnTearDown(ServiceManager.getService(myModule.getProject(), CamelCatalogService.class));
disposeOnTearDown(ServiceManager.getService(myModule.getProject(), CamelService.class));
ServiceManager.getService(myModule.getProject(), CamelService.class).setCamelPresent(true);
}
开发者ID:camel-idea-plugin,项目名称:camel-idea-plugin,代码行数:12,代码来源:CamelLightCodeInsightFixtureTestCaseIT.java
示例5: setUpDataClasses
import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
private void setUpDataClasses() throws Exception {
File classesDir = new File(Test01.class.getResource("/" + Test01.class.getPackage().getName().replace('.', '/')).toURI());
File destDir = new File(myModule.getProject().getBaseDir().getPath() + myClassesProjectRelativePath);
FileUtil.copyDir(classesDir, destDir);
VirtualFile vFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(destDir);
assertNotNull(vFile);
PsiTestUtil.addLibrary(myModule, "dataClasses", vFile.getPath(), new String[]{""}, ArrayUtil.EMPTY_STRING_ARRAY);
}
示例6: doTestCreate
import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
private void doTestCreate(final String[] classRoots, final String[] sourceRoots) throws Exception {
final Project project = getProject();
final String path = project.getBaseDir().getPath() + "/test";
final Module module = EclipseClasspathTest.setUpModule(path, project);
PsiTestUtil.addLibrary(module, "created", ModuleRootManager.getInstance(module).getContentRoots()[0].getParent().getPath(), classRoots,
sourceRoots);
EclipseClasspathTest.checkModule(project.getBaseDir().getPath() + "/expected", module);
}
示例7: addLibraryAt
import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
private void addLibraryAt(String path) {
VfsRootAccess.allowRootAccess(path.split("/")[0]);
PsiTestUtil.addLibrary(myModule, path);
}
示例8: setupRootModel
import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
@Override
protected void setupRootModel(String testDir, VirtualFile[] sourceDir, String sdkName) {
super.setupRootModel(testDir, sourceDir, sdkName);
PsiTestUtil.addLibrary(getModule(), "JUnit", getTestDataPath(), "/junit.jar");
}
示例9: setUpLibraries
import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
private void setUpLibraries() {
VirtualFile lib = LocalFileSystem.getInstance().refreshAndFindFileByPath(PathManagerEx.getTestDataPath() + "/../../../lib");
assertNotNull(lib);
PsiTestUtil.addLibrary(myModule, "velocity", lib.getPath(), new String[]{"/velocity.jar!/"}, new String[]{});
}
示例10: setUpLibraries
import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
private void setUpLibraries() {
PsiTestUtil.addLibrary(myModule, "velocity", getLibDirPath(), new String[]{"/velocity.jar!/"}, new String[]{});
}
示例11: testAar
import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
public void testAar() throws Throwable {
PsiTestUtil.addLibrary(myModule, "maven_aar_dependency", getTestDataPath() + "/" + testFolder + "/myaar", "classes.jar", "res");
doTestCompletion();
}
示例12: test
import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
public void test() {
PsiTestUtil.addLibrary(myModule, getTestDataPath() + "/com/siyeh/igtest/redundancy/element_only_used_from_test_code/junit/");
doTest("com/siyeh/igtest/redundancy/element_only_used_from_test_code", new ElementOnlyUsedFromTestCodeInspection());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ElementOnlyUsedFromTestCodeInspectionTest.java
示例13: addGroovyLibrary
import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
protected static void addGroovyLibrary(final Module to) {
File jar = GroovyFacetUtil.getBundledGroovyJar();
PsiTestUtil.addLibrary(to, "groovy", jar.getParent(), jar.getName());
}
示例14: setUpModule
import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
@Override
protected void setUpModule() {
super.setUpModule();
PsiTestUtil.addLibrary(getModule(), "javafx", PluginPathManager.getPluginHomePath("javaFX") + "/testData", "jfxrt.jar");
}
示例15: configureModule
import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
@Override
public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) {
PsiTestUtil.addLibrary(module, model, "javafx", PluginPathManager.getPluginHomePath("javaFX") + "/testData", "jfxrt.jar");
PsiTestUtil.addLibrary(module, model, "javafx", PluginPathManager.getPluginHomePath("javaFX") + "/testData", "groovy-1.8.0.jar");
super.configureModule(module, model, contentEntry);
}