use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class ImgWithoutWidthOrHeightCheckTest method detected.
@Test
public void detected() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/ImgWithoutWidthOrHeightCheck.html"), new ImgWithoutWidthOrHeightCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLocation(1, 0, 1, 7).withMessage("Add both a 'width' and a 'height' attribute to this image.").next().atLine(2).next().atLine(3).next().atLine(4).next().atLine(8).next().atLine(10);
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class MultiplePageDirectivesCheckTest method test1.
@Test
public void test1() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/multiplePageDirectivesCheck1.html"), new MultiplePageDirectivesCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(3).withMessage("Combine these 2 page directives into one.");
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class MultiplePageDirectivesCheckTest method test2.
@Test
public void test2() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/multiplePageDirectivesCheck2.html"), new MultiplePageDirectivesCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(3).withMessage("Combine these 2 page directives into one.");
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class LinkToImageCheckTest method test.
@Test
public void test() {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/LinkToImageCheck.html"), new LinkToImageCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLocation(3, 0, 3, 18).withMessage("Change this link to not directly target an image.").next().atLine(4).next().atLine(5).next().atLine(6).next().atLine(7).next().atLine(8);
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class LinkToNothingCheckTest method detected.
@Test
public void detected() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/LinkToNothingCheck.html"), new LinkToNothingCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLocation(3, 0, 3, 12).withMessage("Give this link a valid reference or remove the reference.").next().atLine(4).next().atLine(5).next().atLine(6);
}
Aggregations