mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-18 16:17:00 +07:00
21 lines
1.1 KiB
Java
21 lines
1.1 KiB
Java
package com.intellij.codeInsight.template;
|
|
|
|
import com.intellij.codeInsight.template.impl.TemplateManagerImpl;
|
|
import com.intellij.openapi.command.WriteCommandAction;
|
|
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
|
|
|
|
public class TemplateBuilderTest extends LightCodeInsightFixtureTestCase {
|
|
public void testRunInlineTemplate() throws Throwable {
|
|
TemplateManagerImpl.setTemplateTesting(myFixture.getProject(), myFixture.getTestRootDisposable());
|
|
myFixture.configureByText("a.java", "class A {\n" +
|
|
" public String tes<caret>t() {\n" +
|
|
" }\n" +
|
|
"}");
|
|
WriteCommandAction.runWriteCommandAction(myFixture.getProject(), () -> TemplateBuilderFactory.getInstance().createTemplateBuilder(myFixture.getElementAtCaret()).run(myFixture.getEditor(), true));
|
|
myFixture.checkResult("class A {\n" +
|
|
" <caret>public String test() {\n" +
|
|
" }\n" +
|
|
"}");
|
|
}
|
|
}
|