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


Java JavaModuleFixtureBuilder.setMockJdkLevel方法代码示例

本文整理汇总了Java中com.intellij.testFramework.builders.JavaModuleFixtureBuilder.setMockJdkLevel方法的典型用法代码示例。如果您正苦于以下问题:Java JavaModuleFixtureBuilder.setMockJdkLevel方法的具体用法?Java JavaModuleFixtureBuilder.setMockJdkLevel怎么用?Java JavaModuleFixtureBuilder.setMockJdkLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.testFramework.builders.JavaModuleFixtureBuilder的用法示例。


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

示例1: setUp

import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; //导入方法依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();
  final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
  final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = fixtureFactory.createFixtureBuilder(getName());
  myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(testFixtureBuilder.getFixture());
  myFixture.setTestDataPath(PathManagerEx.getTestDataPath() + "/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.setUp();
  myFixture.enableInspections(new SillyAssignmentInspection());

  addAnnotationsModuleRoot();

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

示例2: setUp

import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; //导入方法依赖的package包/类
@Override
public void setUp() throws Exception {
  super.setUp();
  final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
  final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = fixtureFactory.createFixtureBuilder(getName());
  myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(testFixtureBuilder.getFixture());
  myFixture.setTestDataPath(PathManagerEx.getTestDataPath() + "/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 = LanguageLevelProjectExtension.getInstance(facade.getProject()).getLanguageLevel();
  LanguageLevelProjectExtension.getInstance(facade.getProject()).setLanguageLevel(LanguageLevel.JDK_1_5);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:SuppressExternalTest.java

示例3: setUp

import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; //导入方法依赖的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

示例4: ModuleBuilder

import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; //导入方法依赖的package包/类
public ModuleBuilder(@NotNull final TestFixtureBuilder<IdeaProjectTestFixture> host,
                     @NotNull final String name,
                     @NotNull final String[] path) throws Exception {
  myHost = host;
  final
  JavaModuleFixtureBuilder bld = host.addModule(JavaModuleFixtureBuilder.class);
  bld.setMockJdkLevel(JavaModuleFixtureBuilder.MockJdkLevel.jdk15);
  bld.addSourceContentRoot(testDataPath(path));
  myModule = bld.getFixture();
  myModule.setUp();
  new WriteAction<Void>() {
    @Override
    protected void run(Result<Void> result) throws Throwable {
      final ModifiableModuleModel model = ModuleManager.getInstance(project()).getModifiableModel();
      try {
        model.renameModule(module(), name);
      } catch (ModuleWithNameAlreadyExists moduleWithNameAlreadyExists) {
        model.dispose();
        Assert.fail();
        return;
      }
      model.commit();
    }
  }.execute();
}
 
开发者ID:jonnyzzz,项目名称:IDEA.Dependencies,代码行数:26,代码来源:AnalyzerTestCase.java

示例5: setUp

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

  myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(projectBuilder.getFixture());
  final String dataPath = PathManagerEx.getTestDataPath() + "/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:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:AddAnnotationFixTest.java

示例6: setUp

import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; //导入方法依赖的package包/类
@Before

    public void setUp() throws Exception {

        final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
        final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = fixtureFactory.createFixtureBuilder();
        myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(testFixtureBuilder.getFixture());
        myFixture.setTestDataPath(dataPath);
        final JavaModuleFixtureBuilder builder = testFixtureBuilder.addModule(JavaModuleFixtureBuilder.class);

        builder.addContentRoot(myFixture.getTempDirPath()).addSourceRoot("");
        builder.setMockJdkLevel(JavaModuleFixtureBuilder.MockJdkLevel.jdk15);
        myFixture.setUp();

    }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:YourTest.java

示例7: setUp

import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; //导入方法依赖的package包/类
public void setUp() throws Exception {

        final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
        final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = fixtureFactory.createFixtureBuilder(getName());
        myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(testFixtureBuilder.getFixture());
        myFixture.setTestDataPath(dataPath);
        final JavaModuleFixtureBuilder builder = testFixtureBuilder.addModule(JavaModuleFixtureBuilder.class);

        builder.addContentRoot(myFixture.getTempDirPath()).addSourceRoot("");
        builder.setMockJdkLevel(JavaModuleFixtureBuilder.MockJdkLevel.jdk15);
        myFixture.setUp();
    }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:TestThisPlugin.java

示例8: setUp

import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; //导入方法依赖的package包/类
@Before

  public void setUp() throws Exception {

    final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
    final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = fixtureFactory.createFixtureBuilder(getName());
    myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(testFixtureBuilder.getFixture());
    myFixture.setTestDataPath(dataPath);
    final JavaModuleFixtureBuilder builder = testFixtureBuilder.addModule(JavaModuleFixtureBuilder.class);

    builder.addContentRoot(myFixture.getTempDirPath()).addSourceRoot("");
    builder.setMockJdkLevel(JavaModuleFixtureBuilder.MockJdkLevel.jdk15);
    myFixture.setUp();

  }
 
开发者ID:JetBrains,项目名称:intellij-sdk-docs,代码行数:16,代码来源:YourTest.java

示例9: setUp

import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; //导入方法依赖的package包/类
public void setUp() throws Exception {

    final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
    final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder =
        fixtureFactory.createFixtureBuilder(getName());
    myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(testFixtureBuilder.getFixture());
    myFixture.setTestDataPath(dataPath);
    final JavaModuleFixtureBuilder builder = testFixtureBuilder.addModule(JavaModuleFixtureBuilder.class);

    builder.addContentRoot(myFixture.getTempDirPath()).addSourceRoot("");
    builder.setMockJdkLevel(JavaModuleFixtureBuilder.MockJdkLevel.jdk15);
    myFixture.setUp();
  }
 
开发者ID:JetBrains,项目名称:intellij-sdk-docs,代码行数:14,代码来源:TestThisPlugin.java

示例10: setUp

import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; //导入方法依赖的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

示例11: tuneFixture

import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; //导入方法依赖的package包/类
@Override
protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) throws Exception {
  moduleBuilder.setMockJdkLevel(JavaModuleFixtureBuilder.MockJdkLevel.jdk15);
  moduleBuilder.addLibrary("junit", PathUtil.getJarPathForClass(TestCase.class));
  moduleBuilder.addLibrary("testng", PathUtil.getJarPathForClass(AfterMethod.class));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:BaseTestNGInspectionsTest.java

示例12: tuneFixture

import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; //导入方法依赖的package包/类
@Override
protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) {
  moduleBuilder.setMockJdkLevel(JavaModuleFixtureBuilder.MockJdkLevel.jdk15);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:RedundantTypeArgsInspectionTest.java

示例13: tuneFixture

import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; //导入方法依赖的package包/类
@Override
protected void tuneFixture(JavaModuleFixtureBuilder moduleBuilder) throws Exception {
  moduleBuilder.setMockJdkLevel(JavaModuleFixtureBuilder.MockJdkLevel.jdk15);
  moduleBuilder.addJdk(IdeaTestUtil.getMockJdk17Path().getPath());
  super.tuneFixture(moduleBuilder);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:7,代码来源:GroovyCompilerTestCase.java

示例14: tuneFixture

import com.intellij.testFramework.builders.JavaModuleFixtureBuilder; //导入方法依赖的package包/类
@Override
protected void tuneFixture(final JavaModuleFixtureBuilder moduleBuilder) {
    moduleBuilder.setMockJdkLevel(JavaModuleFixtureBuilder.MockJdkLevel.jdk15);
}
 
开发者ID:consulo,项目名称:consulo-apache-velocity,代码行数:5,代码来源:VtlCompletionTest.java


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