use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class UnsupportedTagsInHtml5CheckTest method test.
@Test
public void test() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/UnsupportedTagsInHtml5Check.html"), new UnsupportedTagsInHtml5Check());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLocation(1, 0, 1, 9).withMessage("Remove this deprecated \"acronym\" element.").next().atLine(2).withMessage("Remove this deprecated \"applet\" element.").next().atLine(3).next().atLine(4).next().atLine(5).next().atLine(6).next().atLine(7).next().atLine(8).next().atLine(9).next().atLine(10).next().atLine(11).next().atLine(12).next().atLine(13).next().atLine(15).withMessage("Remove this deprecated \"sTrIkE\" element.");
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class WmodeIsWindowCheckTest method detected.
@Test
public void detected() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/WmodeIsWindowCheck.html"), new WmodeIsWindowCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(9).withMessage("Set the value of the 'wmode' parameter to 'window'.").next().atLine(14).next().atLine(19).next().atLine(58).next().atLine(64).next().atLine(90).next().atLine(106);
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class LinkWithTargetBlankCheckTest method detected.
@Test
public void detected() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/LinkWithTargetBlank.html"), new LinkWithTargetBlankCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLocation(1, 0, 1, 54).withMessage("Make sure not using rel=\"noopener\" is safe here.").next().atLine(2).next().atLine(7).next().atLine(9);
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class NonConsecutiveHeadingCheckTest method only_h1_tags.
@Test
public void only_h1_tags() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/NonConsecutiveHeadingCheck/OnlyH1Tags.html"), new NonConsecutiveHeadingCheck());
checkMessagesVerifier.verify(sourceCode.getIssues());
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class PageWithoutFaviconCheckTest method detected.
@Test
public void detected() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/PageWithoutFaviconCheck.html"), new PageWithoutFaviconCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(5).withMessage("Add a 'favicon' declaration in this 'header' tag.").next().atLine(34).next().atLine(40).next().atLine(52);
}
Aggregations