use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class FileLengthCheckTest method custom_ok.
@Test
public void custom_ok() {
FileLengthCheck check = new FileLengthCheck();
check.maxLength = 5;
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/FileLengthCheck.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues());
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class InternationalizationCheckTest method custom.
@Test
public void custom() {
InternationalizationCheck check = new InternationalizationCheck();
check.attributes = "outputLabel.value";
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.").next().atLine(2).withMessage("Define this label in the resource bundle.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class AvoidCommentedOutCodeCheckTest method detected.
@Test
public void detected() {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/AvoidCommentedOutCodeCheck.html"), new AvoidCommentedOutCodeCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(3).withMessage("Remove this commented out code.").next().atLine(9).next().atLine(11);
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class AvoidHtmlCommentCheckTest method should_detect_on_jsp_documents.
@Test
public void should_detect_on_jsp_documents() {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/AvoidHtmlCommentCheck/document.jsp"), new AvoidHtmlCommentCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(2).withMessage("Remove this comment or change its style so that it is not output to the client.").next().atLine(4);
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class AvoidHtmlCommentCheckTest method should_detect_on_erb_documents.
@Test
public void should_detect_on_erb_documents() {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/AvoidHtmlCommentCheck/document.html.erb"), new AvoidHtmlCommentCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(6).withMessage("Remove this comment or change its style so that it is not output to the client.");
}
Aggregations