use of org.apache.commons.lang3.tuple.ImmutablePair in project Asqatasun by Asqatasun.
the class Rgaa32016Rule060501 method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
if (linksHandler.isEmpty()) {
testSolutionHandler.addTestSolution(TestSolution.NOT_APPLICABLE);
return;
}
if (emptyLinksHandler.isEmpty()) {
testSolutionHandler.addTestSolution(TestSolution.PASSED);
return;
}
ElementChecker ec = new ElementPresenceChecker(new ImmutablePair(TestSolution.FAILED, EMPTY_LINK_MSG), new ImmutablePair(TestSolution.PASSED, ""), HREF_ATTR);
ec.check(sspHandler, emptyLinksHandler, testSolutionHandler);
}
use of org.apache.commons.lang3.tuple.ImmutablePair in project Asqatasun by Asqatasun.
the class Rgaa32016Rule080901 method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
if (linkWithoutTarget.isEmpty() && fieldsetNotWithinForm.isEmpty()) {
sspHandler.getProcessRemarkService().addProcessRemark(TestSolution.NEED_MORE_INFO, RuleCheckHelper.specifyMessageToRule(NO_PATTERN_DETECTED_MSG, this.getTest().getCode()));
testSolutionHandler.addTestSolution(TestSolution.NEED_MORE_INFO);
return;
}
ElementChecker linkWithoutTargetChecker = new ElementPresenceChecker(new ImmutablePair(TestSolution.FAILED, LINK_WITHOUT_TARGET_MSG), new ImmutablePair(TestSolution.PASSED, ""));
linkWithoutTargetChecker.check(sspHandler, linkWithoutTarget, testSolutionHandler);
ElementChecker fieldsetNotWithinFormChecker = new ElementPresenceChecker(new ImmutablePair(TestSolution.NEED_MORE_INFO, FIELDSET_NOT_WITHIN_FORM_MSG), new ImmutablePair(TestSolution.PASSED, ""));
fieldsetNotWithinFormChecker.check(sspHandler, fieldsetNotWithinForm, testSolutionHandler);
}
use of org.apache.commons.lang3.tuple.ImmutablePair in project Asqatasun by Asqatasun.
the class Rgaa32016Rule100102 method check.
@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
// Attributes checks
for (Map.Entry<String, ElementHandler> attrElementHandlerMapEntry : attrElementHandlerMap.entrySet()) {
ElementChecker attrEc = new ElementWithAttributePresenceChecker(new ImmutablePair(TestSolution.FAILED, PRESENTATION_ATTR_DETECTED_MSG), new ImmutablePair(TestSolution.PASSED, ""), attrElementHandlerMapEntry.getKey());
attrEc.check(sspHandler, attrElementHandlerMapEntry.getValue(), testSolutionHandler);
}
}
use of org.apache.commons.lang3.tuple.ImmutablePair in project Asqatasun by Asqatasun.
the class Rgaa32016Rule010101Test method setProcess.
@Override
protected void setProcess() {
//----------------------------------------------------------------------
//------------------------------1Passed-01------------------------------
//----------------------------------------------------------------------
checkResultIsPassed(processPageTest("Rgaa32016.Test.1.1.1-1Passed-01"), 1);
//----------------------------------------------------------------------
//------------------------------2Failed-01------------------------------
//----------------------------------------------------------------------
ProcessResult processResult = processPageTest("Rgaa32016.Test.1.1.1-2Failed-01");
checkResultIsFailed(processResult, 1, 1);
checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.ALT_MISSING_MSG, HtmlElementStore.IMG_ELEMENT, 1, new ImmutablePair(SRC_ATTR, "mock-image-failed.jpg"));
//----------------------------------------------------------------------
//------------------------------2Failed-02------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa32016.Test.1.1.1-2Failed-02");
checkResultIsFailed(processResult, 2, 1);
checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.ALT_MISSING_MSG, HtmlElementStore.IMG_ELEMENT, 1, new ImmutablePair(SRC_ATTR, "mock-image-failed.jpg"));
//----------------------------------------------------------------------
//------------------------------2Failed-03------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa32016.Test.1.1.1-2Failed-03");
checkResultIsFailed(processResult, 2, 1);
checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.ALT_MISSING_MSG, HtmlElementStore.IMG_ELEMENT, 1, new ImmutablePair(SRC_ATTR, "mock-image-failed.jpg"));
//----------------------------------------------------------------------
//------------------------------4NA-01------------------------------
//----------------------------------------------------------------------
checkResultIsNotApplicable(processPageTest("Rgaa32016.Test.1.1.1-4NA-01"));
}
use of org.apache.commons.lang3.tuple.ImmutablePair in project Asqatasun by Asqatasun.
the class Rgaa32016Rule010102Test method setProcess.
@Override
protected void setProcess() {
//----------------------------------------------------------------------
//------------------------------1Passed-01------------------------------
//----------------------------------------------------------------------
checkResultIsPassed(processPageTest("Rgaa32016.Test.1.1.2-1Passed-01"), 2);
//----------------------------------------------------------------------
//------------------------------1Passed-02------------------------------
//----------------------------------------------------------------------
checkResultIsPassed(processPageTest("Rgaa32016.Test.1.1.2-1Passed-02"), 2);
//----------------------------------------------------------------------
//------------------------------1Passed-03------------------------------
//----------------------------------------------------------------------
checkResultIsPassed(processPageTest("Rgaa32016.Test.1.1.2-1Passed-03"), 2);
//----------------------------------------------------------------------
//------------------------------2Failed-01------------------------------
//----------------------------------------------------------------------
ProcessResult processResult = processPageTest("Rgaa32016.Test.1.1.2-2Failed-01");
checkResultIsFailed(processResult, 2, 2);
checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.ALT_MISSING_MSG, HtmlElementStore.AREA_ELEMENT, 1, new ImmutablePair(HREF_ATTR, ABSENT_ATTRIBUTE_VALUE));
checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.ALT_MISSING_MSG, HtmlElementStore.AREA_ELEMENT, 2, new ImmutablePair(HREF_ATTR, ABSENT_ATTRIBUTE_VALUE));
//----------------------------------------------------------------------
//------------------------------2Failed-02------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa32016.Test.1.1.2-2Failed-02");
checkResultIsFailed(processResult, 2, 2);
checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.ALT_MISSING_MSG, HtmlElementStore.AREA_ELEMENT, 1, new ImmutablePair(HREF_ATTR, ABSENT_ATTRIBUTE_VALUE));
checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.ALT_MISSING_MSG, HtmlElementStore.AREA_ELEMENT, 2, new ImmutablePair(HREF_ATTR, ABSENT_ATTRIBUTE_VALUE));
//----------------------------------------------------------------------
//------------------------------2Failed-03------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa32016.Test.1.1.2-2Failed-03");
checkResultIsFailed(processResult, 2, 1);
checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.ALT_MISSING_MSG, HtmlElementStore.AREA_ELEMENT, 1, new ImmutablePair(HREF_ATTR, "mock-area-link.html"));
//----------------------------------------------------------------------
//------------------------------4NA-01------------------------------
//----------------------------------------------------------------------
checkResultIsNotApplicable(processPageTest("Rgaa32016.Test.1.1.2-4NA-01"));
//----------------------------------------------------------------------
//------------------------------4NA-02------------------------------
//----------------------------------------------------------------------
checkResultIsNotApplicable(processPageTest("Rgaa32016.Test.1.1.2-4NA-02"));
}
Aggregations