Search in sources :

Example 31 with ImmutablePair

use of org.apache.commons.lang3.tuple.ImmutablePair in project Asqatasun by Asqatasun.

the class Rgaa32016Rule080701Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //---------------------------1Passed-01---------------------------------
    //----------------------------------------------------------------------
    checkResultIsPassed(processPageTest("Rgaa32016.Test.08.07.01-1Passed-01"), 6);
    //----------------------------------------------------------------------
    //---------------------------1Passed-02---------------------------------
    //----------------------------------------------------------------------
    checkResultIsPassed(processPageTest("Rgaa32016.Test.08.07.01-1Passed-02"), 6);
    //----------------------------------------------------------------------
    //---------------------------1Passed-03---------------------------------
    //----------------------------------------------------------------------
    checkResultIsPassed(processPageTest("Rgaa32016.Test.08.07.01-1Passed-03"), 6);
    //----------------------------------------------------------------------
    //---------------------------1Passed-04---------------------------------
    //----------------------------------------------------------------------
    checkResultIsPassed(processPageTest("Rgaa32016.Test.08.07.01-1Passed-04"), 6);
    //----------------------------------------------------------------------
    //---------------------------1Passed-05---------------------------------
    //----------------------------------------------------------------------
    checkResultIsPassed(processPageTest("Rgaa32016.Test.08.07.01-1Passed-05"), 6);
    //----------------------------------------------------------------------
    //---------------------------2Failed-01---------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("Rgaa32016.Test.08.07.01-2Failed-01");
    checkResultIsFailed(processResult, 10, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.LANGUAGE_CHANGE_MISSING_MSG, HtmlElementStore.P_ELEMENT, 1, new ImmutablePair(EvidenceStore.LANGUAGE_EE, "en"), new ImmutablePair(EvidenceStore.DETECTED_LANGUAGE_EE, "fr"), new ImmutablePair(EvidenceStore.EXTRACTED_TEXT_EE, "L'accessibilité du web est la problématique de l'accès aux"));
    //----------------------------------------------------------------------
    //---------------------------2Failed-02---------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.08.07.01-2Failed-02");
    checkResultIsFailed(processResult, 10, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.LANGUAGE_CHANGE_MISSING_MSG, HtmlElementStore.P_ELEMENT, 1, new ImmutablePair(EvidenceStore.DEFAULT_LANGUAGE_EE, "en"), new ImmutablePair(EvidenceStore.CURRENT_LANGUAGE_EE, "fr"), new ImmutablePair(EvidenceStore.DETECTED_LANGUAGE_EE, "en"), new ImmutablePair(EvidenceStore.EXTRACTED_TEXT_EE, "Web accessibility refers to the inclusive practice of making"));
    //----------------------------------------------------------------------
    //---------------------------2Failed-03---------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.08.07.01-2Failed-03");
    checkResultIsFailed(processResult, 10, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.LANGUAGE_CHANGE_MISSING_MSG, HtmlElementStore.SPAN_ELEMENT, 1, new ImmutablePair(EvidenceStore.DEFAULT_LANGUAGE_EE, "en"), new ImmutablePair(EvidenceStore.CURRENT_LANGUAGE_EE, "fr"), new ImmutablePair(EvidenceStore.DETECTED_LANGUAGE_EE, "en"), new ImmutablePair(EvidenceStore.EXTRACTED_TEXT_EE, "Web accessibility refers to the inclusive practice of making"));
    //----------------------------------------------------------------------
    //---------------------------2Failed-04---------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.08.07.01-2Failed-04");
    checkResultIsFailed(processResult, 10, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.LANGUAGE_CHANGE_MISSING_MSG, HtmlElementStore.P_ELEMENT, 1, new ImmutablePair(EvidenceStore.DEFAULT_LANGUAGE_EE, "en"), new ImmutablePair(EvidenceStore.CURRENT_LANGUAGE_EE, "dummy"), new ImmutablePair(EvidenceStore.DETECTED_LANGUAGE_EE, "en"), new ImmutablePair(EvidenceStore.EXTRACTED_TEXT_EE, "Web accessibility refers to the inclusive practice of making"));
    //----------------------------------------------------------------------
    //---------------------------2Failed-05---------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.08.07.01-2Failed-05");
    checkResultIsFailed(processResult, 10, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.LANGUAGE_CHANGE_MISSING_MSG, HtmlElementStore.P_ELEMENT, 1, new ImmutablePair(EvidenceStore.DEFAULT_LANGUAGE_EE, "en"), new ImmutablePair(EvidenceStore.CURRENT_LANGUAGE_EE, "dummy"), new ImmutablePair(EvidenceStore.DETECTED_LANGUAGE_EE, "en"), new ImmutablePair(EvidenceStore.EXTRACTED_TEXT_EE, "Web accessibility refers to the inclusive practice of making"));
    //----------------------------------------------------------------------
    //---------------------------2Failed-06---------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.08.07.01-2Failed-06");
    checkResultIsFailed(processResult, 10, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.LANGUAGE_CHANGE_MISSING_MSG, HtmlElementStore.P_ELEMENT, 1, new ImmutablePair(EvidenceStore.DEFAULT_LANGUAGE_EE, "en"), new ImmutablePair(EvidenceStore.CURRENT_LANGUAGE_EE, "dummy"), new ImmutablePair(EvidenceStore.DETECTED_LANGUAGE_EE, "en"), new ImmutablePair(EvidenceStore.EXTRACTED_TEXT_EE, "Web accessibility refers to the inclusive practice of making"));
    //----------------------------------------------------------------------
    //---------------------------2Failed-07---------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.08.07.01-2Failed-07");
    checkResultIsFailed(processResult, 10, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.LANGUAGE_CHANGE_MISSING_MSG, HtmlElementStore.SPAN_ELEMENT, 1, new ImmutablePair(EvidenceStore.DEFAULT_LANGUAGE_EE, "en"), new ImmutablePair(EvidenceStore.CURRENT_LANGUAGE_EE, "dummy"), new ImmutablePair(EvidenceStore.DETECTED_LANGUAGE_EE, "en"), new ImmutablePair(EvidenceStore.EXTRACTED_TEXT_EE, "Web accessibility refers to the inclusive practice of making"));
    //----------------------------------------------------------------------
    //---------------------------3NMI-01------------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.08.07.01-3NMI-01");
    checkResultIsPreQualified(processResult, 10, 1);
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_SHORT_TEST_MSG, "", 1);
    //----------------------------------------------------------------------
    //---------------------------3NMI-02------------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.08.07.01-3NMI-02");
    checkResultIsPreQualified(processResult, 9, 1);
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_SHORT_TEST_MSG, "", 1);
    //----------------------------------------------------------------------
    //---------------------------3NMI-03------------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.08.07.01-3NMI-03");
    checkResultIsPreQualified(processResult, 9, 1);
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_SHORT_TEST_MSG, "", 1);
    //----------------------------------------------------------------------
    //---------------------------3NMI-04------------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.08.07.01-3NMI-04");
    checkResultIsPreQualified(processResult, 9, 1);
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_SHORT_TEST_MSG, "", 1);
    //----------------------------------------------------------------------
    //---------------------------4NA-01-------------------------------------
    //----------------------------------------------------------------------
    checkResultIsNotApplicable(processPageTest("Rgaa32016.Test.08.07.01-4NA-01"));
    //----------------------------------------------------------------------
    //---------------------------4NA-02-------------------------------------
    //----------------------------------------------------------------------
    checkResultIsNotApplicable(processPageTest("Rgaa32016.Test.08.07.01-4NA-02"));
    //----------------------------------------------------------------------
    //---------------------------4NA-03-------------------------------------
    //----------------------------------------------------------------------
    checkResultIsNotApplicable(processPageTest("Rgaa32016.Test.08.07.01-4NA-03"), 7);
    //----------------------------------------------------------------------
    //---------------------------4NA-04-------------------------------------
    //----------------------------------------------------------------------
    checkResultIsNotApplicable(processPageTest("Rgaa32016.Test.08.07.01-4NA-04"), 7);
}
Also used : ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair)

