本文整理汇总了Java中com.intellij.testFramework.CompilerTester类的典型用法代码示例。如果您正苦于以下问题:Java CompilerTester类的具体用法?Java CompilerTester怎么用?Java CompilerTester使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CompilerTester类属于com.intellij.testFramework包,在下文中一共展示了CompilerTester类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compile
import com.intellij.testFramework.CompilerTester; //导入依赖的package包/类
private void compile(final CompileScope scope) {
try {
CompilerTester tester = new CompilerTester(myProject, Arrays.asList(scope.getAffectedModules()));
UIUtil.invokeAndWaitIfNeeded(new Runnable() {
@Override
public void run() {
new MavenResourceCompilerConfigurationGenerator(myProject, MavenProjectsManager.getInstance(myProject).getProjectsTreeForTests())
.generateBuildConfiguration(false);
}
});
try {
List<CompilerMessage> messages = tester.make(scope);
for (CompilerMessage message : messages) {
if (message.getCategory() == CompilerMessageCategory.ERROR) {
fail("Compilation failed with error: " + message.getMessage());
}
}
}
finally {
tester.tearDown();
}
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
示例2: setUp
import com.intellij.testFramework.CompilerTester; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
myCompilerTester = new CompilerTester(myModule);
}
示例3: setUp
import com.intellij.testFramework.CompilerTester; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
getProject().getComponent(GroovyCompilerLoader.class).projectOpened();
myCompilerTester = new CompilerTester(useJps(), myModule);
}