use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class MouseEventWithoutKeyboardEquivalentCheckTest method detected.
@Test
public void detected() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/MouseEventWithoutKeyboardEquivalentCheck.html"), new MouseEventWithoutKeyboardEquivalentCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("Add a 'onKeyPress' attribute to this <a> tag.").next().atLine(2).withMessage("Add a 'onFocus' attribute to this <A> tag.").next().atLine(3).withMessage("Add a 'onBlur' attribute to this <a> tag.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class NonConsecutiveHeadingCheckTest method only_h2_tags.
@Test
public void only_h2_tags() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/NonConsecutiveHeadingCheck/OnlyH2Tags.html"), new NonConsecutiveHeadingCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("Do not skip level H1.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class NonConsecutiveHeadingCheckTest method h5_with_h4.
@Test
public void h5_with_h4() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/NonConsecutiveHeadingCheck/H5WithH4.html"), new NonConsecutiveHeadingCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("Do not skip level H3.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class NonConsecutiveHeadingCheckTest method h2_with_h1.
@Test
public void h2_with_h1() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/NonConsecutiveHeadingCheck/H2WithH1.html"), new NonConsecutiveHeadingCheck());
checkMessagesVerifier.verify(sourceCode.getIssues());
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class NonConsecutiveHeadingCheckTest method no_heading_tags.
@Test
public void no_heading_tags() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/NonConsecutiveHeadingCheck/NoHeadingTags.html"), new NonConsecutiveHeadingCheck());
checkMessagesVerifier.verify(sourceCode.getIssues());
}
Aggregations