Example 32 with ImmutablePair

use of org.apache.commons.lang3.tuple.ImmutablePair in project Asqatasun by Asqatasun.

the class Rgaa32016Rule080801Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //---------------------------1Passed-01---------------------------------
    //----------------------------------------------------------------------
    checkResultIsPassed(processPageTest("Rgaa32016.Test.08.08.01-1Passed-01"), 4);
    //----------------------------------------------------------------------
    //---------------------------1Passed-02---------------------------------
    //----------------------------------------------------------------------
    checkResultIsPassed(processPageTest("Rgaa32016.Test.08.08.01-1Passed-02"), 4);
    //----------------------------------------------------------------------
    //---------------------------1Passed-03---------------------------------
    //----------------------------------------------------------------------
    checkResultIsPassed(processPageTest("Rgaa32016.Test.08.08.01-1Passed-03"), 4);
    //----------------------------------------------------------------------
    //---------------------------1Passed-04---------------------------------
    //----------------------------------------------------------------------
    checkResultIsPassed(processPageTest("Rgaa32016.Test.08.08.01-1Passed-04"), 4);
    //----------------------------------------------------------------------
    //------------------------------2Failed-01------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("Rgaa32016.Test.08.08.01-2Failed-01");
    checkResultIsFailed(processResult, 4, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.MALFORMED_LANGUAGE_DECLARATION_MSG, HtmlElementStore.DIV_ELEMENT, 1, new ImmutablePair(EvidenceStore.LANGUAGE_EE, "fren-FR"));
    //----------------------------------------------------------------------
    //------------------------------2Failed-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.08.08.01-2Failed-02");
    checkResultIsFailed(processResult, 4, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.WRONG_LANGUAGE_DECLARATION_MSG, HtmlElementStore.DIV_ELEMENT, 1, new ImmutablePair(EvidenceStore.LANGUAGE_EE, "aq"));
    //----------------------------------------------------------------------
    //------------------------------2Failed-03------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.08.08.01-2Failed-03");
    checkResultIsFailed(processResult, 4, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.MALFORMED_LANGUAGE_DECLARATION_MSG, HtmlElementStore.DIV_ELEMENT, 1, new ImmutablePair(EvidenceStore.LANGUAGE_EE, "french"));
    //----------------------------------------------------------------------
    //------------------------------2Failed-04------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.08.08.01-2Failed-04");
    checkResultIsFailed(processResult, 4, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.MALFORMED_LANGUAGE_DECLARATION_MSG, HtmlElementStore.DIV_ELEMENT, 1, new ImmutablePair(EvidenceStore.LANGUAGE_EE, "fr-F"));
    //----------------------------------------------------------------------
    //------------------------------2Failed-05------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.08.08.01-2Failed-05");
    checkResultIsFailed(processResult, 4, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.MALFORMED_LANGUAGE_DECLARATION_MSG, HtmlElementStore.DIV_ELEMENT, 1, new ImmutablePair(EvidenceStore.LANGUAGE_EE, "fr/FR"));
    //----------------------------------------------------------------------
    //------------------------------4NA-01----------------------------------
    //----------------------------------------------------------------------
    checkResultIsNotApplicable(processPageTest("Rgaa32016.Test.08.08.01-4NA-01"));
    //----------------------------------------------------------------------
    //------------------------------4NA-02----------------------------------
    //----------------------------------------------------------------------
    checkResultIsNotApplicable(processPageTest("Rgaa32016.Test.08.08.01-4NA-02"));
}
Also used : ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair)

