mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Move GenerateDTDTest to xml-tests module
GitOrigin-RevId: 7ba550eea6688d2b3a88ca30c92a10a4e81a5ab2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5bceae86a4
commit
3c25cb2d28
@@ -0,0 +1,35 @@
|
||||
// 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.ActionManager;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.testFramework.LightPlatformCodeInsightTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class GenerateDTDTest extends LightPlatformCodeInsightTestCase {
|
||||
@Override
|
||||
protected @NotNull String getTestDataPath() {
|
||||
return XmlTestUtil.getXmlTestDataPath();
|
||||
}
|
||||
|
||||
public void test() {
|
||||
String basePath = "/codeInsight/generateDTD/";
|
||||
|
||||
configureByFile(basePath + "before1.xml");
|
||||
performAction();
|
||||
checkResultByFile(basePath + "after1.xml");
|
||||
|
||||
configureByFile(basePath + "before2.xml");
|
||||
performAction();
|
||||
checkResultByFile(basePath + "after2.xml");
|
||||
}
|
||||
|
||||
private void performAction() {
|
||||
ActionManager actionManager = ActionManager.getInstance();
|
||||
AnAction action = actionManager.getAction("GenerateDTD");
|
||||
|
||||
action.actionPerformed(AnActionEvent.createFromAnAction(action, null, "", DataManager.getInstance().getDataContext()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE div [
|
||||
<!ELEMENT div (div)*>
|
||||
<!ATTLIST div
|
||||
id CDATA #IMPLIED
|
||||
ref CDATA #IMPLIED>
|
||||
]>
|
||||
<div>
|
||||
<div id="a"/>
|
||||
<div ref="a"/>
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE GOMiner [
|
||||
<!ELEMENT GOMiner (term)*>
|
||||
<!ELEMENT term (goid|term)*>
|
||||
<!ATTLIST term
|
||||
cuid CDATA #REQUIRED>
|
||||
<!ELEMENT goid (#PCDATA)>
|
||||
]>
|
||||
<GOMiner>
|
||||
<term cuid="t1234">
|
||||
<goid>0005275</goid>
|
||||
<term cuid="t1234">
|
||||
<goid>0005276</goid>
|
||||
</term>
|
||||
<term cuid="t1234">
|
||||
<goid>0005277</goid>
|
||||
</term>
|
||||
<term cuid="t1234">
|
||||
<goid>0005329</goid>
|
||||
</term>
|
||||
</term>
|
||||
</GOMiner>
|
||||
@@ -0,0 +1,4 @@
|
||||
<div>
|
||||
<div id="a"/>
|
||||
<div ref="a"/>
|
||||
</div>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<GOMiner>
|
||||
<term cuid="t1234">
|
||||
<goid>0005275</goid>
|
||||
<term cuid="t1234">
|
||||
<goid>0005276</goid>
|
||||
</term>
|
||||
<term cuid="t1234">
|
||||
<goid>0005277</goid>
|
||||
</term>
|
||||
<term cuid="t1234">
|
||||
<goid>0005329</goid>
|
||||
</term>
|
||||
</term>
|
||||
</GOMiner>
|
||||
Reference in New Issue
Block a user