use of org.asqatasun.entity.audit.ProcessRemark in project Asqatasun by Asqatasun.
the class AbstractRuleImplementationTestCase method checkRemarkIsPresent.
/**
*
* @param processResult
* @param testSolution
* @param remarkMessageCode
* @param position
*/
protected void checkRemarkIsPresent(ProcessResult processResult, TestSolution testSolution, String remarkMessageCode, int position) {
ProcessRemark processRemark = ((ProcessRemark) ((LinkedHashSet) processResult.getRemarkSet()).toArray()[position - 1]);
Logger.getLogger(this.getClass()).debug(processRemark.getMessageCode());
assertEquals(remarkMessageCode, processRemark.getMessageCode());
Logger.getLogger(this.getClass()).debug(processRemark.getIssue());
assertEquals(testSolution, processRemark.getIssue());
assertNull(processRemark.getElementList());
}
use of org.asqatasun.entity.audit.ProcessRemark in project Asqatasun by Asqatasun.
the class ProcessRemarkDataServiceMock method getProcessRemark.
@Override
public ProcessRemark getProcessRemark(TestSolution issue, String messageCode) {
ProcessRemark pr = processRemarkFactory.create();
pr.setIssue(issue);
pr.setMessageCode(messageCode);
return pr;
}
use of org.asqatasun.entity.audit.ProcessRemark in project Asqatasun by Asqatasun.
the class Aw22Rule05073Test method setProcess.
@Override
protected void setProcess() {
//----------------------------------------------------------------------
//------------------------------3NMI-01--------------------------------
//----------------------------------------------------------------------
ProcessResult processResult = processPageTest("AW22.Test.5.7.3-3NMI-01");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
SourceCodeRemark processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-02--------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.3-3NMI-02");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-03--------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.3-3NMI-03");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-04--------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.3-3NMI-04");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-05--------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.3-3NMI-05");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_DEFINITION_OF_HEADERS_FOR_DATA_TABLE_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-06--------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.3-3NMI-06");
// check number of elements in the page
assertEquals(2, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(2, processResult.getRemarkSet().size());
Iterator<ProcessRemark> iter = processResult.getRemarkSet().iterator();
processRemark = (SourceCodeRemark) iter.next();
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_DEFINITION_OF_HEADERS_FOR_DATA_TABLE_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
processRemark = (SourceCodeRemark) iter.next();
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------4NA-01------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.3-4NA-01");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
// check number of elements in the page
assertEquals(0, processResult.getElementCounter());
//----------------------------------------------------------------------
//------------------------------4NA-02------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.3-4NA-02");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
// check number of elements in the page
assertEquals(0, processResult.getElementCounter());
//----------------------------------------------------------------------
//------------------------------4NA-03------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.3-4NA-03");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
// check number of elements in the page
assertEquals(0, processResult.getElementCounter());
}
use of org.asqatasun.entity.audit.ProcessRemark in project Asqatasun by Asqatasun.
the class Aw22Rule05074Test method setProcess.
@Override
protected void setProcess() {
//----------------------------------------------------------------------
//------------------------------3NMI-01--------------------------------
//----------------------------------------------------------------------
ProcessResult processResult = processPageTest("AW22.Test.5.7.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.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-02--------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.4-3NMI-02");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
//check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-03--------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.4-3NMI-03");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-04--------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.4-3NMI-04");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-05--------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.4-3NMI-05");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-06--------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.4-3NMI-06");
// check number of elements in the page
assertEquals(2, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(2, processResult.getRemarkSet().size());
Iterator<ProcessRemark> iter = processResult.getRemarkSet().iterator();
processRemark = (SourceCodeRemark) iter.next();
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_DEFINITION_OF_HEADERS_FOR_DATA_TABLE_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
processRemark = (SourceCodeRemark) iter.next();
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_AND_HEADERS_DEFINITION_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------4NA-01------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.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());
//----------------------------------------------------------------------
//------------------------------4NA-02------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.4-4NA-02");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
// check number of elements in the page
assertEquals(0, processResult.getElementCounter());
//----------------------------------------------------------------------
//------------------------------4NA-03----------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.7.4-4NA-03");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
// check number of elements in the page
assertEquals(0, processResult.getElementCounter());
}
use of org.asqatasun.entity.audit.ProcessRemark in project Asqatasun by Asqatasun.
the class Aw22Rule05061Test method setProcess.
@Override
protected void setProcess() {
//----------------------------------------------------------------------
//------------------------------3NMI-01--------------------------------
//----------------------------------------------------------------------
ProcessResult processResult = processPageTest("AW22.Test.5.6.1-3NMI-01");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
SourceCodeRemark processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_AND_HEADERS_USAGE_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-02--------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.6.1-3NMI-02");
// check number of elements in the page
assertEquals(1, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(1, processResult.getRemarkSet().size());
processRemark = ((SourceCodeRemark) ((LinkedHashSet) processResult.getRemarkSet()).iterator().next());
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_USAGE_OF_HEADERS_FOR_DATA_TABLE_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------3NMI-03--------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.6.1-3NMI-03");
// check number of elements in the page
assertEquals(2, processResult.getElementCounter());
// check test result
assertEquals(TestSolution.NEED_MORE_INFO, processResult.getValue());
// check number of remarks and their value
assertEquals(2, processResult.getRemarkSet().size());
Iterator<ProcessRemark> iter = processResult.getRemarkSet().iterator();
processRemark = (SourceCodeRemark) iter.next();
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_USAGE_OF_HEADERS_FOR_DATA_TABLE_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
processRemark = (SourceCodeRemark) iter.next();
assertEquals(TestSolution.NEED_MORE_INFO, processRemark.getIssue());
assertEquals(RemarkMessageStore.CHECK_NATURE_OF_TABLE_AND_HEADERS_USAGE_MSG, processRemark.getMessageCode());
assertTrue(processRemark.getTarget().equalsIgnoreCase(HtmlElementStore.TABLE_ELEMENT));
assertNotNull(processRemark.getSnippet());
// check number of evidence elements and their value
assertNull(processRemark.getElementList());
//----------------------------------------------------------------------
//------------------------------4NA-01------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.6.1-4NA-01");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
// check number of elements in the page
assertEquals(0, processResult.getElementCounter());
//----------------------------------------------------------------------
//------------------------------4NA-01------------------------------
//----------------------------------------------------------------------
processResult = processPageTest("AW22.Test.5.6.1-4NA-02");
// check test result
assertEquals(TestSolution.NOT_APPLICABLE, processResult.getValue());
// check test has no remark
assertNull(processResult.getRemarkSet());
// check number of elements in the page
assertEquals(0, processResult.getElementCounter());
}
Aggregations