Example 33 with ImmutablePair

use of org.apache.commons.lang3.tuple.ImmutablePair in project Asqatasun by Asqatasun.

the class Rgaa32016Rule100102Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------1Passed-01------------------------------
    //----------------------------------------------------------------------
    checkResultIsPassed(processPageTest("Rgaa32016.Test.10.01.02-1Passed-01"), 12);
    //----------------------------------------------------------------------
    //------------------------------1Passed-02------------------------------
    //----------------------------------------------------------------------
    checkResultIsPassed(processPageTest("Rgaa32016.Test.10.01.02-1Passed-02"), 13);
    //----------------------------------------------------------------------
    //------------------------------1Passed-03------------------------------
    //----------------------------------------------------------------------
    checkResultIsPassed(processPageTest("Rgaa32016.Test.10.01.02-1Passed-03"), 13);
    //----------------------------------------------------------------------
    //------------------------------1Passed-04------------------------------
    //----------------------------------------------------------------------
    checkResultIsPassed(processPageTest("Rgaa32016.Test.10.01.02-1Passed-04"), 18);
    //----------------------------------------------------------------------
    //------------------------------1Passed-05------------------------------
    //----------------------------------------------------------------------
    checkResultIsPassed(processPageTest("Rgaa32016.Test.10.01.02-1Passed-05"), 15);
    //----------------------------------------------------------------------
    //------------------------------2Failed-01------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("Rgaa32016.Test.10.01.02-2Failed-01");
    checkResultIsFailed(processResult, 12, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, "PresentationAttrFound", HtmlElementStore.H1_ELEMENT, 1, new ImmutablePair(EvidenceStore.ELEMENT_NAME_EE, "align"));
    //----------------------------------------------------------------------
    //------------------------------2Failed-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.10.01.02-2Failed-02");
    checkResultIsFailed(processResult, 12, 2);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, "PresentationAttrFound", HtmlElementStore.BODY_ELEMENT, 1, new ImmutablePair(EvidenceStore.ELEMENT_NAME_EE, "background"));
    checkRemarkIsPresent(processResult, TestSolution.FAILED, "PresentationAttrFound", HtmlElementStore.DIV_ELEMENT, 2, new ImmutablePair(EvidenceStore.ELEMENT_NAME_EE, "background"));
    //----------------------------------------------------------------------
    //------------------------------2Failed-03------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.10.01.02-2Failed-03");
    checkResultIsFailed(processResult, 11, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, "PresentationAttrFound", HtmlElementStore.BODY_ELEMENT, 1, new ImmutablePair(EvidenceStore.ELEMENT_NAME_EE, "bgcolor"));
    //----------------------------------------------------------------------
    //------------------------------2Failed-04------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.10.01.02-2Failed-04");
    checkResultIsFailed(processResult, 12, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, "PresentationAttrFound", HtmlElementStore.IMG_ELEMENT, 1, new ImmutablePair(EvidenceStore.ELEMENT_NAME_EE, "border"));
    //----------------------------------------------------------------------
    //------------------------------2Failed-05------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.10.01.02-2Failed-05");
    checkResultIsFailed(processResult, 13, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, "PresentationAttrFound", "font", 1, new ImmutablePair(EvidenceStore.ELEMENT_NAME_EE, "color"));
    //----------------------------------------------------------------------
    //------------------------------2Failed-06------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.10.01.02-2Failed-06");
    checkResultIsFailed(processResult, 11, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, "PresentationAttrFound", HtmlElementStore.BODY_ELEMENT, 1, new ImmutablePair(EvidenceStore.ELEMENT_NAME_EE, "link"));
    //----------------------------------------------------------------------
    //------------------------------2Failed-07------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.10.01.02-2Failed-07");
    checkResultIsFailed(processResult, 11, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, "PresentationAttrFound", HtmlElementStore.BODY_ELEMENT, 1, new ImmutablePair(EvidenceStore.ELEMENT_NAME_EE, "alink"));
    //----------------------------------------------------------------------
    //------------------------------2Failed-08------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.10.01.02-2Failed-08");
    checkResultIsFailed(processResult, 11, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, "PresentationAttrFound", HtmlElementStore.BODY_ELEMENT, 1, new ImmutablePair(EvidenceStore.ELEMENT_NAME_EE, "vlink"));
    //----------------------------------------------------------------------
    //------------------------------2Failed-09------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.10.01.02-2Failed-09");
    checkResultIsFailed(processResult, 11, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, "PresentationAttrFound", HtmlElementStore.BODY_ELEMENT, 1, new ImmutablePair(EvidenceStore.ELEMENT_NAME_EE, "text"));
    //----------------------------------------------------------------------
    //------------------------------2Failed-10------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.10.01.02-2Failed-10");
    checkResultIsFailed(processResult, 14, 2);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, "PresentationAttrFound", "hr", 1, new ImmutablePair(EvidenceStore.ELEMENT_NAME_EE, "width"));
    checkRemarkIsPresent(processResult, TestSolution.FAILED, "PresentationAttrFound", "hr", 2, new ImmutablePair(EvidenceStore.ELEMENT_NAME_EE, "height"));
}
Also used : ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair) ProcessResult(org.asqatasun.entity.audit.ProcessResult)

