• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JavaTestFixtureFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.testFramework.fixtures.JavaTestFixtureFactory的典型用法代码示例。如果您正苦于以下问题:Java JavaTestFixtureFactory类的具体用法?Java JavaTestFixtureFactory怎么用?Java JavaTestFixtureFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JavaTestFixtureFactory类属于com.intellij.testFramework.fixtures包,在下文中一共展示了JavaTestFixtureFactory类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
  super.setUp();

  IdeaTestFixtureFactory factory = IdeaTestFixtureFactory.getFixtureFactory();
  TestFixtureBuilder<IdeaProjectTestFixture> fixtureBuilder = factory.createLightFixtureBuilder( getProjectDescriptor() );
  IdeaProjectTestFixture fixture = fixtureBuilder.getFixture();
  myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture( fixture, new TempDirTestFixtureImpl() );

  myFixture.setUp();
  myFixture.setTestDataPath( getTestDataPath() );

  myModule = myFixture.getModule();

  LanguageLevelProjectExtension.getInstance( getProject() ).setLanguageLevel( LanguageLevel.JDK_1_8 );
}
 
开发者ID:manifold-systems,项目名称:manifold-ij,代码行数:18,代码来源:SomewhatLightCodeInsightFixtureTestCase.java


示例2: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();

  if (CAN_SYNC_PROJECTS) {
    GradleProjectImporter.ourSkipSetupFromTest = true;
  }

  if (createDefaultProject()) {
    final TestFixtureBuilder<IdeaProjectTestFixture> projectBuilder =
      IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getName());
    myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(projectBuilder.getFixture());
    myFixture.setUp();
    myFixture.setTestDataPath(getTestDataPath());
  }

  ensureSdkManagerAvailable();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:AndroidGradleTestCase.java


示例3: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();

  final TestFixtureBuilder<IdeaProjectTestFixture> projectBuilder =
    IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getName());
  myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(projectBuilder.getFixture());
  myFixture.setUp();
  myFixture.setTestDataPath(getTestDataPath());

  dir = Files.createTempDir();

  myJarFile = new File(dir, LIBRARY_JAR_NAME);
  Files.write(createRealJarArchive(), myJarFile);

  VirtualFile baseDir = getProject().getBaseDir();
  AndroidGradleTestCase.createGradleWrapper(VfsUtilCore.virtualToIoFile(baseDir));
  System.out.printf("Project location: %s\n", baseDir);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:WrapArchiveWizardPathTest.java


示例4: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();
  // Fixes https://youtrack.jetbrains.com/issue/IDEA-129297. Only occurs in Jenkins.
  VfsRootAccess.allowRootAccess(System.getProperty("user.dir"));
  final TestFixtureBuilder<IdeaProjectTestFixture> fixtureBuilder =
      JavaTestFixtureFactory.createFixtureBuilder(getName());
  myModuleBuilder = fixtureBuilder.addModule(JavaModuleFixtureBuilder.class);
  myProjectFixture = fixtureBuilder.getFixture();
  myCodeInsightFixture = createCodeInsightFixture(getBaseDirectoryPath());
  new WriteAction() {
    @Override
    protected void run(@NotNull final Result result) {
      addAppEngineSupport(myProjectFixture.getModule());
    }
  }.execute();
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:18,代码来源:AppEngineCodeInsightTestCase.java


示例5: createCodeInsightFixture

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的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;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:25,代码来源:AppEngineCodeInsightTestCase.java


示例6: createFixture

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
public static IdeaProjectTestFixture createFixture(final ServerVersion version) {
    logger.info("Setting up Intellij fixture for " + version);

    final Ref<IdeaProjectTestFixture> fixture = new Ref<IdeaProjectTestFixture>();
    UIUtil.invokeAndWaitIfNeeded(new Runnable() {
        @Override
        public void run() {
            try {
                IdeaProjectTestFixture myFixture = JavaTestFixtureFactory.createFixtureBuilder(version.name() + System.currentTimeMillis()).getFixture();
                myFixture.setUp();
                fixture.set(myFixture);
            } catch (Throwable t) {
                failed = t;
            }
        }
    });
    return fixture.get();
}
 
开发者ID:janotav,项目名称:ali-idea-plugin,代码行数:19,代码来源:FixtureFactory.java


示例7: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();
  final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
  final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = fixtureFactory.createFixtureBuilder(getTestName(false));
  myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(testFixtureBuilder.getFixture());
  myFixture.setTestDataPath("/codeInsight/externalAnnotations");
  final JavaModuleFixtureBuilder builder = testFixtureBuilder.addModule(JavaModuleFixtureBuilder.class);
  new File(myFixture.getTempDirPath() + "/src/").mkdir();
  builder.addContentRoot(myFixture.getTempDirPath()).addSourceRoot("src");
  builder.setMockJdkLevel(JavaModuleFixtureBuilder.MockJdkLevel.jdk15);
  myFixture.enableInspections(new SillyAssignmentInspection());
  myFixture.setUp();

  addAnnotationsModuleRoot();

  final JavaPsiFacade facade = JavaPsiFacade.getInstance(myFixture.getProject());
  myLanguageLevel = LanguageLevel.HIGHEST; // LanguageLevelProjectExtension.getInstance(facade.getProject()).getLanguageLevel();
  //LanguageLevelProjectExtension.getInstance(facade.getProject()).setLanguageLevel(LanguageLevel.JDK_1_5);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:21,代码来源:SuppressExternalTest.java


