use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class VideoTrackCheckTest method detected.
@Test
public void detected() {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/VideoTrackCheck.html"), new VideoTrackCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLocation(28, 2, 28, 27).withMessage("Add subtitles and description files for this video.").next().atLine(33).next().atLine(38).next().atLine(43).next().atLine(49);
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class ChildElementIllegalCheckTest method custom.
@Test
public void custom() {
ChildElementIllegalCheck check = new ChildElementIllegalCheck();
check.child = "bar";
check.parent = "foo";
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/ChildElementIllegalCheck.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLocation(2, 2, 2, 7).withMessage("Remove this \"bar\" tag; it is not a legal child of \"foo\".");
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class IllegalElementCheckTest method custom.
@Test
public void custom() {
IllegalElementCheck check = new IllegalElementCheck();
check.elements = "title,body";
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/IllegalElementCheck.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLocation(3, 2, 3, 9).withMessage("Remove this \"title\" element.");
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class ParentElementRequiredCheckTest method custom.
@Test
public void custom() {
ParentElementRequiredCheck check = new ParentElementRequiredCheck();
check.child = "bar";
check.parent = "foo";
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/ParentElementRequiredCheck.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLocation(6, 0, 6, 5).withMessage("Add the missing \"foo\" parent element for \"bar\" element.").next().atLine(17);
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class ParentElementIllegalCheckTest method custom.
@Test
public void custom() {
ParentElementIllegalCheck check = new ParentElementIllegalCheck();
check.child = "bar";
check.parent = "foo";
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/ParentElementIllegalCheck.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLocation(2, 2, 2, 7).withMessage("The element 'bar' must not have a 'foo' parent.");
}
Aggregations