本文整理汇总了Java中com.intellij.refactoring.MockInlineMethodOptions类的典型用法代码示例。如果您正苦于以下问题:Java MockInlineMethodOptions类的具体用法?Java MockInlineMethodOptions怎么用?Java MockInlineMethodOptions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MockInlineMethodOptions类属于com.intellij.refactoring包,在下文中一共展示了MockInlineMethodOptions类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doTest
import com.intellij.refactoring.MockInlineMethodOptions; //导入依赖的package包/类
private void doTest(String className, String methodName) throws Exception {
String rootBefore = getRoot() + "/before";
PsiTestUtil.removeAllRoots(myModule, IdeaTestUtil.getMockJdk17());
final VirtualFile rootDir = PsiTestUtil.createTestProjectStructure(myProject, myModule, rootBefore, myFilesToDelete);
PsiClass aClass = myJavaFacade.findClass(className, ProjectScope.getAllScope(myProject));
assertTrue(aClass != null);
PsiElement element = aClass.findMethodsByName(methodName, false)[0];
assertTrue(element instanceof PsiMethod);
PsiMethod method = (PsiMethod)element;
final boolean condition = InlineMethodProcessor.checkBadReturns(method) && !InlineUtil.allUsagesAreTailCalls(method);
assertFalse("Bad returns found", condition);
InlineOptions options = new MockInlineMethodOptions();
final InlineMethodProcessor processor = new InlineMethodProcessor(getProject(), method, null, myEditor, options.isInlineThisOnly());
processor.run();
String rootAfter = getRoot() + "/after";
VirtualFile rootDir2 = LocalFileSystem.getInstance().findFileByPath(rootAfter.replace(File.separatorChar, '/'));
myProject.getComponent(PostprocessReformattingAspect.class).doPostponedFormatting();
PlatformTestUtil.assertDirectoriesEqual(rootDir2, rootDir);
}
示例2: doTestInlineThisOnly
import com.intellij.refactoring.MockInlineMethodOptions; //导入依赖的package包/类
private void doTestInlineThisOnly() {
@NonNls String fileName = "/refactoring/inlineMethod/" + getTestName(false) + ".java";
configureByFile(fileName);
performAction(new MockInlineMethodOptions(){
@Override
public boolean isInlineThisOnly() {
return true;
}
}, false);
checkResultByFile(fileName + ".after");
}
示例3: performAction
import com.intellij.refactoring.MockInlineMethodOptions; //导入依赖的package包/类
private void performAction(final boolean nonCode) {
performAction(new MockInlineMethodOptions(), nonCode);
}