mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 21:41:24 +07:00
Split SplitLineActionTest into Java and XML specific parts
GitOrigin-RevId: 19f11736e3a358ab995d6d38b155e6381e0f33c3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6843b8a3f1
commit
28a0e87e7e
@@ -0,0 +1,6 @@
|
||||
class Foo {
|
||||
void foo(){
|
||||
int lineStart = document.getLineStartOffset<caret>
|
||||
(document.getLineNumber(offset));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class Foo {
|
||||
void foo(){
|
||||
int lineStart = document.getLineStartOffset<caret>(document.getLineNumber(offset));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.JavaTestUtil;
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.openapi.actionSystem.IdeActions;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionManager;
|
||||
import com.intellij.testFramework.LightPlatformCodeInsightTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class JavaSplitLineActionTest extends LightPlatformCodeInsightTestCase {
|
||||
@Override
|
||||
protected @NotNull String getTestDataPath() {
|
||||
return JavaTestUtil.getJavaTestDataPath();
|
||||
}
|
||||
|
||||
public void testMethodCall() {
|
||||
String path = "/codeInsight/splitLineAction/";
|
||||
|
||||
configureByFile(path + "methodCall_before.java");
|
||||
performAction();
|
||||
checkResultByFile(path + "methodCall_after.java");
|
||||
}
|
||||
|
||||
private void performAction() {
|
||||
EditorActionManager actionManager = EditorActionManager.getInstance();
|
||||
EditorActionHandler actionHandler = actionManager.getActionHandler(IdeActions.ACTION_EDITOR_SPLIT);
|
||||
|
||||
actionHandler.execute(getEditor(), null, DataManager.getInstance().getDataContext());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.codeInsight;
|
||||
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.openapi.actionSystem.IdeActions;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionManager;
|
||||
import com.intellij.testFramework.LightPlatformCodeInsightTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class XmlSplitLineActionTest extends LightPlatformCodeInsightTestCase {
|
||||
@Override
|
||||
protected @NotNull String getTestDataPath() {
|
||||
return XmlTestUtil.getXmlTestDataPath();
|
||||
}
|
||||
|
||||
public void testAtTheBeginOfLine() {
|
||||
String path = "/codeInsight/splitLineAction/";
|
||||
|
||||
configureByFile(path + "SCR506_before.html");
|
||||
performAction();
|
||||
checkResultByFile(path + "SCR506_after.html");
|
||||
}
|
||||
|
||||
private void performAction() {
|
||||
EditorActionManager actionManager = EditorActionManager.getInstance();
|
||||
EditorActionHandler actionHandler = actionManager.getActionHandler(IdeActions.ACTION_EDITOR_SPLIT);
|
||||
|
||||
actionHandler.execute(getEditor(), null, DataManager.getInstance().getDataContext());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<html:form action="/arquivo/associar">
|
||||
<caret>
|
||||
<html:hidden property="idAcao"/>
|
||||
<html:hidden property="possuiMensagem"/>
|
||||
</html:form>
|
||||
@@ -0,0 +1,4 @@
|
||||
<html:form action="/arquivo/associar">
|
||||
<caret><html:hidden property="idAcao"/>
|
||||
<html:hidden property="possuiMensagem"/>
|
||||
</html:form>
|
||||
Reference in New Issue
Block a user