use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class DynamicJspIncludeCheckTest method test.
@Test
public void test() {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/DynamicJspIncludeCheck.jsp"), new DynamicJspIncludeCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(2).withMessage("Use an include action instead of an include directive.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode 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";
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/LibraryDependencyCheck/LegalFullyQualifiedIdentifierAndImport.jsp"), check);
checkMessagesVerifier.verify(sourceCode.getIssues());
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class LibraryDependencyCheckTest method illegal_fully_qualified_identifier_with_custom_message.
@Test
public void illegal_fully_qualified_identifier_with_custom_message() {
LibraryDependencyCheck check = new LibraryDependencyCheck();
check.libraries = "java.sql";
check.message = "Foo.";
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/LibraryDependencyCheck/IllegalFullyQualifiedIdentifier.jsp"), check);
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("Foo.");
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class HeaderCheckTest method correct_header.
@Test
public void correct_header() {
HeaderCheck check = new HeaderCheck();
check.headerFormat = "<!-- Copyright foo -->";
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/HeaderCheck/CorrectHeader.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues());
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class MultiplePageDirectivesCheckTest method test1.
@Test
public void test1() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/multiplePageDirectivesCheck1.html"), new MultiplePageDirectivesCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(3).withMessage("Combine these 2 page directives into one.");
}
Aggregations