当前位置: 首页>>代码示例>>Java>>正文


Java PsiTestUtil.addLibrary方法代码示例

本文整理汇总了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));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:FindManagerTest.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:JUnitClasspathTest.java

示例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;
}
 
开发者ID:manifold-systems,项目名称:manifold-ij,代码行数:12,代码来源:AbstractManifoldCodeInsightTest.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:BytecodeAnalysisTest.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:EclipseLibrariesModificationsTest.java

示例7: addLibraryAt

import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
private void addLibraryAt(String path) {
    VfsRootAccess.allowRootAccess(path.split("/")[0]);
    PsiTestUtil.addLibrary(myModule, path);
}
 
开发者ID:TNG,项目名称:jgiven-intellij-plugin,代码行数:5,代码来源:LibraryTestUtil.java

示例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");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:UnusedLibraryInspectionTest.java

示例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[]{});
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:BytecodeAnalysisResultsHighlightingTest.java

示例10: setUpLibraries

import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
private void setUpLibraries() {
  PsiTestUtil.addLibrary(myModule, "velocity", getLibDirPath(), new String[]{"/velocity.jar!/"}, new String[]{});
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:BytecodeAnalysisIntegrationTest.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:AndroidLayoutDomTest.java

示例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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:GroovyCompilerTestCase.java

示例14: setUpModule

import com.intellij.testFramework.PsiTestUtil; //导入方法依赖的package包/类
@Override
protected void setUpModule() {
  super.setUpModule();
  PsiTestUtil.addLibrary(getModule(), "javafx", PluginPathManager.getPluginHomePath("javaFX") + "/testData", "jfxrt.jar");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:GenerateGetterSetterTest.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:JavaFXQuickfixTest.java


注:本文中的com.intellij.testFramework.PsiTestUtil.addLibrary方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。