use of org.asqatasun.entity.audit.SourceCodeRemark in project Asqatasun by Asqatasun.
the class AbstractRuleImplementationTestCase method checkRemarkIsPresent.
/**
*
* @param processResult
* @param testSolution
* @param remarkMessageCode
* @param remarkTarget
* @param position
* @param emptySnippet
* @param evidencePairs
*/
protected void checkRemarkIsPresent(ProcessResult processResult, TestSolution testSolution, String remarkMessageCode, String remarkTarget, int position, boolean emptySnippet, Pair<String, String>... evidencePairs) {
if (((LinkedHashSet) processResult.getRemarkSet()).toArray()[position - 1] instanceof SourceCodeRemark) {
SourceCodeRemark sourceCodeRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).toArray()[position - 1]);
Logger.getLogger(this.getClass()).debug(sourceCodeRemark.getMessageCode());
assertEquals(remarkMessageCode, sourceCodeRemark.getMessageCode());
assertEquals(testSolution, sourceCodeRemark.getIssue());
Logger.getLogger(this.getClass()).debug(sourceCodeRemark.getIssue());
if (remarkTarget.equals("EMPTY_TARGET")) {
assertEquals(-1, sourceCodeRemark.getLineNumber());
} else {
assertEquals(remarkTarget, sourceCodeRemark.getTarget());
Logger.getLogger(this.getClass()).debug(sourceCodeRemark.getTarget());
if (!emptySnippet) {
assertNotNull("Snippet is empty but shouldn't !!! ", sourceCodeRemark.getSnippet());
}
}
if (evidencePairs.length == 0) {
assertNull("Evidence Element list is not empty but should be !!! ", sourceCodeRemark.getElementList());
return;
}
// check number of evidence elements and their value
assertEquals(evidencePairs.length, sourceCodeRemark.getElementList().size());
Object[] evEls = sourceCodeRemark.getElementList().toArray();
for (int i = 0; i < evEls.length; i++) {
EvidenceElement ee = (EvidenceElement) evEls[i];
Logger.getLogger(this.getClass()).debug(ee.getEvidence().getCode());
Logger.getLogger(this.getClass()).debug(ee.getValue());
assertEquals(evidencePairs[i].getLeft(), ee.getEvidence().getCode());
assertTrue("Wrong evidence element : expected[" + evidencePairs[i].getRight() + "] actual[" + ee.getValue() + "]", StringUtils.contains(ee.getValue(), evidencePairs[i].getRight()));
}
} else {
ProcessRemark processRemark = (ProcessRemark) (((LinkedHashSet) processResult.getRemarkSet()).toArray()[position - 1]);
Logger.getLogger(this.getClass()).debug(processRemark.getMessageCode());
assertEquals(remarkMessageCode, processRemark.getMessageCode());
assertEquals(testSolution, processRemark.getIssue());
assertNull(processRemark.getElementList());
}
}
use of org.asqatasun.entity.audit.SourceCodeRemark in project Asqatasun by Asqatasun.
the class SourceCodeRemarkFactoryImpl method create.
@Override
public SourceCodeRemark create(String target, TestSolution issue, String messageCode, int lineNumber) {
SourceCodeRemark sourceCodeRemark = create(issue, messageCode);
sourceCodeRemark.setTarget(target);
sourceCodeRemark.setLineNumber(lineNumber);
return sourceCodeRemark;
}
use of org.asqatasun.entity.audit.SourceCodeRemark in project Asqatasun by Asqatasun.
the class Aw22Rule10042Test method setProcess.
@Override
protected void setProcess() {
// ----------------------------------------------------------------------
// ------------------------------1Passed-01------------------------------
// ----------------------------------------------------------------------
ProcessResult processResult = processPageTest("AW22.Test.10.4.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
assertEquals(1, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-02------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.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
assertEquals(1, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-03------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.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
assertEquals(2, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-04------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.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
assertEquals(2, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-05------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.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
assertEquals(2, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-06------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.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
assertEquals(2, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-07------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.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
assertEquals(2, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-08------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.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
assertEquals(1, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-09------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.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
assertEquals(1, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-10------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.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
assertEquals(1, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------2Failed-01_1----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-01_1");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("pt", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
Iterator<EvidenceElement> iter = processRemark.getElementList().iterator();
EvidenceElement ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "AW22.Test.10.4.2-2Failed-01_1.css"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-01_2----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-01_2");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("pt", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "AW22.Test.10.4.2-2Failed-01_2_1.css"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-01_3----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-01_3");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("pt", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "AW22.Test.10.4.2-2Failed-01_3.css"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-01_4----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-01_4");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("pt", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-01_5----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-01_5");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("pt", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-02_1----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-02_1");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("pc", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-02_2----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-02_2");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("pc", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-02_3----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-02_3");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("pc", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-02_4----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-02_4");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("pc", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-02_5----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-02_5");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("pc", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-03_1----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-03_1");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("mm", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-03_2----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-03_2");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("mm", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-03_3----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-03_3");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("mm", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-03_4----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-03_4");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("mm", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-03_5----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-03_5");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("mm", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-04_1----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-04_1");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("cm", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-04_2----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-04_2");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("cm", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-04_3----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-04_3");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("cm", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-04_4----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-04_4");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("cm", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-04_5----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-04_5");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("cm", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-05_1----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-05_1");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("in", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-05_2----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-05_2");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("in", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-05_3----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-05_3");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("in", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-05_4----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-05_4");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("in", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-05_5----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-05_5");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("in", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("h1", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "locale"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-06_1----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-06_1");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("in", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("div", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "inline"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-06_2----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-06_2");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("pt", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("div", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "inline"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-06_3----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-06_3");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("mm", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("div", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "inline"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-06_4----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-06_4");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("cm", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("div", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "inline"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-06_5----------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-2Failed-06_5");
// 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.BAD_UNIT_TYPE_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals("pc", processRemark.getTarget());
assertNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(2, processRemark.getElementList().size());
iter = processRemark.getElementList().iterator();
ee = iter.next();
assertEquals("div", ee.getValue());
assertEquals(EvidenceStore.CSS_SELECTOR_EE, ee.getEvidence().getCode());
ee = iter.next();
assertTrue(StringUtils.contains(ee.getValue(), "inline"));
assertEquals(EvidenceStore.CSS_FILENAME_EE, ee.getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------4NA-1-----------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.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
assertEquals(0, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------4NA-2-----------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.10.4.2-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.SourceCodeRemark 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());
}
use of org.asqatasun.entity.audit.SourceCodeRemark in project Asqatasun by Asqatasun.
the class Aw22Rule09012Test method setProcess.
@Override
protected void setProcess() {
// ----------------------------------------------------------------------
// ------------------------------1Passed-01------------------------------
// ----------------------------------------------------------------------
ProcessResult processResult = processPageTest("AW22.Test.9.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
assertEquals(1, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-02------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.9.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
assertEquals(3, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-03------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.9.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
assertEquals(3, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-04------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.9.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
assertEquals(4, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-05------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.9.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
assertEquals(5, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-06------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.9.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
assertEquals(6, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-07------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.9.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
assertEquals(1, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-08------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.9.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
assertEquals(2, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------1Passed-09------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.9.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
assertEquals(2, processResult.getElementCounter());
// ----------------------------------------------------------------------
// ------------------------------2Failed-01------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.9.1.2-2Failed-01");
// check number of elements in the page
assertEquals(3, 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.HEADER_NOT_HIERARCHICALLY_WELL_DEFINED_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(HtmlElementStore.H3_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(1, processRemark.getElementList().size());
assertEquals("h1", processRemark.getElementList().iterator().next().getValue());
assertEquals(EvidenceStore.PREVIOUS_H_TAG_INDEX_EE, processRemark.getElementList().iterator().next().getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-02------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.9.1.2-2Failed-02");
// check number of elements in the page
assertEquals(5, 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.HEADER_NOT_HIERARCHICALLY_WELL_DEFINED_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(HtmlElementStore.H1_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(1, processRemark.getElementList().size());
assertEquals("h2", processRemark.getElementList().iterator().next().getValue());
assertEquals(EvidenceStore.FIRST_H_TAG_INDEX_EE, processRemark.getElementList().iterator().next().getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-03------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.9.1.2-2Failed-03");
// check number of elements in the page
assertEquals(3, 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.HEADER_NOT_HIERARCHICALLY_WELL_DEFINED_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(HtmlElementStore.H4_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(1, processRemark.getElementList().size());
assertEquals("h2", processRemark.getElementList().iterator().next().getValue());
assertEquals(EvidenceStore.PREVIOUS_H_TAG_INDEX_EE, processRemark.getElementList().iterator().next().getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-04------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.9.1.2-2Failed-04");
// check number of elements in the page
assertEquals(4, 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.HEADER_NOT_HIERARCHICALLY_WELL_DEFINED_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(HtmlElementStore.H5_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(1, processRemark.getElementList().size());
assertEquals("h3", processRemark.getElementList().iterator().next().getValue());
assertEquals(EvidenceStore.PREVIOUS_H_TAG_INDEX_EE, processRemark.getElementList().iterator().next().getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-05------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.9.1.2-2Failed-05");
// check number of elements in the page
assertEquals(5, 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.HEADER_NOT_HIERARCHICALLY_WELL_DEFINED_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(HtmlElementStore.H6_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(1, processRemark.getElementList().size());
assertEquals("h4", processRemark.getElementList().iterator().next().getValue());
assertEquals(EvidenceStore.PREVIOUS_H_TAG_INDEX_EE, processRemark.getElementList().iterator().next().getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------2Failed-06------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.9.1.2-2Failed-06");
// check number of elements in the page
assertEquals(10, 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.HEADER_NOT_HIERARCHICALLY_WELL_DEFINED_MSG, processRemark.getMessageCode());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(HtmlElementStore.H6_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertEquals(1, processRemark.getElementList().size());
assertEquals("h4", processRemark.getElementList().iterator().next().getValue());
assertEquals(EvidenceStore.PREVIOUS_H_TAG_INDEX_EE, processRemark.getElementList().iterator().next().getEvidence().getCode());
// ----------------------------------------------------------------------
// ------------------------------4NA-01----------------------------------
// ----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.9.1.2-4NA-01");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
}
Aggregations