use of org.asqatasun.entity.audit.ProcessResult in project Asqatasun by Asqatasun.
the class RuleHelper method synthesizeProcessResultCollection.
/**
*
* @param processResultCollection
* the process result collection to synthesize
* @return the synthesis of the process result collection
*/
public static TestSolution synthesizeProcessResultCollection(Collection<ProcessResult> processResultCollection) {
boolean hasPassed = false;
boolean hasFailed = false;
boolean hasNMI = false;
for (ProcessResult testResult : processResultCollection) {
DefiniteResult definiteResult = (DefiniteResult) testResult;
switch(definiteResult.getDefiniteValue()) {
case PASSED:
hasPassed = true;
break;
case FAILED:
hasFailed = true;
break;
case NEED_MORE_INFO:
hasNMI = true;
break;
default:
}
}
if (hasFailed) {
return TestSolution.FAILED;
}
if (hasNMI) {
return TestSolution.NEED_MORE_INFO;
}
if (hasPassed) {
return TestSolution.PASSED;
}
return TestSolution.NOT_APPLICABLE;
}
use of org.asqatasun.entity.audit.ProcessResult in project Asqatasun by Asqatasun.
the class Aw22Rule13154Test method setProcess.
@Override
protected void setProcess() {
//----------------------------------------------------------------------
//------------------------------3NMI-01------------------------------
//----------------------------------------------------------------------
ProcessResult processResult = processPageTest("AW22.Test.13.15.4-3NMI-01");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
SourceCodeRemark processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.MANUAL_CHECK_ON_ELEMENTS_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.APPLET_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.class"));
assertEquals(AttributeStore.CODE_ATTR, ee.getEvidence().getCode());
//----------------------------------------------------------------------
//------------------------------4NA-01------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.13.15.4-4NA-01");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
// check number of elements in the page
assertEquals(0, processResult.getElementCounter());
}
use of org.asqatasun.entity.audit.ProcessResult in project Asqatasun by Asqatasun.
the class Aw22Rule13012Test method setProcess.
@Override
protected void setProcess() {
//----------------------------------------------------------------------
//------------------------------1Passed-01------------------------------
//----------------------------------------------------------------------
ProcessResult processResult = processPageTest("AW22.Test.13.1.2-1Passed-01");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.PASSED, processResult.getValue());
// check number of remarks and their value
assertNull(processResult.getRemarkSet());
//----------------------------------------------------------------------
//------------------------------2Failed-01------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.13.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(TestSolution.FAILED, processRemark.getIssue());
assertEquals(RemarkMessageStore.NOT_IMMEDIATE_REDIRECT_VIA_META_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.META_ELEMENT, processRemark.getTarget());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------4NA-01----------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.13.1.2-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.13.1.2-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());
}
use of org.asqatasun.entity.audit.ProcessResult in project Asqatasun by Asqatasun.
the class Aw22Rule13022Test method setProcess.
@Override
protected void setProcess() {
//----------------------------------------------------------------------
//------------------------------3NMI-01---------------------------------
//----------------------------------------------------------------------
ProcessResult processResult = processPageTest("AW22.Test.13.2.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());
SourceCodeRemark processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_USER_IS_WARNED_IN_CASE_OF_NEW_WINDOW_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.EMBED_ELEMENT, processRemark.getTarget());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-02---------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.13.2.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(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_USER_IS_WARNED_IN_CASE_OF_NEW_WINDOW_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.APPLET_ELEMENT, processRemark.getTarget());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-03---------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.13.2.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(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_USER_IS_WARNED_IN_CASE_OF_NEW_WINDOW_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.OBJECT_ELEMENT, processRemark.getTarget());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------4NA-01----------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.13.2.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());
}
use of org.asqatasun.entity.audit.ProcessResult in project Asqatasun by Asqatasun.
the class Rgaa22Rule11081Test method setProcess.
@Override
protected void setProcess() {
//----------------------------------------------------------------------
//------------------------------1Passed-01------------------------------
//----------------------------------------------------------------------
ProcessResult processResult = processPageTest("Rgaa22.Test.11.8-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("Rgaa22.Test.11.8-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("Rgaa22.Test.11.8-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("Rgaa22.Test.11.8-1Passed-04");
// check test result
assertEquals(TestSolution.PASSED, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
//----------------------------------------------------------------------
//------------------------------2Failed-01------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.11.8-2Failed-01");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.FAILED, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
SourceCodeRemark processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(RemarkMessageStore.SUMMARY_MISSING_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------2Failed-02------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.11.8-2Failed-02");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.FAILED, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(RemarkMessageStore.SUMMARY_MISSING_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------2Failed-03------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.11.8-2Failed-03");
// check number of elements in the page
assertEquals(2, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.FAILED, processResult.getValue());
// check number of remarks and their value
assertEquals(2, processResult.getRemarkSet().size());
Iterator<ProcessRemark> pIter = processResult.getRemarkSet().iterator();
processRemark = (SourceCodeRemark) pIter.next();
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(RemarkMessageStore.SUMMARY_MISSING_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
processRemark = (SourceCodeRemark) pIter.next();
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(RemarkMessageStore.SUMMARY_MISSING_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------2Failed-04------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.11.8-2Failed-04");
// check number of elements in the page
assertEquals(2, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.FAILED, processResult.getValue());
// check number of remarks and their value
assertEquals(2, processResult.getRemarkSet().size());
pIter = processResult.getRemarkSet().iterator();
processRemark = (SourceCodeRemark) pIter.next();
assertEquals(RemarkMessageStore.SUMMARY_MISSING_MSG, processRemark.getMessageCode());
// check processRemarkResult
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
processRemark = (SourceCodeRemark) pIter.next();
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_WITH_SUMMARY_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------2Failed-05------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.11.8-2Failed-05");
// check number of elements in the page
assertEquals(2, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.FAILED, processResult.getValue());
// check number of remarks and their value
assertEquals(2, processResult.getRemarkSet().size());
pIter = processResult.getRemarkSet().iterator();
processRemark = (SourceCodeRemark) pIter.next();
// check processRemarkResult
assertEquals(TestSolution.FAILED, processRemark.getIssue());
assertEquals(RemarkMessageStore.SUMMARY_MISSING_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
processRemark = (SourceCodeRemark) pIter.next();
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_WITHOUT_SUMMARY_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-01------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.11.8-3NMI-01");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_WITHOUT_SUMMARY_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-02------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.11.8-3NMI-02");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_WITH_SUMMARY_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-03------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.11.8-3NMI-03");
// check number of elements in the page
assertEquals(2, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_WITH_SUMMARY_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-04------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.11.8-3NMI-04");
// check number of elements in the page
assertEquals(2, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_WITHOUT_SUMMARY_MSG, processRemark.getMessageCode());
assertEquals(HtmlElementStore.TABLE_ELEMENT, processRemark.getTarget());
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------4NA-01------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("Rgaa22.Test.11.8-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("Rgaa22.Test.11.8-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());
}
Aggregations