use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class LibraryDependencyCheckTest method legal_fully_qualified_identifier_and_import.
@Test
public void legal_fully_qualified_identifier_and_import() throws FileNotFoundException {
LibraryDependencyCheck check = new LibraryDependencyCheck();
check.libraries = "java.sql";
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/LibraryDependencyCheck/LegalFullyQualifiedIdentifierAndImport.jsp"), check);
checkMessagesVerifier.verify(sourceCode.getIssues());
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class IllegalTagLibsCheckTest method test.
@Test
public void test() {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/illegalTagLibsCheck.jsp"), new IllegalTagLibsCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(2).withMessage("Remove the use of \"http://java.sun.com/jstl/sql\".").next().atLine(3).next().atLine(5);
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class HeaderCheckTest method regex1.
@Test
public void regex1() {
HeaderCheck check = new HeaderCheck();
check.headerFormat = "<!-- copyright \\d{4}\\n mycompany -->";
check.isRegularExpression = true;
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/HeaderCheck/Regex1.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).noMore();
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class HeaderCheckTest method missing_header.
@Test
public void missing_header() {
HeaderCheck check = new HeaderCheck();
check.headerFormat = "<!-- Copyright foo -->";
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/HeaderCheck/MissingHeader.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(null).withMessage("Add or update the header of this file.");
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class HeaderCheckTest method regex2.
@Test
public void regex2() {
HeaderCheck check = new HeaderCheck();
check.headerFormat = "<!-- copyright \\d{4}\\n mycompany -->";
check.isRegularExpression = true;
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/HeaderCheck/Regex2.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(null).withMessage("Add or update the header of this file.");
}
Aggregations