use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class MultiplePageDirectivesCheckTest method test3.
@Test
public void test3() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/multiplePageDirectivesCheck3.html"), new MultiplePageDirectivesCheck());
assertThat(sourceCode.getIssues()).isEmpty();
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class AbsoluteURICheckTest method custom.
@Test
public void custom() {
AbsoluteURICheck check = new AbsoluteURICheck();
check.attributes = "img.src";
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/absoluteURICheck.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(7).withMessage("Replace this absolute URI \"src\" with a relative one, or move this absolute URI to a configuration file.").next().atLine(8).withMessage("Replace this absolute URI \"src\" with a relative one, or move this absolute URI to a configuration file.").next().atLine(9).withMessage("Replace this absolute URI \"src\" with a relative one, or move this absolute URI to a configuration file.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class BoldAndItalicTagsCheckTest method detected.
@Test
public void detected() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/BoldAndItalicTagsCheck.html"), new BoldAndItalicTagsCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("Replace this <b> tag by <strong>.").next().atLine(5).withMessage("Replace this <i> tag by <em>.").next().atLine(7).withMessage("Replace this <B> tag by <strong>.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class DeprecatedAttributesInHtml5CheckTest method test.
@Test
public void test() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/deprecatedAttributesInHtml5.html"), new DeprecatedAttributesInHtml5Check());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(3).withMessage("Remove this deprecated \"CHARSET\" attribute.").next().atLine(3).withMessage("Remove this deprecated \"COORDS\" attribute.").next().atLine(3).withMessage("Remove this deprecated \"NAME\" attribute.").next().atLine(3).withMessage("Remove this deprecated \"SHAPE\" attribute.").next().atLine(6).withMessage("Remove this deprecated \"bordercolor\" attribute.").next().atLine(15).withMessage("Remove this deprecated \"code\" attribute.").next().atLine(18).withMessage("Remove this deprecated \"border\" attribute.").next().atLine(20).withMessage("Remove this deprecated \"name\" attribute.").next().atLine(22).withMessage("Remove this deprecated \"name\" attribute.").next().atLine(25).withMessage("Remove this deprecated \"align\" attribute.").next().atLine(27).withMessage("Remove this deprecated \"language\" attribute.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class DoctypePresenceCheckTest method no_doctype_before_foo.
@Test
public void no_doctype_before_foo() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/DoctypePresenceCheck/NoDoctypeBeforeFoo.html"), new DoctypePresenceCheck());
checkMessagesVerifier.verify(sourceCode.getIssues());
}
Aggregations