use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class InternationalizationCheckTest method should_not_raise_issue_with_bom.
@Test
public void should_not_raise_issue_with_bom() {
InternationalizationCheck check = new InternationalizationCheck();
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/InternationalizationCheck_UTF8.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).noMore();
sourceCode = TestHelper.scan(new File("src/test/resources/checks/InternationalizationCheck_UTF8WithBom.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).noMore();
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class UnclosedTagCheckTest method detected.
@Test
public void detected() {
UnclosedTagCheck check = new UnclosedTagCheck();
assertThat(check.ignoreTags).isEqualTo("HTML,HEAD,BODY,P,DT,DD,LI,OPTION,THEAD,TH,TBODY,TR,TD,TFOOT,COLGROUP,IMG,INPUT,BR,HR,FRAME,AREA,BASE,BASEFONT,COL,ISINDEX,LINK,META,PARAM");
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/UnclosedTagCheck/UnclosedTagCheck.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLocation(10, 0, 10, 5).withMessage("The tag \"foo\" has no corresponding closing tag.").noMore();
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class AvoidHtmlCommentCheckTest method should_not_detect_on_html_documents.
@Test
public void should_not_detect_on_html_documents() {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/AvoidHtmlCommentCheck/document.html"), new AvoidHtmlCommentCheck());
checkMessagesVerifier.verify(sourceCode.getIssues());
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class AvoidHtmlCommentCheckTest method should_not_detect_on_html5_documents.
@Test
public void should_not_detect_on_html5_documents() {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/AvoidHtmlCommentCheck/documenthtml5.html"), new AvoidHtmlCommentCheck());
checkMessagesVerifier.verify(sourceCode.getIssues());
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class AvoidHtmlCommentCheckTest method should_detect_on_jsp_documents.
@Test
public void should_detect_on_jsp_documents() {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/AvoidHtmlCommentCheck/document.jsp"), new AvoidHtmlCommentCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(2).withMessage("Make sure that the HTML comment does not contain sensitive information.").next().atLine(4);
}
Aggregations