Example 34 with ImmutablePair

use of org.apache.commons.lang3.tuple.ImmutablePair in project Asqatasun by Asqatasun.

the class Rgaa32016Rule130201Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------3NMI-01---------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("Rgaa32016.Test.13.02.01-3NMI-01");
    checkResultIsPreQualified(processResult, 0, 1);
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_JS_PROMPT_A_NEW_WINDOW_MSG, HtmlElementStore.EMBED_ELEMENT, 1);
    //----------------------------------------------------------------------
    //------------------------------3NMI-02---------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.13.02.01-3NMI-02");
    checkResultIsPreQualified(processResult, 0, 1);
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_JS_PROMPT_A_NEW_WINDOW_MSG, HtmlElementStore.EMBED_ELEMENT, 1);
    //----------------------------------------------------------------------
    //------------------------------3NMI-03---------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.13.02.01-3NMI-03");
    checkResultIsPreQualified(processResult, 0, 1);
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_JS_PROMPT_A_NEW_WINDOW_MSG, HtmlElementStore.EMBED_ELEMENT, 1);
    //----------------------------------------------------------------------
    //------------------------------3NMI-04---------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.13.02.01-3NMI-04");
    checkResultIsPreQualified(processResult, 1, 1);
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_USER_IS_WARNED_WHEN_NEW_WINDOW_OPEN_MSG, HtmlElementStore.A_ELEMENT, 1, new ImmutablePair(HtmlElementStore.TEXT_ELEMENT2, "My link"), new ImmutablePair(AttributeStore.TITLE_ATTR, "attribute-absent"));
    //----------------------------------------------------------------------
    //------------------------------3NMI-05---------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.13.02.01-3NMI-05");
    checkResultIsPreQualified(processResult, 4, 4);
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_USER_IS_WARNED_WHEN_NEW_WINDOW_OPEN_MSG, HtmlElementStore.A_ELEMENT, 1, new ImmutablePair(HtmlElementStore.TEXT_ELEMENT2, "My link 1"), new ImmutablePair(AttributeStore.TITLE_ATTR, "attribute-absent"));
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_USER_IS_WARNED_WHEN_NEW_WINDOW_OPEN_MSG, HtmlElementStore.A_ELEMENT, 2, new ImmutablePair(HtmlElementStore.TEXT_ELEMENT2, "My link 2"), new ImmutablePair(AttributeStore.TITLE_ATTR, "attribute-absent"));
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_USER_IS_WARNED_WHEN_NEW_WINDOW_OPEN_MSG, HtmlElementStore.A_ELEMENT, 3, new ImmutablePair(HtmlElementStore.TEXT_ELEMENT2, "My link 3"), new ImmutablePair(AttributeStore.TITLE_ATTR, "Link 3 title"));
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_USER_IS_WARNED_WHEN_NEW_WINDOW_OPEN_MSG, HtmlElementStore.A_ELEMENT, 4, new ImmutablePair(HtmlElementStore.TEXT_ELEMENT2, "My link 4"), new ImmutablePair(AttributeStore.TITLE_ATTR, "attribute-absent"));
    //----------------------------------------------------------------------
    //------------------------------3NMI-06---------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.13.02.01-3NMI-06");
    checkResultIsPreQualified(processResult, 0, 1);
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_JS_PROMPT_A_NEW_WINDOW_MSG, HtmlElementStore.EMBED_ELEMENT, 1);
}
Also used : ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair)