示例8: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    final IdeaTestFixtureFactory ideaFixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
    final JavaTestFixtureFactory javaFixtureFactory = JavaTestFixtureFactory.getFixtureFactory();
    final TestFixtureBuilder<IdeaProjectTestFixture> fixtureBuilder = ideaFixtureFactory.createLightFixtureBuilder();
    fixture = javaFixtureFactory.createCodeInsightFixture(fixtureBuilder.getFixture());
    fixture.setUp();
}
 
开发者ID:t28hub,项目名称:json2java4idea,代码行数:9,代码来源:IdeaProjectTest.java


示例9: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();
  final JavaTestFixtureFactory fixtureFactory = JavaTestFixtureFactory.getFixtureFactory();
  final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = fixtureFactory.createLightFixtureBuilder();
  myFixture = testFixtureBuilder.getFixture();
  myFixture.setUp();
  myJava6 = SystemInfo.isJavaVersionAtLeast("1.6");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:NotNullVerifyingInstrumenterTest.java


示例10: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();
  final TestFixtureBuilder<IdeaProjectTestFixture> projectBuilder =
    IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getName());
  myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(projectBuilder.getFixture());
  myFixture.setUp();
  myFixture.setTestDataPath(getTestDataPath());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:FirstRunWizardTest.java


示例11: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
  System.err.println("Tests in '" + getClass().getName() + "' are disabled");
  if (false) {
    super.setUp();
    final TestFixtureBuilder<IdeaProjectTestFixture> projectBuilder =
      IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getName());
    myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(projectBuilder.getFixture());
    myFixture.setUp();
    myFixture.setTestDataPath(getTestDataPath());
    tempDir = Files.createTempDir();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:InstallComponentsPathTest.java


示例12: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
  if (DISABLED) {
    return; // Disabled
  }
  super.setUp();
  final TestFixtureBuilder<IdeaProjectTestFixture> projectBuilder =
    IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getName());
  myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(projectBuilder.getFixture());
  myFixture.setUp();
  myFixture.setTestDataPath(getTestDataPath());
  myAndroidSdkPath = AndroidTestCaseHelper.getAndroidSdkPath();
  AndroidSdkUtils.createNewAndroidPlatform(myAndroidSdkPath.getAbsolutePath(), false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:AndroidVirtualDeviceTest.java


示例13: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();

  final TestFixtureBuilder<IdeaProjectTestFixture> projectBuilder =
    IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getName());
  myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(projectBuilder.getFixture());
  myFixture.setUp();
  myFixture.setTestDataPath(getTestDataPath());

  dir = new File(Files.createTempDir(), "project");

  System.out.printf("Project location: %s\n", getProject().getBaseDir());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:GradleModuleImportTest.java


示例14: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();
  final TestFixtureBuilder<IdeaProjectTestFixture> projectBuilder =
    IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getName());
  myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(projectBuilder.getFixture());
  myFixture.setUp();
  myWizard = new DummyDynamicWizard();
  myPath = new DummyDynamicWizardPath("TestPath");
  myStep1 = new DummyDynamicWizardStep("TestStep1");
  myStep2 = new DummyDynamicWizardStep("TestStep2");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:DynamicWizardPathTest.java


