use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class DoctypePresenceCheckTest method multiple_html_tags.
@Test
public void multiple_html_tags() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/DoctypePresenceCheck/MultipleHtmlTags.html"), new DoctypePresenceCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1);
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class DoctypePresenceCheckTest method doctype_before_html.
@Test
public void doctype_before_html() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/DoctypePresenceCheck/DoctypeBeforeHtml.html"), new DoctypePresenceCheck());
checkMessagesVerifier.verify(sourceCode.getIssues());
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class FrameWithoutTitleCheckTest method test.
@Test
public void test() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/FrameWithoutTitleCheck.html"), new FrameWithoutTitleCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("Add a \"title\" attribute to this <iframe> tag.").next().atLine(2).withMessage("Add a \"title\" attribute to this <fRamE> tag.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class ImgWithoutAltCheckTest method detected.
@Test
public void detected() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/ImgWithoutAltCheck.html"), new ImgWithoutAltCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("Add an \"alt\" attribute to this image.").next().atLine(5);
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class ImgWithoutWidthOrHeightCheckTest method detected.
@Test
public void detected() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/ImgWithoutWidthOrHeightCheck.html"), new ImgWithoutWidthOrHeightCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("Add both a 'width' and a 'height' attribute to this image.").next().atLine(2).next().atLine(3).next().atLine(5);
}
Aggregations