use of org.asqatasun.entity.audit.EvidenceElement in project Asqatasun by Asqatasun.
the class Aw22Rule01081Test method setProcess.
@Override
protected void setProcess() {
//----------------------------------------------------------------------
//------------------------------3NMI-01------------------------------
//----------------------------------------------------------------------
ProcessResult processResult = processPageTest("AW22.Test.1.8.1-3NMI-01");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
SourceCodeRemark processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.MANUAL_CHECK_ON_ELEMENTS_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.IMG_ELEMENT, processRemark.getTarget());
// check number of evidence elements and their value
assertEquals(1, processRemark.getElementList().size());
EvidenceElement ee = processRemark.getElementList().iterator().next();
assertTrue(StringUtils.contains(ee.getValue(), "mock_image.jpg"));
assertEquals(SRC_ATTR, ee.getEvidence().getCode());
//----------------------------------------------------------------------
//------------------------------4NA-01------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.1.8.1-4NA-01");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
// check number of elements in the page
assertEquals(0, processResult.getElementCounter());
//----------------------------------------------------------------------
//------------------------------4NA-02----------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.1.8.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());
}
use of org.asqatasun.entity.audit.EvidenceElement in project Asqatasun by Asqatasun.
the class Aw22Rule11071Test method setProcess.
@Override
protected void setProcess() {
//----------------------------------------------------------------------
//------------------------------3NMI-01---------------------------------
//----------------------------------------------------------------------
ProcessResult processResult = processPageTest("AW22.Test.11.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_LEGEND_PERTINENCE_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.LEGEND_ELEMENT, processRemark.getTarget());
// check number of evidence elements and their value
assertEquals(1, processRemark.getElementList().size());
EvidenceElement ee = processRemark.getElementList().iterator().next();
assertEquals("Fieldset legend", ee.getValue());
assertEquals(HtmlElementStore.TEXT_ELEMENT2, ee.getEvidence().getCode());
//----------------------------------------------------------------------
//------------------------------4NA-01----------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.11.7.1-4NA-01");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
//----------------------------------------------------------------------
//------------------------------4NA-02----------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.11.7.1-4NA-02");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
//----------------------------------------------------------------------
//------------------------------4NA-03----------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.11.7.1-4NA-03");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
}
use of org.asqatasun.entity.audit.EvidenceElement in project Asqatasun by Asqatasun.
the class Rgaa22Rule01021Test method setProcess.
@Override
protected void setProcess() {
//----------------------------------------------------------------------
//------------------------------2Failed-01------------------------------
//----------------------------------------------------------------------
ProcessResult processResult = processPageTest("Rgaa22.Test.1.2-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(RemarkMessageStore.NOT_PERTINENT_TITLE_OF_FRAME_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(HtmlElementStore.FRAME_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(), "!§:;.,?%*\\~/@()[]^_°=+-"));
assertEquals(TITLE_ATTR, ee.getEvidence().getCode());
//----------------------------------------------------------------------
//------------------------------2Failed-02------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.1.2-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(RemarkMessageStore.NOT_PERTINENT_TITLE_OF_FRAME_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(HtmlElementStore.IFRAME_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(), "!§:;.,?%*\\~/@()[]^_°=+-"));
assertEquals(TITLE_ATTR, ee.getEvidence().getCode());
//----------------------------------------------------------------------
//------------------------------2Failed-03------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.1.2-2Failed-03");
// 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(RemarkMessageStore.NOT_PERTINENT_TITLE_OF_FRAME_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(HtmlElementStore.FRAME_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(), "!§:;.,?%*\\~/@()[]^_°=+-"));
assertEquals(TITLE_ATTR, ee.getEvidence().getCode());
//----------------------------------------------------------------------
//------------------------------2Failed-04------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.1.2-2Failed-04");
// 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(RemarkMessageStore.NOT_PERTINENT_TITLE_OF_FRAME_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(HtmlElementStore.FRAME_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-frame1.html"));
assertEquals(TITLE_ATTR, ee.getEvidence().getCode());
//----------------------------------------------------------------------
//------------------------------2Failed-05------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.1.2-2Failed-05");
// 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(RemarkMessageStore.NOT_PERTINENT_TITLE_OF_FRAME_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(HtmlElementStore.IFRAME_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-iframe1.html"));
assertEquals(TITLE_ATTR, ee.getEvidence().getCode());
//----------------------------------------------------------------------
//------------------------------2Failed-06------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.1.2-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(RemarkMessageStore.NOT_PERTINENT_TITLE_OF_FRAME_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(HtmlElementStore.FRAME_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-frame1.html"));
assertEquals(TITLE_ATTR, ee.getEvidence().getCode());
//----------------------------------------------------------------------
//------------------------------3NMI-01---------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.1.2-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(RemarkMessageStore.CHECK_TITLE_OF_FRAME_PERTINENCE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(HtmlElementStore.FRAME_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(), "title of mock-frame1"));
assertEquals(TITLE_ATTR, ee.getEvidence().getCode());
//----------------------------------------------------------------------
//------------------------------3NMI-02---------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.1.2-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(RemarkMessageStore.CHECK_TITLE_OF_FRAME_PERTINENCE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(HtmlElementStore.IFRAME_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(), "Title of mock-iframe1"));
assertEquals(TITLE_ATTR, ee.getEvidence().getCode());
//----------------------------------------------------------------------
//------------------------------3NMI-03---------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.1.2-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(RemarkMessageStore.CHECK_TITLE_OF_FRAME_PERTINENCE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(HtmlElementStore.FRAME_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(), "Title of mock-frame1"));
assertEquals(TITLE_ATTR, ee.getEvidence().getCode());
//----------------------------------------------------------------------
//------------------------------4NA-01----------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.1.2-4NA-01");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
//----------------------------------------------------------------------
//------------------------------4NA-02----------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.1.2-4NA-02");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
//----------------------------------------------------------------------
//------------------------------4NA-03----------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.1.2-4NA-03");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
//----------------------------------------------------------------------
//------------------------------4NA-04----------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.1.2-4NA-04");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
//----------------------------------------------------------------------
//------------------------------4NA-05----------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.1.2-4NA-05");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
//----------------------------------------------------------------------
//------------------------------4NA-06----------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.1.2-4NA-06");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
//----------------------------------------------------------------------
//------------------------------4NA-07----------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.1.2-4NA-07");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
}
use of org.asqatasun.entity.audit.EvidenceElement in project Asqatasun by Asqatasun.
the class Rgaa22Rule05111Test method setProcess.
@Override
protected void setProcess() {
//----------------------------------------------------------------------
//------------------------------3NMI-01------------------------------
//----------------------------------------------------------------------
ProcessResult processResult = processPageTest("Rgaa22.Test.5.11-3NMI-01");
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check test has no remark
assertNotNull(processResult.getRemarkSet());
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check type of remarks and their value
assertNotNull(processResult.getRemarkSet());
SourceCodeRemark processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(MANUAL_CHECK_ON_ELEMENTS_MSG, processRemark.getMessageCode());
// check number of evidence elements and their value
assertEquals(1, processRemark.getElementList().size());
EvidenceElement ee = processRemark.getElementList().iterator().next();
assertEquals(TEXT_ELEMENT2, ee.getEvidence().getCode());
//----------------------------------------------------------------------
//------------------------------3NMI-02------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.5.11-3NMI-02");
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check test has no remark
assertNotNull(processResult.getRemarkSet());
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check type of remarks and their value
assertNotNull(processResult.getRemarkSet());
processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(MANUAL_CHECK_ON_ELEMENTS_MSG, processRemark.getMessageCode());
// check number of evidence elements and their value
assertEquals(1, processRemark.getElementList().size());
ee = processRemark.getElementList().iterator().next();
assertEquals(TEXT_ELEMENT2, ee.getEvidence().getCode());
//----------------------------------------------------------------------
//------------------------------3NMI-03------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.5.11-3NMI-03");
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check test has no remark
assertNotNull(processResult.getRemarkSet());
// check number of elements in the page
assertEquals(2, processResult.getElementCounter());
// check number, type and value of remarks
assertNotNull(processResult.getRemarkSet());
assertEquals(2, processResult.getRemarkSet().size());
for (ProcessRemark remark : processResult.getRemarkSet()) {
processRemark = (SourceCodeRemark) remark;
assertEquals(MANUAL_CHECK_ON_ELEMENTS_MSG, processRemark.getMessageCode());
assertNotNull(processRemark.getElementList());
assertEquals(1, processRemark.getElementList().size());
ee = processRemark.getElementList().iterator().next();
assertEquals(TEXT_ELEMENT2, ee.getEvidence().getCode());
}
//----------------------------------------------------------------------
//------------------------------4NA-01------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.5.11-4NA-01");
// check number of elements in the page
assertEquals(0, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
}
use of org.asqatasun.entity.audit.EvidenceElement in project Asqatasun by Asqatasun.
the class SeoRule07013 method addElementNameEvidenceElementToOverrideTarget.
/**
* This method adds an evidence element of type DEFAULT_EVIDENCE to
* override the default behaviour when grouping message.
*
* @param prs
* @param pr
*/
private void addElementNameEvidenceElementToOverrideTarget(ProcessRemarkService prs, ProcessRemark pr) {
EvidenceElement ee = prs.getEvidenceElement(ProcessRemarkService.DEFAULT_EVIDENCE, ELEMENT_NAME_VALUE_KEY);
pr.addElement(ee);
}
Aggregations