示例15: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();
  final TestFixtureBuilder<IdeaProjectTestFixture> projectBuilder =
    IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getName());
  myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(projectBuilder.getFixture());
  myFixture.setUp();
  myFixture.setTestDataPath(getTestDataPath());
  myModule = GradleModuleImportTest.createGradleProjectToImport(new File(Files.createTempDir(), "project"), "gradleProject");
  myPage = new ImportSourceLocationStep(new WizardContext(getProject()), null, new NewModuleWizardState(), null, null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ImportSourceLocationStepTest.java


示例16: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();
  final JavaTestFixtureFactory fixtureFactory = JavaTestFixtureFactory.getFixtureFactory();
  final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = fixtureFactory.createLightFixtureBuilder();
  myFixture = fixtureFactory.createCodeInsightFixture(testFixtureBuilder.getFixture());
  myFixture.setTestDataPath(getTestDataPath());
  myFixture.setUp();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:AntMultiFileCompletionTest.java


示例17: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  final Ref<Exception> ex = new Ref<Exception>();
  Runnable runnable = new Runnable() {
    public void run() {
      try {
        CreateClassFixTest.super.setUp();
        final JavaTestFixtureFactory fixtureFactory = JavaTestFixtureFactory.getFixtureFactory();
        final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = JavaTestFixtureFactory.createFixtureBuilder(getClass().getSimpleName());
        myFixture = fixtureFactory.createCodeInsightFixture(testFixtureBuilder.getFixture());
        myFixture.setTestDataPath(PluginPathManager.getPluginHomePath("devkit") + "/testData");

        testFixtureBuilder.addModule(JavaModuleFixtureBuilder.class)
          .addContentRoot(myFixture.getTempDirPath()).addSourceRoot(getSourceRoot());
        myFixture.setUp();
        myFixture.enableInspections(new RegistrationProblemsInspection());
      }
      catch (Exception e) {
        ex.set(e);
      }
    }
  };
  invokeTestRunnable(runnable);
  final Exception exception = ex.get();
  if (exception != null) {
    throw exception;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:CreateClassFixTest.java


示例18: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();
  final TestFixtureBuilder<IdeaProjectTestFixture> projectBuilder = IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getTestName(false));

  myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(projectBuilder.getFixture());
  final String dataPath = "/codeInsight/externalAnnotations";
  myFixture.setTestDataPath(dataPath);
  final JavaModuleFixtureBuilder builder = projectBuilder.addModule(JavaModuleFixtureBuilder.class);
  builder.setMockJdkLevel(JavaModuleFixtureBuilder.MockJdkLevel.jdk15);

  myFixture.setUp();
  myModule = builder.getFixture().getModule();
  myProject = myFixture.getProject();
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:16,代码来源:AddAnnotationFixTest.java


示例19: setUp

import com.intellij.testFramework.fixtures.JavaTestFixtureFactory; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();

  // this will throw an exception if we don't have a full Android SDK, so we need to do this first thing before any other setup
  String sdkPath = getTestSdkPath();

  final TestFixtureBuilder<IdeaProjectTestFixture> projectBuilder =
    IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getName());
  myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(projectBuilder.getFixture());
  final JavaModuleFixtureBuilder moduleFixtureBuilder = projectBuilder.addModule(JavaModuleFixtureBuilder.class);
  final String dirPath = myFixture.getTempDirPath() + getContentRootPath();
  final File dir = new File(dirPath);

  if (!dir.exists()) {
    assertTrue(dir.mkdirs());
  }
  tuneModule(moduleFixtureBuilder, dirPath);

  final ArrayList<MyAdditionalModuleData> modules = new ArrayList<MyAdditionalModuleData>();
  configureAdditionalModules(projectBuilder, modules);

  myFixture.setUp();
  myFixture.setTestDataPath(getTestDataPath());
  myModule = moduleFixtureBuilder.getFixture().getModule();

  // Must be done before addAndroidFacet, and must always be done, even if !myCreateManifest.
  // We will delete it at the end of setUp; this is needed when unit tests want to rewrite
  // the manifest on their own.
  createManifest();

  myFacet = addAndroidFacet(myModule, sdkPath, getPlatformDir(), isToAddSdk());

  LanguageLevel languageLevel = getLanguageLevel();
  if (languageLevel != null) {
    final LanguageLevelProjectExtension extension = LanguageLevelProjectExtension.getInstance(myModule.getProject());
    if (extension != null) {
      extension.setLanguageLevel(languageLevel);
    }
  }

  myFixture.copyDirectoryToProject(getResDir(), "res");

  myAdditionalModules = new ArrayList<Module>();

  for (MyAdditionalModuleData data : modules) {
    final Module additionalModule = data.myModuleFixtureBuilder.getFixture().getModule();
    myAdditionalModules.add(additionalModule);
    final AndroidFacet facet = addAndroidFacet(additionalModule, sdkPath, getPlatformDir());
    facet.setLibraryProject(data.myLibrary);
    final String rootPath = getContentRootPath(data.myDirName);
    myFixture.copyDirectoryToProject("res", rootPath + "/res");
    myFixture.copyFileToProject(SdkConstants.FN_ANDROID_MANIFEST_XML,
                                rootPath + '/' + SdkConstants.FN_ANDROID_MANIFEST_XML);
    ModuleRootModificationUtil.addDependency(myModule, additionalModule);
  }

  if (!myCreateManifest) {
    deleteManifest();
  }

  if (RenderSecurityManager.RESTRICT_READS) {
    // Unit test class loader includes disk directories which security manager does not allow access to
    RenderSecurityManager.sEnabled = false;
  }

  ArrayList<String> allowedRoots = new ArrayList<String>();
  collectAllowedRoots(allowedRoots);
  registerAllowedRoots(allowedRoots, myTestRootDisposable);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:71,代码来源:AndroidTestCase.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LockStatus类代码示例发布时间:2022-05-23
下一篇:
Java SimplePreferences类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap