use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class InputWithoutLabelCheckTest method detected.
@Test
public void detected() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/InputWithoutLabelCheck.html"), new InputWithoutLabelCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(6).withMessage("Associate a valid label to this input field.").next().atLine(19).next().atLine(23).withMessage("Add an \"id\" attribute to this input field and associate it with a label.").next().atLine(25).withMessage("Add an \"id\" attribute to this input field and associate it with a label.").next().atLine(26).withMessage("Add an \"id\" attribute to this input field and associate it with a label.").next().atLine(28).withMessage("Associate a valid label to this input field.").next().atLine(32);
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class ItemTagNotWithinContainerTagCheckTest method detected.
@Test
public void detected() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/ItemTagNotWithinContainerTagCheck.html"), new ItemTagNotWithinContainerTagCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(1).withMessage("Surround this <li> item tag by a <ul> or <ol> container one.").next().atLine(4).withMessage("Surround this <DT> item tag by a <dl> container one.").next().atLine(8).withMessage("Surround this <lI> item tag by a <ul> or <ol> container one.").next().atLine(18);
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class LinkToImageCheckTest method test.
@Test
public void test() {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/LinkToImageCheck.html"), new LinkToImageCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(3).withMessage("Change this link to not directly target an image.").next().atLine(4).next().atLine(5).next().atLine(6).next().atLine(7).next().atLine(8);
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class LinkToNothingCheckTest method detected.
@Test
public void detected() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/LinkToNothingCheck.html"), new LinkToNothingCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(3).withMessage("Give this link a valid reference or remove the reference.").next().atLine(4).next().atLine(5).next().atLine(6);
}
use of org.sonar.plugins.web.visitor.WebSourceCode in project sonar-web by SonarSource.
the class LinksIdenticalTextsDifferentTargetsCheckTest method detected.
@Test
public void detected() throws Exception {
WebSourceCode sourceCode = TestHelper.scan(new File("src/test/resources/checks/LinksIdenticalTextsDifferentTargetsCheck.html"), new LinksIdenticalTextsDifferentTargetsCheck());
checkMessagesVerifier.verify(sourceCode.getIssues()).next().atLine(5).next().atLine(8).next().atLine(11).next().atLine(15);
}
Aggregations