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


Java IdeaProjectTestFixture类代码示例

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


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

示例1: setUp

import com.intellij.testFramework.fixtures.IdeaProjectTestFixture; //导入依赖的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: createExceptionBreakZeroDivisionError

import com.intellij.testFramework.fixtures.IdeaProjectTestFixture; //导入依赖的package包/类
private static void createExceptionBreakZeroDivisionError(IdeaProjectTestFixture fixture,
                                                          boolean notifyOnTerminate,
                                                          boolean notifyOnFirst,
                                                          boolean ignoreLibraries) {
  XDebuggerTestUtil.removeAllBreakpoints(fixture.getProject());
  XDebuggerTestUtil.setDefaultBreakpointEnabled(fixture.getProject(), PyExceptionBreakpointType.class, false);

  PyExceptionBreakpointProperties properties = new PyExceptionBreakpointProperties("exceptions.ZeroDivisionError");
  properties.setNotifyOnTerminate(notifyOnTerminate);
  properties.setNotifyOnlyOnFirst(notifyOnFirst);
  properties.setIgnoreLibraries(ignoreLibraries);
  addExceptionBreakpoint(fixture, properties);
  properties = new PyExceptionBreakpointProperties("builtins.ZeroDivisionError"); //for python 3
  properties.setNotifyOnTerminate(notifyOnTerminate);
  properties.setNotifyOnlyOnFirst(notifyOnFirst);
  properties.setIgnoreLibraries(ignoreLibraries);
  addExceptionBreakpoint(fixture, properties);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:PythonDebuggerTest.java

示例3: setUp

import com.intellij.testFramework.fixtures.IdeaProjectTestFixture; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();
  final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
  final TestFixtureBuilder<IdeaProjectTestFixture> builder = fixtureFactory.createFixtureBuilder(getName());

  myFixture = fixtureFactory.createCodeInsightFixture(builder.getFixture());
  myFixture.setTestDataPath(getTestDataPath());
  myFixture.setUp();

  final Project project = myFixture.getProject();

  new WriteCommandAction(project) {
    @Override
    protected void run(@NotNull Result result) throws Throwable {
      FileTypeManager.getInstance().registerFileType(RegExpFileType.INSTANCE, new String[]{"regexp"});
    }
  }.execute();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:BaseParseTestCase.java

示例4: setUp

import com.intellij.testFramework.fixtures.IdeaProjectTestFixture; //导入依赖的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

示例5: createProject

import com.intellij.testFramework.fixtures.IdeaProjectTestFixture; //导入依赖的package包/类
public static void createProject(final IdeaProjectTestFixture myFixture,
                                 final NewProjectWizardState projectWizardState,
                                 boolean syncModel) throws Exception {
  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    @Override
    public void run() {
      AssetStudioAssetGenerator assetGenerator = new AssetStudioAssetGenerator(projectWizardState);
      NewProjectWizard.createProject(projectWizardState, myFixture.getProject(), assetGenerator);
      if (Template.ourMostRecentException != null) {
        fail(Template.ourMostRecentException.getMessage());
      }
      FileDocumentManager.getInstance().saveAllDocuments();
    }
  });

  // Sync model
  if (syncModel) {
    String projectName = projectWizardState.getString(FormFactorUtils.ATTR_MODULE_NAME);
    File projectRoot = new File(projectWizardState.getString(NewModuleWizardState.ATTR_PROJECT_LOCATION));
    assertEquals(projectRoot, virtualToIoFile(myFixture.getProject().getBaseDir()));
    importProject(myFixture.getProject(), projectName, projectRoot, null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:AndroidGradleTestCase.java

示例6: setUp

import com.intellij.testFramework.fixtures.IdeaProjectTestFixture; //导入依赖的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

示例7: setUp

import com.intellij.testFramework.fixtures.IdeaProjectTestFixture; //导入依赖的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

示例8: setUp

import com.intellij.testFramework.fixtures.IdeaProjectTestFixture; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();
  final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
  final TestFixtureBuilder<IdeaProjectTestFixture> builder = fixtureFactory.createFixtureBuilder(getName());

  myFixture = fixtureFactory.createCodeInsightFixture(builder.getFixture());
  myFixture.setTestDataPath(getTestDataPath());
  myFixture.setUp();

  final Project project = myFixture.getProject();

  new WriteCommandAction(project) {
    @Override
    protected void run(Result result) throws Throwable {
      FileTypeManager.getInstance().registerFileType(RegExpFileType.INSTANCE, new String[]{"regexp"});
    }
  }.execute();

}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:BaseParseTestcase.java

示例9: createFixture

import com.intellij.testFramework.fixtures.IdeaProjectTestFixture; //导入依赖的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

示例10: setUp

import com.intellij.testFramework.fixtures.IdeaProjectTestFixture; //导入依赖的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

示例11: setUp

import com.intellij.testFramework.fixtures.IdeaProjectTestFixture; //导入依赖的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

示例12: SwaggerFixture

import com.intellij.testFramework.fixtures.IdeaProjectTestFixture; //导入依赖的package包/类
private SwaggerFixture(@NotNull String folderAbsolutePath) throws Exception {
    IdeaTestFixtureFactory factory = IdeaTestFixtureFactory.getFixtureFactory();
    LightProjectDescriptor projectDescriptor = LightProjectDescriptor.EMPTY_PROJECT_DESCRIPTOR;
    TestFixtureBuilder<IdeaProjectTestFixture> fixtureBuilder = factory.createLightFixtureBuilder(projectDescriptor);
    IdeaProjectTestFixture fixture = fixtureBuilder.getFixture();

    myCodeInsightFixture = factory.createCodeInsightFixture(fixture, new LightTempDirTestFixtureImpl(true));
    myCodeInsightFixture.setUp();
    myCodeInsightFixture.setTestDataPath(folderAbsolutePath);
}
 
开发者ID:zalando,项目名称:intellij-swagger,代码行数:11,代码来源:SwaggerFixture.java

示例13: setUp

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

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

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

    myModule = myFixture.getModule();
}
 
开发者ID:dnltsk,项目名称:intellij-geocoding-plugin,代码行数:15,代码来源:LightPlatformCodeInsightFixtureTestCase.java

示例14: setUp

import com.intellij.testFramework.fixtures.IdeaProjectTestFixture; //导入依赖的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

示例15: setUp

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

  final IdeaTestFixtureFactory factory = IdeaTestFixtureFactory.getFixtureFactory();
  final TestFixtureBuilder<IdeaProjectTestFixture> fixtureBuilder = factory.createLightFixtureBuilder(getProjectDescriptor());
  final IdeaProjectTestFixture fixture = fixtureBuilder.getFixture();
  final LightTempDirTestFixtureImpl tempDirTestFixture = new LightTempDirTestFixtureImpl(true);
  myFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(fixture, tempDirTestFixture);
  myFixture.setUp();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:SMLightFixtureTestCase.java


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