use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class PasswordAutocompleteCheckTest method test.
@Test
public void test() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/PasswordAutocompleteCheck.html"), new PasswordAutocompleteCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("Set the \"autocomplete\" attribute of this password input to \"off\".").next().atLine(2);
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class UnsupportedTagsInHtml5CheckTest method test.
@Test
public void test() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/UnsupportedTagsInHtml5Check.html"), new UnsupportedTagsInHtml5Check());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("Remove this deprecated \"acronym\" element.").next().atLine(2).withMessage("Remove this deprecated \"applet\" element.").next().atLine(3).next().atLine(4).next().atLine(5).next().atLine(6).next().atLine(7).next().atLine(8).next().atLine(9).next().atLine(10).next().atLine(11).next().atLine(12).next().atLine(13).next().atLine(15).withMessage("Remove this deprecated \"sTrIkE\" element.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode 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";
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/ChildElementIllegalCheck.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(2).withMessage("Remove this \"bar\" tag; it is not a legal child of \"foo\".");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class IllegalElementCheckTest method custom.
@Test
public void custom() {
IllegalElementCheck check = new IllegalElementCheck();
check.elements = "title,body";
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/IllegalElementCheck.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(3).withMessage("Remove this \"title\" element.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode 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";
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/ParentElementIllegalCheck.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(2).withMessage("The element 'bar' must not have a 'foo' parent.");
}
Aggregations