use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class IllegalTagLibsCheckTest method test.
@Test
public void test() {
WebSourceCode 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.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class LibraryDependencyCheckTest method illegal_fully_qualified_identifier.
@Test
public void illegal_fully_qualified_identifier() {
LibraryDependencyCheck check = new LibraryDependencyCheck();
check.libraries = "java.sql";
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/LibraryDependencyCheck/IllegalFullyQualifiedIdentifier.jsp"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("Remove the usage of this library which is not allowed.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class LibraryDependencyCheckTest method illegal_import.
@Test
public void illegal_import() throws FileNotFoundException {
LibraryDependencyCheck check = new LibraryDependencyCheck();
check.libraries = "java.sql";
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/LibraryDependencyCheck/IllegalImport.jsp"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(2).withMessage("Remove the usage of this library which is not allowed.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class LibraryDependencyCheckTest method html_page.
@Test
public void html_page() throws FileNotFoundException {
LibraryDependencyCheck check = new LibraryDependencyCheck();
check.libraries = "java.sql";
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/LibraryDependencyCheck/HtmlPage.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues());
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class HeaderCheckTest method misspelled_header.
@Test
public void misspelled_header() {
HeaderCheck check = new HeaderCheck();
check.headerFormat = "<!-- Copyright foo -->";
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/HeaderCheck/MisspelledHeader.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(null).withMessage("Add or update the header of this file.");
}
Aggregations