Search in sources :

Example 21 with SourceCodeRemark

use of org.asqatasun.entity.audit.SourceCodeRemark in project Asqatasun by Asqatasun.

the class Aw22Rule01085Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------3NMI-01------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("AW22.Test.1.8.5-3NMI-01");
    // check number of elements in the page
    assertEquals(1, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    SourceCodeRemark processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
    assertEquals(RemarkMessageStore.MANUAL_CHECK_ON_ELEMENTS_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.OBJECT_ELEMENT, processRemark.getTarget());
    // check number of evidence elements and their value
    assertEquals(1, processRemark.getElementList().size());
    EvidenceElement ee = processRemark.getElementList().iterator().next();
    assertTrue(StringUtils.contains(ee.getValue(), "mock_image.gif"));
    assertEquals(DATA_ATTR, ee.getEvidence().getCode());
    //----------------------------------------------------------------------
    //------------------------------4NA-01------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.1.8.5-4NA-01");
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------4NA-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.1.8.5-4NA-02");
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------4NA-03------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.1.8.5-4NA-03");
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------4NA-04----------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.1.8.5-4NA-04");
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
}
Also used : EvidenceElement(org.asqatasun.entity.audit.EvidenceElement) ProcessResult(org.asqatasun.entity.audit.ProcessResult) SourceCodeRemark(org.asqatasun.entity.audit.SourceCodeRemark)

Example 22 with SourceCodeRemark

use of org.asqatasun.entity.audit.SourceCodeRemark in project Asqatasun by Asqatasun.

the class Aw22Rule01091Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------3NMI-01------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("AW22.Test.1.9.1-3NMI-01");
    // check number of elements in the page
    assertEquals(1, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    SourceCodeRemark processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
    assertEquals(RemarkMessageStore.MANUAL_CHECK_ON_ELEMENTS_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.IMG_ELEMENT, processRemark.getTarget());
    // check number of evidence elements and their value
    assertEquals(1, processRemark.getElementList().size());
    EvidenceElement ee = processRemark.getElementList().iterator().next();
    assertTrue(StringUtils.contains(ee.getValue(), "mock_image.jpg"));
    assertEquals(SRC_ATTR, ee.getEvidence().getCode());
    //----------------------------------------------------------------------
    //------------------------------4NA-01------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.1.9.1-4NA-01");
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------4NA-02----------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.1.9.1-4NA-02");
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
}
Also used : EvidenceElement(org.asqatasun.entity.audit.EvidenceElement) ProcessResult(org.asqatasun.entity.audit.ProcessResult) SourceCodeRemark(org.asqatasun.entity.audit.SourceCodeRemark)

Example 23 with SourceCodeRemark

use of org.asqatasun.entity.audit.SourceCodeRemark in project Asqatasun by Asqatasun.

the class Aw22Rule01093Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------3NMI-01------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("AW22.Test.1.9.3-3NMI-01");
    // check number of elements in the page
    assertEquals(1, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    SourceCodeRemark processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
    assertEquals(RemarkMessageStore.MANUAL_CHECK_ON_ELEMENTS_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.INPUT_ELEMENT, processRemark.getTarget());
    // check number of evidence elements and their value
    assertEquals(1, processRemark.getElementList().size());
    EvidenceElement ee = processRemark.getElementList().iterator().next();
    assertEquals(ABSENT_ATTRIBUTE_VALUE, ee.getValue());
    assertEquals(SRC_ATTR, ee.getEvidence().getCode());
    //----------------------------------------------------------------------
    //------------------------------4NA-01------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.1.9.3-4NA-01");
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------4NA-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.1.9.3-4NA-02");
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------4NA-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.1.9.3-4NA-03");
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
}
Also used : EvidenceElement(org.asqatasun.entity.audit.EvidenceElement) ProcessResult(org.asqatasun.entity.audit.ProcessResult) SourceCodeRemark(org.asqatasun.entity.audit.SourceCodeRemark)

Example 24 with SourceCodeRemark

use of org.asqatasun.entity.audit.SourceCodeRemark in project Asqatasun by Asqatasun.

the class Aw22Rule01095Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------3NMI-01------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("AW22.Test.1.9.5-3NMI-01");
    // check number of elements in the page
    assertEquals(1, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    SourceCodeRemark processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
    assertEquals(RemarkMessageStore.MANUAL_CHECK_ON_ELEMENTS_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.OBJECT_ELEMENT, processRemark.getTarget());
    // check number of evidence elements and their value
    assertEquals(1, processRemark.getElementList().size());
    EvidenceElement ee = processRemark.getElementList().iterator().next();
    assertTrue(StringUtils.contains(ee.getValue(), "mock_image.gif"));
    assertEquals(DATA_ATTR, ee.getEvidence().getCode());
    //----------------------------------------------------------------------
    //------------------------------4NA-01------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.1.9.5-4NA-01");
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------4NA-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.1.9.5-4NA-02");
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------4NA-03------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.1.9.5-4NA-03");
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------4NA-04----------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.1.9.5-4NA-04");
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
}
Also used : EvidenceElement(org.asqatasun.entity.audit.EvidenceElement) ProcessResult(org.asqatasun.entity.audit.ProcessResult) SourceCodeRemark(org.asqatasun.entity.audit.SourceCodeRemark)

Example 25 with SourceCodeRemark

use of org.asqatasun.entity.audit.SourceCodeRemark in project Asqatasun by Asqatasun.

the class Aw22Rule04014Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------3NMI-01---------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("AW22.Test.4.1.4-3NMI-01");
    // check number of elements in the page
    assertEquals(1, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    SourceCodeRemark processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
    assertEquals(RemarkMessageStore.MANUAL_CHECK_ON_ELEMENTS_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.EMBED_ELEMENT, processRemark.getTarget());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------3NMI-02---------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.4.1.4-3NMI-02");
    // check number of elements in the page
    assertEquals(1, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
    assertEquals(RemarkMessageStore.MANUAL_CHECK_ON_ELEMENTS_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.OBJECT_ELEMENT, processRemark.getTarget());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------4NA-01----------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.4.1.4-4NA-01");
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
}
Also used : LinkedHashSet(java.util.LinkedHashSet) ProcessResult(org.asqatasun.entity.audit.ProcessResult) SourceCodeRemark(org.asqatasun.entity.audit.SourceCodeRemark)

Aggregations

SourceCodeRemark (org.asqatasun.entity.audit.SourceCodeRemark)146 ProcessResult (org.asqatasun.entity.audit.ProcessResult)143 LinkedHashSet (java.util.LinkedHashSet)73 EvidenceElement (org.asqatasun.entity.audit.EvidenceElement)53 ProcessRemark (org.asqatasun.entity.audit.ProcessRemark)31