use of com.intellij.testFramework.builders.JavaModuleFixtureBuilder in project intellij-community by JetBrains.
the class JavaCodeInsightFixtureTestCase method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
final TestFixtureBuilder<IdeaProjectTestFixture> projectBuilder = IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getName());
myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(projectBuilder.getFixture());
final JavaModuleFixtureBuilder moduleFixtureBuilder = projectBuilder.addModule(JavaModuleFixtureBuilder.class);
if (toAddSourceRoot()) {
moduleFixtureBuilder.addSourceContentRoot(myFixture.getTempDirPath());
} else {
moduleFixtureBuilder.addContentRoot(myFixture.getTempDirPath());
}
tuneFixture(moduleFixtureBuilder);
myFixture.setUp();
myFixture.setTestDataPath(getTestDataPath());
myModule = moduleFixtureBuilder.getFixture().getModule();
LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(LanguageLevel.JDK_1_6);
}
use of com.intellij.testFramework.builders.JavaModuleFixtureBuilder in project intellij-community by JetBrains.
the class SuppressExternalTest method setUp.
@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);
}
use of com.intellij.testFramework.builders.JavaModuleFixtureBuilder in project intellij-community by JetBrains.
the class AddAnnotationFixTest method setUp.
@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();
CodeStyleSettingsManager.getSettings(myProject).USE_EXTERNAL_ANNOTATIONS = true;
}
use of com.intellij.testFramework.builders.JavaModuleFixtureBuilder in project android by JetBrains.
the class AndroidTestCase method addModuleWithAndroidFacet.
protected final void addModuleWithAndroidFacet(@NotNull TestFixtureBuilder<IdeaProjectTestFixture> projectBuilder, @NotNull List<MyAdditionalModuleData> modules, @NotNull String dirName, int projectType, boolean isMainModuleDependency) {
JavaModuleFixtureBuilder moduleFixtureBuilder = projectBuilder.addModule(JavaModuleFixtureBuilder.class);
String moduleDirPath = myFixture.getTempDirPath() + getAdditionalModulePath(dirName);
//noinspection ResultOfMethodCallIgnored
new File(moduleDirPath).mkdirs();
initializeModuleFixtureBuilderWithSrcAndGen(moduleFixtureBuilder, moduleDirPath);
modules.add(new MyAdditionalModuleData(moduleFixtureBuilder, dirName, projectType, isMainModuleDependency));
}
use of com.intellij.testFramework.builders.JavaModuleFixtureBuilder in project intellij-community by JetBrains.
the class ClsGenericsHighlightingTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
TestFixtureBuilder<IdeaProjectTestFixture> projectBuilder = IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getName());
myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(projectBuilder.getFixture());
myFixture.setTestDataPath(PathManagerEx.getTestDataPath() + "/codeInsight/clsHighlighting");
JavaModuleFixtureBuilder builder = projectBuilder.addModule(JavaModuleFixtureBuilder.class);
builder.setLanguageLevel(getLanguageLevel());
builder.addJdk(IdeaTestUtil.getMockJdk18Path().getPath());
myFixture.setUp();
myModule = builder.getFixture().getModule();
}
Aggregations