use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class InternationalizationCheckTest method custom2.
@Test
public void custom2() {
InternationalizationCheck check = new InternationalizationCheck();
check.attributes = "";
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/InternationalizationCheck.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("Define this label in the resource bundle.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class MaxLineLengthCheckTest method test.
@Test
public void test() {
WebSourceCode file = TestHelper.scan(new File("src/test/resources/checks/MaxLineLengthCheck.html"), new MaxLineLengthCheck());
checkMessagesVerifier.verify(file.getIssues()).next().atLine(2).withMessage("Split this 121 characters long line (which is greater than 120 authorized).").next().atLine(3).withMessage("Split this 122 characters long line (which is greater than 120 authorized).");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class MaxLineLengthCheckTest method custom.
@Test
public void custom() {
MaxLineLengthCheck check = new MaxLineLengthCheck();
check.maxLength = 40;
WebSourceCode file = TestHelper.scan(new File("src/test/resources/checks/MaxLineLengthCheck.html"), check);
checkMessagesVerifier.verify(file.getIssues()).next().atLine(1).next().atLine(2).next().atLine(3).next().atLine(6).withMessage("Split this 41 characters long line (which is greater than 40 authorized).");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class UnclosedTagCheckTest method custom.
@Test
public void custom() {
UnclosedTagCheck check = new UnclosedTagCheck();
check.ignoreTags = "html,foo";
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/UnclosedTagCheck.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(4).withMessage("The tag \"li\" has no corresponding closing tag.").next().atLine(7).withMessage("The tag \"br\" has no corresponding closing tag.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class IllegalNamespaceCheckTest method custom.
@Test
public void custom() {
IllegalNamespaceCheck check = new IllegalNamespaceCheck();
check.namespaces = "foo,baz";
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/IllegalNamespaceCheck.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("Using \"baz\" namespace is not allowed.").next().atLine(1).withMessage("Using \"foo\" namespace is not allowed.").next().atLine(6).withMessage("Using \"foo\" namespace is not allowed.");
}
Aggregations