Search in sources :

Example 6 with ProcessResult

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

the class Aw22Rule06053Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------3NMI-01---------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("AW22.Test.6.5.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.IMG_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // 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());
    //----------------------------------------------------------------------
    //------------------------------3NMI-02---------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.6.5.3-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.INPUT_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertEquals(1, processRemark.getElementList().size());
    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.6.5.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-01----------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.6.5.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());
}
Also used : LinkedHashSet(java.util.LinkedHashSet) EvidenceElement(org.asqatasun.entity.audit.EvidenceElement) ProcessResult(org.asqatasun.entity.audit.ProcessResult) SourceCodeRemark(org.asqatasun.entity.audit.SourceCodeRemark)

Example 7 with ProcessResult

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

the class Aw22Rule08012Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------1Passed-01------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("AW22.Test.8.1.2-1Passed-01");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-1Passed-02");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-03------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-1Passed-03");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-04------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-1Passed-04");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-05------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-1Passed-05");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-06------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-1Passed-06");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-07------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-1Passed-07");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-08------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-1Passed-08");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-09------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-1Passed-09");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-10------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-1Passed-10");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-11------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-1Passed-11");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-12------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-1Passed-12");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-13------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-1Passed-13");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-14------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-1Passed-14");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-15------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-1Passed-15");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------2Failed-01------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-2Failed-01");
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.FAILED, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    ProcessRemark processRemark = ((ProcessRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(RemarkMessageStore.INVALID_DOCTYPE_MSG, processRemark.getMessageCode());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-2Failed-02");
    // check number of elements in the page (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.FAILED, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    processRemark = ((ProcessRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(RemarkMessageStore.INVALID_DOCTYPE_MSG, processRemark.getMessageCode());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------4NA-01------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.1.2-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 (no counter management here, 
    // we test the presence of one tag in the page)
    assertEquals(0, processResult.getElementCounter());
}
Also used : LinkedHashSet(java.util.LinkedHashSet) ProcessResult(org.asqatasun.entity.audit.ProcessResult) ProcessRemark(org.asqatasun.entity.audit.ProcessRemark)

Example 8 with ProcessResult

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

the class Aw22Rule10011Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------1Passed-01------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("AW22.Test.10.1.1-1Passed-01");
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check test has no remark
    assertNull(processResult.getRemarkSet());
    // check number of elements in the page
    assertEquals(12, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------2Failed-01------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.1.1-2Failed-01");
    // check number of elements in the page
    assertEquals(13, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.FAILED, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    SourceCodeRemark processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(RemarkMessageStore.PRESENTATION_TAG_DETECTED_MSG, processRemark.getMessageCode());
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals("basefont", processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.1.1-2Failed-02");
    // check number of elements in the page
    assertEquals(13, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.FAILED, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(RemarkMessageStore.PRESENTATION_TAG_DETECTED_MSG, processRemark.getMessageCode());
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals("center", processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-03------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.1.1-2Failed-03");
    // check number of elements in the page
    assertEquals(13, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.FAILED, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(RemarkMessageStore.PRESENTATION_TAG_DETECTED_MSG, processRemark.getMessageCode());
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals("blink", processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-04------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.1.1-2Failed-04");
    // check number of elements in the page
    assertEquals(13, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.FAILED, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(RemarkMessageStore.PRESENTATION_TAG_DETECTED_MSG, processRemark.getMessageCode());
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals("font", processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-05------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.1.1-2Failed-05");
    // check number of elements in the page
    assertEquals(13, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.FAILED, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(RemarkMessageStore.PRESENTATION_TAG_DETECTED_MSG, processRemark.getMessageCode());
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals("tt", processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-06------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.1.1-2Failed-06");
    // check number of elements in the page
    assertEquals(13, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.FAILED, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(RemarkMessageStore.PRESENTATION_TAG_DETECTED_MSG, processRemark.getMessageCode());
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals("marquee", processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-07------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.1.1-2Failed-07");
    // check number of elements in the page
    assertEquals(13, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.FAILED, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(RemarkMessageStore.PRESENTATION_TAG_DETECTED_MSG, processRemark.getMessageCode());
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals("s", processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-08------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.1.1-2Failed-08");
    // check number of elements in the page
    assertEquals(13, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.FAILED, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(RemarkMessageStore.PRESENTATION_TAG_DETECTED_MSG, processRemark.getMessageCode());
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals("strike", processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-09------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.1.1-2Failed-09");
    // check number of elements in the page
    assertEquals(13, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.FAILED, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(RemarkMessageStore.PRESENTATION_TAG_DETECTED_MSG, processRemark.getMessageCode());
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals("u", processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
}
Also used : LinkedHashSet(java.util.LinkedHashSet) ProcessResult(org.asqatasun.entity.audit.ProcessResult) SourceCodeRemark(org.asqatasun.entity.audit.SourceCodeRemark)

Example 9 with ProcessResult

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

the class Aw22Rule08051Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------1Passed-01---------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("AW22.Test.8.5.1-1Passed-01");
    // check number of elements in the page
    assertEquals(1, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.PASSED, processResult.getValue());
    // check number of remarks and their value
    assertNull(processResult.getRemarkSet());
    //----------------------------------------------------------------------
    //----------------------------2Failed-01--------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.5.1-2Failed-01");
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.FAILED, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    assertTrue(processResult.getRemarkSet().iterator().next() instanceof ProcessRemark);
    assertEquals(RemarkMessageStore.TITLE_TAG_MISSING_MSG, processResult.getRemarkSet().iterator().next().getMessageCode());
    assertEquals(TestSolution.FAILED, processResult.getRemarkSet().iterator().next().getIssue());
    //----------------------------------------------------------------------
    //----------------------------2Failed-02--------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.5.1-2Failed-02");
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.FAILED, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    assertTrue(processResult.getRemarkSet().iterator().next() instanceof ProcessRemark);
    assertEquals(RemarkMessageStore.TITLE_TAG_MISSING_MSG, processResult.getRemarkSet().iterator().next().getMessageCode());
    assertEquals(TestSolution.FAILED, processResult.getRemarkSet().iterator().next().getIssue());
    //----------------------------------------------------------------------
    //----------------------------2Failed-03--------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.8.5.1-2Failed-03");
    // check number of elements in the page
    assertEquals(2, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.FAILED, processResult.getValue());
    // check number of remarks and their value
    assertEquals(1, processResult.getRemarkSet().size());
    assertTrue(processResult.getRemarkSet().iterator().next() instanceof ProcessRemark);
    assertEquals(RemarkMessageStore.TITLE_TAG_MISSING_MSG, processResult.getRemarkSet().iterator().next().getMessageCode());
    assertEquals(TestSolution.FAILED, processResult.getRemarkSet().iterator().next().getIssue());
}
Also used : ProcessResult(org.asqatasun.entity.audit.ProcessResult) ProcessRemark(org.asqatasun.entity.audit.ProcessRemark)

Example 10 with ProcessResult

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

the class Aw22Rule06044Test method setProcess.

@Override
protected void setProcess() {
    ProcessResult processResult = processPageTest("AW22.Test.06.04.04-1Passed-01");
    assertEquals(TestSolution.PASSED, processResult.getValue());
    processResult = processPageTest("AW22.Test.06.04.04-1Passed-02");
    assertEquals(TestSolution.PASSED, processResult.getValue());
    processResult = processPageTest("AW22.Test.06.04.04-1Passed-03");
    assertEquals(TestSolution.PASSED, processResult.getValue());
    processResult = processPageTest("AW22.Test.06.04.04-1Passed-04");
    assertEquals(TestSolution.PASSED, processResult.getValue());
    processResult = processPageTest("AW22.Test.06.04.04-2Failed-01");
    assertEquals(TestSolution.FAILED, processResult.getValue());
    assertEquals(2, processResult.getRemarkSet().size());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[0]).getMessageCode());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[1]).getMessageCode());
    processResult = processPageTest("AW22.Test.06.04.04-2Failed-02");
    assertEquals(TestSolution.FAILED, processResult.getValue());
    assertEquals(2, processResult.getRemarkSet().size());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[0]).getMessageCode());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[1]).getMessageCode());
    processResult = processPageTest("AW22.Test.06.04.04-2Failed-03");
    assertEquals(TestSolution.FAILED, processResult.getValue());
    assertEquals(2, processResult.getRemarkSet().size());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[0]).getMessageCode());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[1]).getMessageCode());
    processResult = processPageTest("AW22.Test.06.04.04-2Failed-04");
    assertEquals(TestSolution.FAILED, processResult.getValue());
    assertEquals(2, processResult.getRemarkSet().size());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[0]).getMessageCode());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[1]).getMessageCode());
    processResult = processPageTest("AW22.Test.06.04.04-2Failed-05");
    assertEquals(TestSolution.FAILED, processResult.getValue());
    assertEquals(4, processResult.getRemarkSet().size());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[0]).getMessageCode());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[1]).getMessageCode());
    assertEquals(RemarkMessageStore.SUSPECTED_IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[2]).getMessageCode());
    assertEquals(RemarkMessageStore.SUSPECTED_IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[3]).getMessageCode());
    processResult = processPageTest("AW22.Test.06.04.04-2Failed-06");
    assertEquals(TestSolution.FAILED, processResult.getValue());
    assertEquals(4, processResult.getRemarkSet().size());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[0]).getMessageCode());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[1]).getMessageCode());
    assertEquals(RemarkMessageStore.SUSPECTED_IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[2]).getMessageCode());
    assertEquals(RemarkMessageStore.SUSPECTED_IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[3]).getMessageCode());
    processResult = processPageTest("AW22.Test.06.04.04-2Failed-07");
    assertEquals(TestSolution.FAILED, processResult.getValue());
    assertEquals(4, processResult.getRemarkSet().size());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[0]).getMessageCode());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[1]).getMessageCode());
    assertEquals(RemarkMessageStore.SUSPECTED_IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[2]).getMessageCode());
    assertEquals(RemarkMessageStore.SUSPECTED_IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[3]).getMessageCode());
    processResult = processPageTest("AW22.Test.06.04.04-2Failed-08");
    assertEquals(TestSolution.FAILED, processResult.getValue());
    assertEquals(4, processResult.getRemarkSet().size());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[0]).getMessageCode());
    assertEquals(RemarkMessageStore.IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[1]).getMessageCode());
    assertEquals(RemarkMessageStore.SUSPECTED_IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[2]).getMessageCode());
    assertEquals(RemarkMessageStore.SUSPECTED_IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[3]).getMessageCode());
    processResult = processPageTest("AW22.Test.06.04.04-3NMI-01");
    assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
    assertEquals(2, processResult.getRemarkSet().size());
    assertEquals(RemarkMessageStore.SUSPECTED_IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[0]).getMessageCode());
    assertEquals(RemarkMessageStore.SUSPECTED_IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[1]).getMessageCode());
    processResult = processPageTest("AW22.Test.06.04.04-3NMI-02");
    assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
    assertEquals(2, processResult.getRemarkSet().size());
    assertEquals(RemarkMessageStore.SUSPECTED_IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[0]).getMessageCode());
    assertEquals(RemarkMessageStore.SUSPECTED_IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[1]).getMessageCode());
    processResult = processPageTest("AW22.Test.06.04.04-3NMI-03");
    assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
    assertEquals(2, processResult.getRemarkSet().size());
    assertEquals(RemarkMessageStore.SUSPECTED_IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[0]).getMessageCode());
    assertEquals(RemarkMessageStore.SUSPECTED_IDENTICAL_LINK_WITH_DIFFERENT_TARGET, ((ProcessRemark) processResult.getRemarkSet().toArray()[1]).getMessageCode());
    processResult = processPageTest("AW22.Test.06.04.04-4NA-01");
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    assertNull(processResult.getRemarkSet());
    processResult = processPageTest("AW22.Test.06.04.04-4NA-02");
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    assertNull(processResult.getRemarkSet());
    processResult = processPageTest("AW22.Test.06.04.04-4NA-03");
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    assertNull(processResult.getRemarkSet());
    processResult = processPageTest("AW22.Test.06.04.04-4NA-04");
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    assertNull(processResult.getRemarkSet());
    processResult = processPageTest("AW22.Test.06.04.04-4NA-05");
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    assertNull(processResult.getRemarkSet());
    processResult = processPageTest("AW22.Test.06.04.04-4NA-06");
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    assertNull(processResult.getRemarkSet());
    // 06.04.01 testcases : All is Not Applicable
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.01-1Passed-01").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.01-1Passed-02").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.01-2Failed-01").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.01-2Failed-02").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.01-2Failed-03").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.01-3NMI-01").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.01-3NMI-02").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.01-3NMI-03").getValue());
    // 06.04.02 testcases : All is Not Applicable
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.02-1Passed-01").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.02-1Passed-02").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.02-1Passed-03").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.02-1Passed-04").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.02-2Failed-01").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.02-2Failed-02").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.02-2Failed-03").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.02-2Failed-04").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.02-2Failed-05").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.02-2Failed-06").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.02-2Failed-07").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.02-2Failed-08").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.02-3NMI-01").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.02-3NMI-02").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.02-3NMI-03").getValue());
    // 06.04.03 testcases : All is Not Applicable
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.03-1Passed-01").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.03-1Passed-02").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.03-2Failed-01").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.03-2Failed-02").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.03-2Failed-03").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.03-3NMI-01").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.03-3NMI-02").getValue());
    assertEquals(TestSolution.NOT_APPLICABLE, processPageTest("AW22.Test.06.04.03-3NMI-03").getValue());
}
Also used : ProcessResult(org.asqatasun.entity.audit.ProcessResult)

