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


Java MockInlineMethodOptions类代码示例

本文整理汇总了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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:InlineMethodMultifileTest.java

示例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");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:InlineMethodTest.java

示例3: performAction

import com.intellij.refactoring.MockInlineMethodOptions; //导入依赖的package包/类
private void performAction(final boolean nonCode) {
  performAction(new MockInlineMethodOptions(), nonCode);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:InlineMethodTest.java


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