Example 35 with ImmutablePair

use of org.apache.commons.lang3.tuple.ImmutablePair in project Asqatasun by Asqatasun.

the class Rgaa32016Rule110803Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------2Failed-01------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("Rgaa32016.Test.11.08.03-2Failed-01");
    checkResultIsFailed(processResult, 1, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.NOT_PERTINENT_OPTGROUP_LABEL_MSG, HtmlElementStore.OPTGROUP_ELEMENT, 1, new ImmutablePair(AttributeStore.LABEL_ATTR, ""));
    //----------------------------------------------------------------------
    //------------------------------2Failed-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.11.08.03-2Failed-02");
    checkResultIsFailed(processResult, 1, 1);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.NOT_PERTINENT_OPTGROUP_LABEL_MSG, HtmlElementStore.OPTGROUP_ELEMENT, 1, new ImmutablePair(AttributeStore.LABEL_ATTR, "/--*:;!:;*"));
    //----------------------------------------------------------------------
    //------------------------------2Failed-03------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.11.08.03-2Failed-03");
    checkResultIsFailed(processResult, 2, 2);
    checkRemarkIsPresent(processResult, TestSolution.FAILED, RemarkMessageStore.NOT_PERTINENT_OPTGROUP_LABEL_MSG, HtmlElementStore.OPTGROUP_ELEMENT, 1, new ImmutablePair(AttributeStore.LABEL_ATTR, ""));
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_OPTGROUP_LABEL_PERTINENCE_MSG, HtmlElementStore.OPTGROUP_ELEMENT, 2, new ImmutablePair(AttributeStore.LABEL_ATTR, "OptGroup2"));
    //----------------------------------------------------------------------
    //------------------------------3NMI-01---------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("Rgaa32016.Test.11.08.03-3NMI-01");
    checkResultIsPreQualified(processResult, 2, 2);
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_OPTGROUP_LABEL_PERTINENCE_MSG, HtmlElementStore.OPTGROUP_ELEMENT, 1, new ImmutablePair(AttributeStore.LABEL_ATTR, "OptGroup1"));
    checkRemarkIsPresent(processResult, TestSolution.NEED_MORE_INFO, RemarkMessageStore.CHECK_OPTGROUP_LABEL_PERTINENCE_MSG, HtmlElementStore.OPTGROUP_ELEMENT, 2, new ImmutablePair(AttributeStore.LABEL_ATTR, "OptGroup2"));
    //----------------------------------------------------------------------
    //------------------------------4NA-01----------------------------------
    //----------------------------------------------------------------------
    checkResultIsNotApplicable(processPageTest("Rgaa32016.Test.11.08.03-4NA-01"));
    //----------------------------------------------------------------------
    //------------------------------4NA-02----------------------------------
    //----------------------------------------------------------------------
    checkResultIsNotApplicable(processPageTest("Rgaa32016.Test.11.08.03-4NA-02"));
    //----------------------------------------------------------------------
    //------------------------------4NA-03----------------------------------
    //----------------------------------------------------------------------
    checkResultIsNotApplicable(processPageTest("Rgaa32016.Test.11.08.03-4NA-03"));
}
Also used : ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair) ProcessResult(org.asqatasun.entity.audit.ProcessResult)

Aggregations

ImmutablePair (org.apache.commons.lang3.tuple.ImmutablePair)415 ProcessResult (org.asqatasun.entity.audit.ProcessResult)125 Pair (org.apache.commons.lang3.tuple.Pair)65 ArrayList (java.util.ArrayList)64 Map (java.util.Map)39 HashMap (java.util.HashMap)36 List (java.util.List)35 Collectors (java.util.stream.Collectors)34 IOException (java.io.IOException)30 Test (org.junit.Test)27 ElementChecker (org.asqatasun.rules.elementchecker.ElementChecker)21 IntStream (java.util.stream.IntStream)20 File (java.io.File)19 java.util (java.util)18 ElementPresenceChecker (org.asqatasun.rules.elementchecker.element.ElementPresenceChecker)18 Set (java.util.Set)16 VisibleForTesting (com.google.common.annotations.VisibleForTesting)14 INDArray (org.nd4j.linalg.api.ndarray.INDArray)14 Collections (java.util.Collections)13 UserException (org.broadinstitute.hellbender.exceptions.UserException)11