Aggregations

ProcessResult (org.asqatasun.entity.audit.ProcessResult)856 SourceCodeRemark (org.asqatasun.entity.audit.SourceCodeRemark)143 ImmutablePair (org.apache.commons.lang3.tuple.ImmutablePair)109 LinkedHashSet (java.util.LinkedHashSet)77 EvidenceElement (org.asqatasun.entity.audit.EvidenceElement)53 IndefiniteResult (org.asqatasun.entity.audit.IndefiniteResult)41 ProcessRemark (org.asqatasun.entity.audit.ProcessRemark)41 WebResource (org.asqatasun.entity.subject.WebResource)8 ArrayList (java.util.ArrayList)4 Audit (org.asqatasun.entity.audit.Audit)4 DefiniteResult (org.asqatasun.entity.audit.DefiniteResult)4 Page (org.asqatasun.entity.subject.Page)4 Site (org.asqatasun.entity.subject.Site)4 List (java.util.List)3 SourceCodeRemarkImpl (org.asqatasun.entity.audit.SourceCodeRemarkImpl)3 Test (org.asqatasun.entity.reference.Test)3 Map (java.util.Map)2 Content (org.asqatasun.entity.audit.Content)2 TestSolution (org.asqatasun.entity.audit.TestSolution)2 CriterionStatistics (org.asqatasun.entity.statistics.CriterionStatistics)2