Search in sources :

Example 36 with ProcessRemark

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

the class Aw22Rule09014 method check.

@Override
protected void check(SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
    super.check(sspHandler, testSolutionHandler);
    ProcessRemarkService prs = sspHandler.getProcessRemarkService();
    if (CollectionUtils.isNotEmpty(prs.getRemarkList())) {
        for (ProcessRemark pr : prs.getRemarkList()) {
            addElementNameEvidenceElementToOverrideTarget(prs, pr);
        }
    }
}
Also used : ProcessRemark(org.asqatasun.entity.audit.ProcessRemark) ProcessRemarkService(org.asqatasun.service.ProcessRemarkService)

Example 37 with ProcessRemark

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

the class Aw22Rule05011Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------1Passed-01------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("AW22.Test.5.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(1, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.1.1-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
    assertEquals(1, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-03------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.1.1-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
    assertEquals(2, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-04------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.1.1-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
    assertEquals(1, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------2Failed-01------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.1.1-2Failed-01");
    // check number of elements in the page
    assertEquals(1, 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(TestSolution.FAILED, processRemark.getIssue());
    assertEquals(RemarkMessageStore.SUMMARY_MISSING_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.1.1-2Failed-02");
    // check number of elements in the page
    assertEquals(1, 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(TestSolution.FAILED, processRemark.getIssue());
    assertEquals(RemarkMessageStore.SUMMARY_MISSING_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-03------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.1.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(2, processResult.getRemarkSet().size());
    Iterator<ProcessRemark> pIter = processResult.getRemarkSet().iterator();
    processRemark = (SourceCodeRemark) pIter.next();
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals(RemarkMessageStore.SUMMARY_MISSING_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    processRemark = (SourceCodeRemark) pIter.next();
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals(RemarkMessageStore.SUMMARY_MISSING_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-04------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.1.1-2Failed-04");
    // 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(2, processResult.getRemarkSet().size());
    pIter = processResult.getRemarkSet().iterator();
    processRemark = (SourceCodeRemark) pIter.next();
    assertEquals(RemarkMessageStore.SUMMARY_MISSING_MSG, processRemark.getMessageCode());
    // check processRemarkResult
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    processRemark = (SourceCodeRemark) pIter.next();
    assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
    assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_WITH_SUMMARY_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-05------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.1.1-2Failed-05");
    // 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(2, processResult.getRemarkSet().size());
    pIter = processResult.getRemarkSet().iterator();
    processRemark = (SourceCodeRemark) pIter.next();
    // check processRemarkResult
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals(RemarkMessageStore.SUMMARY_MISSING_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    processRemark = (SourceCodeRemark) pIter.next();
    assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
    assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_WITHOUT_SUMMARY_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------3NMI-01------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.1.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());
    processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
    assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_WITHOUT_SUMMARY_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------3NMI-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.1.1-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.CHECK_NATURE_OF_TABLE_WITH_SUMMARY_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------3NMI-03------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.1.1-3NMI-03");
    // check number of elements in the page
    assertEquals(2, 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.CHECK_NATURE_OF_TABLE_WITH_SUMMARY_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------3NMI-04------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.1.1-3NMI-04");
    // check number of elements in the page
    assertEquals(2, 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.CHECK_NATURE_OF_TABLE_WITHOUT_SUMMARY_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------4NA-01------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.1.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.5.1.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 : LinkedHashSet(java.util.LinkedHashSet) ProcessResult(org.asqatasun.entity.audit.ProcessResult) SourceCodeRemark(org.asqatasun.entity.audit.SourceCodeRemark) ProcessRemark(org.asqatasun.entity.audit.ProcessRemark)

Example 38 with ProcessRemark

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

the class Aw22Rule05041Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------1Passed-01------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("AW22.Test.5.4.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(1, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.4.1-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
    assertEquals(1, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-03------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.4.1-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
    assertEquals(2, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------1Passed-04------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.4.1-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
    assertEquals(1, processResult.getElementCounter());
    //----------------------------------------------------------------------
    //------------------------------2Failed-01------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.4.1-2Failed-01");
    // check number of elements in the page
    assertEquals(1, 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(TestSolution.FAILED, processRemark.getIssue());
    assertEquals(RemarkMessageStore.CAPTION_MISSING_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.4.1-2Failed-02");
    // check number of elements in the page
    assertEquals(1, 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(TestSolution.FAILED, processRemark.getIssue());
    assertEquals(RemarkMessageStore.CAPTION_MISSING_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-03------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.4.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(2, processResult.getRemarkSet().size());
    Iterator<ProcessRemark> iter = processResult.getRemarkSet().iterator();
    processRemark = (SourceCodeRemark) iter.next();
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals(RemarkMessageStore.CAPTION_MISSING_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    processRemark = (SourceCodeRemark) iter.next();
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals(RemarkMessageStore.CAPTION_MISSING_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-04------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.4.1-2Failed-04");
    // 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(2, processResult.getRemarkSet().size());
    iter = processResult.getRemarkSet().iterator();
    processRemark = (SourceCodeRemark) iter.next();
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals(RemarkMessageStore.CAPTION_MISSING_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    processRemark = (SourceCodeRemark) iter.next();
    assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
    assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_WITH_CAPTION_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-05------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.4.1-2Failed-05");
    // 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(2, processResult.getRemarkSet().size());
    iter = processResult.getRemarkSet().iterator();
    processRemark = (SourceCodeRemark) iter.next();
    assertEquals(TestSolution.FAILED, processRemark.getIssue());
    assertEquals(RemarkMessageStore.CAPTION_MISSING_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    processRemark = (SourceCodeRemark) iter.next();
    assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
    assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_WITHOUT_CAPTION_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-06------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.4.1-2Failed-06");
    // check number of elements in the page
    assertEquals(1, 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(TestSolution.FAILED, processRemark.getIssue());
    assertEquals(RemarkMessageStore.CAPTION_MISSING_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------3NMI-01--------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.4.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());
    processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
    assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
    assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_WITHOUT_CAPTION_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------3NMI-02--------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.4.1-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.CHECK_NATURE_OF_TABLE_WITH_CAPTION_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------3NMI-03--------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.4.1-3NMI-03");
    // check number of elements in the page
    assertEquals(2, 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.CHECK_NATURE_OF_TABLE_WITH_CAPTION_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------3NMI-01--------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.4.1-3NMI-04");
    // check number of elements in the page
    assertEquals(2, 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.CHECK_NATURE_OF_TABLE_WITHOUT_CAPTION_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------4NA-01------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.4.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.5.4.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 : LinkedHashSet(java.util.LinkedHashSet) ProcessResult(org.asqatasun.entity.audit.ProcessResult) SourceCodeRemark(org.asqatasun.entity.audit.SourceCodeRemark) ProcessRemark(org.asqatasun.entity.audit.ProcessRemark)

Example 39 with ProcessRemark

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

the class Aw22Rule05071Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------3NMI-01--------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("AW22.Test.5.7.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.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------3NMI-02--------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.7.1-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.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    //check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------3NMI-03--------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.7.1-3NMI-03");
    // 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.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------3NMI-04--------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.7.1-3NMI-04");
    // 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.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------3NMI-05--------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.7.1-3NMI-05");
    // 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.CHECK_DEFINITION_OF_HEADERS_FOR_DATA_TABLE_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------3NMI-06--------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.7.1-3NMI-06");
    // check number of elements in the page
    assertEquals(2, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
    // check number of remarks and their value
    assertEquals(2, processResult.getRemarkSet().size());
    Iterator<ProcessRemark> iter = processResult.getRemarkSet().iterator();
    processRemark = (SourceCodeRemark) iter.next();
    assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
    assertEquals(RemarkMessageStore.CHECK_DEFINITION_OF_HEADERS_FOR_DATA_TABLE_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    processRemark = (SourceCodeRemark) iter.next();
    assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
    assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
    assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
    assertNotNull(processRemark.getSnippet());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------4NA-01------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.7.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.5.7.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());
    //----------------------------------------------------------------------
    //------------------------------4NA-03----------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.5.7.1-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 : LinkedHashSet(java.util.LinkedHashSet) ProcessResult(org.asqatasun.entity.audit.ProcessResult) SourceCodeRemark(org.asqatasun.entity.audit.SourceCodeRemark) ProcessRemark(org.asqatasun.entity.audit.ProcessRemark)

Example 40 with ProcessRemark

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

the class Aw22Rule10071Test method setProcess.

@Override
protected void setProcess() {
    //----------------------------------------------------------------------
    //------------------------------1Passed-01------------------------------
    //----------------------------------------------------------------------
    ProcessResult processResult = processPageTest("AW22.Test.10.7.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());
    //----------------------------------------------------------------------
    //------------------------------1Passed-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-1Passed-02");
    // 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.10.7.1-2Failed-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.INVISIBLE_OUTLINE_ON_FOCUS_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.A_ELEMENT, processRemark.getTarget());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-2Failed-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.INVISIBLE_OUTLINE_ON_FOCUS_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.A_ELEMENT, processRemark.getTarget());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-03------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-2Failed-03");
    // 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.INVISIBLE_OUTLINE_ON_FOCUS_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.A_ELEMENT, processRemark.getTarget());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-04------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-2Failed-04");
    // 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.INVISIBLE_OUTLINE_ON_FOCUS_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.DIV_ELEMENT, processRemark.getTarget());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-05------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-2Failed-05");
    // 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.INVISIBLE_OUTLINE_ON_FOCUS_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.A_ELEMENT, processRemark.getTarget());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-06------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-2Failed-06");
    // 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.INVISIBLE_OUTLINE_ON_FOCUS_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.A_ELEMENT, processRemark.getTarget());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------2Failed-07------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-2Failed-07");
    // 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.INVISIBLE_OUTLINE_ON_FOCUS_MSG, processRemark.getMessageCode());
    assertEquals(HtmlElementStore.SPAN_ELEMENT, processRemark.getTarget());
    // check number of evidence elements and their value
    assertNull(processRemark.getElementList());
    //----------------------------------------------------------------------
    //------------------------------3NMI-01---------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.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());
    ProcessRemark pr = processResult.getRemarkSet().iterator().next();
    assertEquals(TestSolution.NEED_MORE_INFO, pr.getIssue());
    assertEquals(RemarkMessageStore.CHECK_MANUALLY_OUTLINE_FOR_FORM_ELEMENT_AND_IFRAME_MSG, pr.getMessageCode());
    // check number of evidence elements and their value
    assertNull(pr.getElementList());
    //----------------------------------------------------------------------
    //---------------------------------3NMI-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-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());
    pr = processResult.getRemarkSet().iterator().next();
    assertEquals(TestSolution.NEED_MORE_INFO, pr.getIssue());
    assertEquals(RemarkMessageStore.CHECK_MANUALLY_OUTLINE_FOR_FORM_ELEMENT_AND_IFRAME_MSG, pr.getMessageCode());
    // check number of evidence elements and their value
    assertNull(pr.getElementList());
    //----------------------------------------------------------------------
    //---------------------------------3NMI-03------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-3NMI-03");
    // 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());
    pr = processResult.getRemarkSet().iterator().next();
    assertEquals(TestSolution.NEED_MORE_INFO, pr.getIssue());
    assertEquals(RemarkMessageStore.CHECK_MANUALLY_OUTLINE_FOR_FORM_ELEMENT_AND_IFRAME_MSG, pr.getMessageCode());
    // check number of evidence elements and their value
    assertNull(pr.getElementList());
    //----------------------------------------------------------------------
    //---------------------------------3NMI-04------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-3NMI-04");
    // 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());
    pr = processResult.getRemarkSet().iterator().next();
    assertEquals(TestSolution.NEED_MORE_INFO, pr.getIssue());
    assertEquals(RemarkMessageStore.CHECK_MANUALLY_OUTLINE_FOR_FORM_ELEMENT_AND_IFRAME_MSG, pr.getMessageCode());
    // check number of evidence elements and their value
    assertNull(pr.getElementList());
    //----------------------------------------------------------------------
    //---------------------------------3NMI-05------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-3NMI-05");
    // 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());
    pr = processResult.getRemarkSet().iterator().next();
    assertEquals(TestSolution.NEED_MORE_INFO, pr.getIssue());
    assertEquals(RemarkMessageStore.CHECK_MANUALLY_OUTLINE_FOR_FORM_ELEMENT_AND_IFRAME_MSG, pr.getMessageCode());
    // check number of evidence elements and their value
    assertNull(pr.getElementList());
    //----------------------------------------------------------------------
    //---------------------------------3NMI-06------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-3NMI-06");
    // 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());
    pr = processResult.getRemarkSet().iterator().next();
    assertEquals(TestSolution.NEED_MORE_INFO, pr.getIssue());
    assertEquals(RemarkMessageStore.CHECK_MANUALLY_OUTLINE_FOR_FORM_ELEMENT_AND_IFRAME_MSG, pr.getMessageCode());
    // check number of evidence elements and their value
    assertNull(pr.getElementList());
    //----------------------------------------------------------------------
    //---------------------------------3NMI-07------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-3NMI-07");
    // 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());
    pr = processResult.getRemarkSet().iterator().next();
    assertEquals(TestSolution.NEED_MORE_INFO, pr.getIssue());
    assertEquals(RemarkMessageStore.CHECK_MANUALLY_OUTLINE_FOR_FORM_ELEMENT_AND_IFRAME_MSG, pr.getMessageCode());
    // check number of evidence elements and their value
    assertNull(pr.getElementList());
    //----------------------------------------------------------------------
    //---------------------------------3NMI-08------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-3NMI-08");
    // 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());
    pr = processResult.getRemarkSet().iterator().next();
    assertEquals(TestSolution.NEED_MORE_INFO, pr.getIssue());
    assertEquals(RemarkMessageStore.CHECK_MANUALLY_OUTLINE_FOR_FORM_ELEMENT_AND_IFRAME_MSG, pr.getMessageCode());
    // check number of evidence elements and their value
    assertNull(pr.getElementList());
    //----------------------------------------------------------------------
    //---------------------------------3NMI-09------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-3NMI-09");
    // 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());
    pr = processResult.getRemarkSet().iterator().next();
    assertEquals(TestSolution.NEED_MORE_INFO, pr.getIssue());
    assertEquals(RemarkMessageStore.CHECK_MANUALLY_OUTLINE_FOR_FORM_ELEMENT_AND_IFRAME_MSG, pr.getMessageCode());
    // check number of evidence elements and their value
    assertNull(pr.getElementList());
    //----------------------------------------------------------------------
    //---------------------------------3NMI-10------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-3NMI-10");
    // 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());
    pr = processResult.getRemarkSet().iterator().next();
    assertEquals(TestSolution.NEED_MORE_INFO, pr.getIssue());
    assertEquals(RemarkMessageStore.CHECK_MANUALLY_OUTLINE_FOR_FORM_ELEMENT_AND_IFRAME_MSG, pr.getMessageCode());
    // check number of evidence elements and their value
    assertNull(pr.getElementList());
    //----------------------------------------------------------------------
    //------------------------------4NA-01------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-4NA-01");
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check number of remarks and their value
    assertNull(processResult.getRemarkSet());
    //----------------------------------------------------------------------
    //------------------------------4NA-02------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-4NA-02");
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check number of remarks and their value
    assertNull(processResult.getRemarkSet());
    //----------------------------------------------------------------------
    //------------------------------4NA-03------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-4NA-03");
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check number of remarks and their value
    assertNull(processResult.getRemarkSet());
    //----------------------------------------------------------------------
    //------------------------------4NA-04------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-4NA-04");
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check number of remarks and their value
    assertNull(processResult.getRemarkSet());
    //----------------------------------------------------------------------
    //------------------------------4NA-05------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-4NA-05");
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check number of remarks and their value
    assertNull(processResult.getRemarkSet());
    //----------------------------------------------------------------------
    //------------------------------4NA-06------------------------------
    //----------------------------------------------------------------------
    processResult = processPageTest("AW22.Test.10.7.1-4NA-06");
    // check number of elements in the page
    assertEquals(0, processResult.getElementCounter());
    // check test result
    assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
    // check number of remarks and their value
    assertNull(processResult.getRemarkSet());
}
Also used : LinkedHashSet(java.util.LinkedHashSet) ProcessResult(org.asqatasun.entity.audit.ProcessResult) SourceCodeRemark(org.asqatasun.entity.audit.SourceCodeRemark) ProcessRemark(org.asqatasun.entity.audit.ProcessRemark)

Aggregations

ProcessRemark (org.asqatasun.entity.audit.ProcessRemark)56 ProcessResult (org.asqatasun.entity.audit.ProcessResult)41 SourceCodeRemark (org.asqatasun.entity.audit.SourceCodeRemark)31 LinkedHashSet (java.util.LinkedHashSet)23 ElementHandlerImpl (org.asqatasun.ruleimplementation.ElementHandlerImpl)6 TestSolutionHandler (org.asqatasun.ruleimplementation.TestSolutionHandler)6 TestSolutionHandlerImpl (org.asqatasun.ruleimplementation.TestSolutionHandlerImpl)6 Element (org.jsoup.nodes.Element)6 ProcessRemarkService (org.asqatasun.service.ProcessRemarkService)5 EvidenceElement (org.asqatasun.entity.audit.EvidenceElement)4