mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
[java-inspections] JavadocLinkAsPlainText: add a test
IDEA-293227 IJ-CR-24086 GitOrigin-RevId: e374eddf444db934b4f1175ce5d6069e1695df1c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a66dea2997
commit
b6ee62c91f
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Blah IDEA-293227 blah IDEA-292503. Blah blah blah IDEA-292503 blah IDEA-292503
|
||||
*/
|
||||
class A { }
|
||||
+23
-5
@@ -4,20 +4,25 @@ package com.intellij.java.codeInspection;
|
||||
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
|
||||
import com.intellij.codeInspection.LocalInspectionTool;
|
||||
import com.intellij.codeInspection.javaDoc.JavadocLinkAsPlainTextInspection;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import com.intellij.openapi.vcs.IssueNavigationConfiguration;
|
||||
import com.intellij.openapi.vcs.IssueNavigationLink;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class JavadocLinkAsPlainTextInspectionTest extends LightDaemonAnalyzerTestCase {
|
||||
@NonNls static final String BASE_PATH = "/inspection/javadocLinkAsPlainText/";
|
||||
|
||||
|
||||
@Override
|
||||
protected LocalInspectionTool @NotNull [] configureLocalInspectionTools() {
|
||||
return new LocalInspectionTool[]{new JavadocLinkAsPlainTextInspection()};
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getFilePath() {
|
||||
return "/inspection/javadocLinkAsPlainText/" + getTestName(false) + ".java";
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(BASE_PATH + "/" + getTestName(false) + ".java", true, false);
|
||||
doTest(getFilePath(), true, false);
|
||||
}
|
||||
|
||||
public void testLeadingAsterisks() {
|
||||
@@ -27,4 +32,17 @@ public class JavadocLinkAsPlainTextInspectionTest extends LightDaemonAnalyzerTes
|
||||
public void testNoLeadingAsterisks() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIssueLinksInJavaDoc() {
|
||||
IssueNavigationConfiguration configuration = IssueNavigationConfiguration.getInstance(getProject());
|
||||
List<IssueNavigationLink> oldLinks = configuration.getLinks();
|
||||
try {
|
||||
configuration.setLinks(List.of(new IssueNavigationLink("IDEA-\\d+", "https://youtrack.jetbrains.com/issue/$0")));
|
||||
configureByFile(getFilePath());
|
||||
doTestConfiguredFile(true, false, null);
|
||||
}
|
||||
finally {
|
||||
configuration.setLinks(oldLinks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user