use of org.sonar.plugins.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class WhiteSpaceAroundCheckTest method test.
@Test
public void test() throws Exception {
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/whiteSpaceAroundCheck.html"), new WhiteSpaceAroundCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("A whitespace is missing after the starting tag at column 4.").next().atLine(1).withMessage("Add a space at column 18.").next().atLine(3).withMessage("Add a space at column 18.").next().atLine(5).withMessage("A whitespace is missing after the starting tag at column 2.").next().atLine(7).withMessage("A whitespace is missing after the starting tag at column 3.").next().atLine(9).withMessage("A whitespace is missing after the starting tag at column 3.").next().atLine(11).withMessage("A whitespace is missing after the starting tag at column 3.").next().atLine(13).withMessage("A whitespace is missing after the starting tag at column 4.").next().atLine(13).withMessage("Add a space at column 18.");
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode 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";
HtmlSourceCode 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.html.visitor.HtmlSourceCode in project sonar-web by SonarSource.
the class DynamicJspIncludeCheckTest method test.
@Test
public void test() {
HtmlSourceCode 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.html.visitor.HtmlSourceCode 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 -->";
HtmlSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/HeaderCheck/CorrectHeader.html"), check);
checkMessagesVerifier.verify(sourceCode.getIssues());
}
use of org.sonar.plugins.html.visitor.HtmlSourceCode 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 -->";
HtmlSourceCode 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