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


Java MockDocument类代码示例

本文整理汇总了Java中com.intellij.mock.MockDocument的典型用法代码示例。如果您正苦于以下问题:Java MockDocument类的具体用法?Java MockDocument怎么用?Java MockDocument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testLowerCase

import com.intellij.mock.MockDocument; //导入依赖的package包/类
public void testLowerCase() throws Exception {
    new OCamlCompletionContributor().beforeCompletion(new CompletionInitializationContext(createDummyEditor(), createFakeFile(), CompletionType.BASIC) {
        @Override
        public void setFileCopyPatcher(@NotNull final FileCopyPatcher fileCopyPatcher) {
            final MockDocument document = new MyMockDocument() {
                @Override
                public void replaceString(final int startOffset, final int endOffset, @NotNull final CharSequence s) {
                    assertEquals(OCamlCompletionContributor.LOWER_CASE_DUMMY_IDENTIFIER, s);
                }
            };
            final OffsetMap offsetMap = new OffsetMap(document);
            offsetMap.addOffset(CompletionInitializationContext.START_OFFSET, 0);
            offsetMap.addOffset(CompletionInitializationContext.SELECTION_END_OFFSET, 0);
            fileCopyPatcher.patchFileCopy(createFakeFile(), document, offsetMap);
        }
    });
}
 
开发者ID:traff,项目名称:intellij-ocaml,代码行数:18,代码来源:CaseSensitivityCompletionTest.java

示例2: testGetUncommittedDocuments_documentNotRegistered

import com.intellij.mock.MockDocument; //导入依赖的package包/类
public void testGetUncommittedDocuments_documentNotRegistered() throws Exception
{
	final Document document = new MockDocument();

	ApplicationManager.getApplication().runWriteAction(new Runnable()
	{
		@Override
		public void run()
		{
			getPsiDocumentManager().documentChanged(new DocumentEventImpl(document, 0, "", "", document.getModificationStamp(), false));
		}
	});


	assertEquals(0, getPsiDocumentManager().getUncommittedDocuments().length);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:17,代码来源:PsiDocumentManagerImplTest.java

示例3: testGetUncommittedDocuments_documentNotRegistered

import com.intellij.mock.MockDocument; //导入依赖的package包/类
public void testGetUncommittedDocuments_documentNotRegistered() throws Exception {
  final Document document = new MockDocument();

  WriteCommandAction.runWriteCommandAction(null, new Runnable() {
    @Override
    public void run() {
      changeDocument(document, PsiDocumentManagerImplTest.this.getPsiDocumentManager());
    }
  });


  assertEquals(0, getPsiDocumentManager().getUncommittedDocuments().length);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:PsiDocumentManagerImplTest.java

示例4: testGetUncommittedDocuments_documentNotRegistered

import com.intellij.mock.MockDocument; //导入依赖的package包/类
public void testGetUncommittedDocuments_documentNotRegistered() throws Exception {
  final Document document = new MockDocument();

  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    @Override
    public void run() {
      getPsiDocumentManager().documentChanged(new DocumentEventImpl(document, 0, "", "", document.getModificationStamp(), false));
    }
  });


  assertEquals(0, getPsiDocumentManager().getUncommittedDocuments().length);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:PsiDocumentManagerImplTest.java

示例5: FormatAsciiDocActionTest

import com.intellij.mock.MockDocument; //导入依赖的package包/类
public FormatAsciiDocActionTest(String prefix, String selection, String postfix, boolean isWord, String explanation) {
  document = new MockDocument();
  document.replaceString(0, 0, prefix + selection + postfix);
  start = prefix.length();
  end = prefix.length() + selection.length();
  this.explanation = explanation;
  this.isWord = isWord;
}
 
开发者ID:asciidoctor,项目名称:asciidoctor-intellij-plugin,代码行数:9,代码来源:FormatAsciiDocActionTest.java

示例6: createPendingChange

import com.intellij.mock.MockDocument; //导入依赖的package包/类
private TestFindResult createPendingChange(final int startOffset) {
  FindResultImpl findResult = new FindResultImpl(startOffset, startOffset + 10);
  TestFindResult testFindResult = new TestFindResult(new MockDocument(""), findResult) {
    @Override
    public int getStartOffset() {
      return startOffset;
    }
  };
  testFindResult.setTestState(TestState.NotModified);
  return testFindResult;
}
 
开发者ID:andresdominguez,项目名称:ddescriber,代码行数:12,代码来源:PendingChangesTest.java

示例7: testGetCachedPsiFile_NoFile

import com.intellij.mock.MockDocument; //导入依赖的package包/类
public void testGetCachedPsiFile_NoFile() throws Exception {
  final PsiFile file = getPsiDocumentManager().getCachedPsiFile(new MockDocument());
  assertNull(file);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:PsiDocumentManagerImplTest.java

示例8: testGetPsiFile_NotRegisteredDocument

import com.intellij.mock.MockDocument; //导入依赖的package包/类
public void testGetPsiFile_NotRegisteredDocument() throws Exception {
  final PsiFile file = getPsiDocumentManager().getPsiFile(new MockDocument());
  assertNull(file);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:PsiDocumentManagerImplTest.java

示例9: setUp

import com.intellij.mock.MockDocument; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();
  myDocument = new MockDocument();
  myTextBlock = new TextBlock();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:7,代码来源:TextBlockTest.java

示例10: testGetCachedPsiFile_NoFile

import com.intellij.mock.MockDocument; //导入依赖的package包/类
public void testGetCachedPsiFile_NoFile() throws Exception
{
	final PsiFile file = getPsiDocumentManager().getCachedPsiFile(new MockDocument());
	assertNull(file);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:6,代码来源:PsiDocumentManagerImplTest.java

示例11: testGetPsiFile_NotRegisteredDocument

import com.intellij.mock.MockDocument; //导入依赖的package包/类
public void testGetPsiFile_NotRegisteredDocument() throws Exception
{
	final PsiFile file = getPsiDocumentManager().getPsiFile(new MockDocument());
	assertNull(file);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:6,代码来源:PsiDocumentManagerImplTest.java


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