use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class PageWithoutTitleCheckTest method detected.
@Test
public void detected() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/PageWithoutTitleCheck.html"), new PageWithoutTitleCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("Add a <title> tag to this page.").next().atLine(5).next().atLine(15).next().atLine(21).next().atLine(25).next().atLine(31).next().atLine(37);
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class TableHeaderHasIdOrScopeCheckTest method detected.
@Test
public void detected() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/TableHeaderHasIdOrScopeCheck.html"), new TableHeaderHasIdOrScopeCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLocation(41, 8, 41, 12).withMessage("Add either an 'id' or a 'scope' attribute to this <th> tag.").next().atLine(42).withMessage("Add either an 'id' or a 'scope' attribute to this <th> tag.").next().atLine(70).next().atLine(76).next().atLine(101).next().atLine(102).next().atLine(103).next().atLine(106).next().atLine(111).next().atLine(140).next().atLine(141).next().atLine(144).next().atLine(149).next().atLine(177).next().atLine(178).next().atLine(186).next().atLine(209).next().atLine(210).next().atLine(214).next().atLine(238).next().atLine(239).next().atLine(275).next().atLine(285).next().atLine(320).next().atLine(327).next().atLine(334).next().atLine(380).next().atLine(387).next().atLine(387).next().atLine(392).next().atLine(393).next().atLine(408).next().atLine(415).next().atLine(415).next().atLine(420).next().atLine(421).next().atLine(494).next().atLine(495).next().atLine(506).next().atLine(507).next().atLine(519).next().atLine(520).next().atLine(570).next().atLine(574).next().atLine(605).next().atLine(617).next().atLine(621).next().atLine(623);
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class TableWithoutCaptionCheckTest method detected.
@Test
public void detected() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/TableWithoutCaptionCheck.html"), new TableWithoutCaptionCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLocation(1, 0, 1, 7).withMessage("Add a description to this table.").next().atLine(8).next().atLine(32).next().atLine(39).next().atLine(47).next().atLine(53).next().atLine(61).next().atLine(65).next().atLine(66).next().atLine(78).next().atLine(89).next().atLine(95);
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class UnifiedExpressionCheckTest method should_not_detect_unknown_functions_with_empty_list.
@Test
public void should_not_detect_unknown_functions_with_empty_list() {
UnifiedExpressionCheck check = new UnifiedExpressionCheck();
check.functions = "";
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/UnifiedExpressionCheck.jsp"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(5);
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class ElementWithGivenIdPresentCheckTest method custom_ok.
@Test
public void custom_ok() throws Exception {
ElementWithGivenIdPresentCheck check = new ElementWithGivenIdPresentCheck();
check.id = "gotit";
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/ElementWithGivenIdPresentCheck/Ok.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues());
}
Aggregations