use of org.asqatasun.service.ProcessRemarkService in project Asqatasun by Asqatasun.
the class DoctypeHtml5CheckerTest method testChecker.
/**
*
* @param doctype
* @param result
* @param remark
*/
private void testChecker(String doctype, TestSolution result, String remark) {
ProcessRemarkService processRemarkService = createMock(ProcessRemarkService.class);
SSP ssp = createMock(SSP.class);
SSPHandler sspHandler = createMock(SSPHandler.class);
expect(sspHandler.getSSP()).andReturn(ssp);
expect(ssp.getDoctype()).andReturn(doctype);
if (StringUtils.isNotBlank(remark)) {
processRemarkService.addProcessRemark(result, remark);
expectLastCall();
}
// Elements not used in this implementation
Elements elements = null;
TestSolutionHandler testSolutionHandler = createMock(TestSolutionHandler.class);
testSolutionHandler.addTestSolution(result);
expectLastCall();
replay(ssp, sspHandler, processRemarkService, testSolutionHandler);
DoctypeHtml5Checker instance = new DoctypeHtml5Checker();
instance.setProcessRemarkService(processRemarkService);
instance.doCheck(sspHandler, elements, testSolutionHandler);
verify(ssp, sspHandler, processRemarkService, testSolutionHandler);
}
use of org.asqatasun.service.ProcessRemarkService in project Asqatasun by Asqatasun.
the class SeoRule01081 method processImpl.
@Override
protected ProcessResult processImpl(SSPHandler sspHandler) {
ProcessRemarkService processRemarkService = sspHandler.getProcessRemarkService();
processRemarkService.resetService();
TestSolution testSolution = TestSolution.PASSED;
try {
URL url = new URL(sspHandler.getSSP().getURI());
if (StringUtils.isNotBlank(url.getPath()) && url.getPath().contains("_")) {
testSolution = TestSolution.FAILED;
processRemarkService.addProcessRemark(TestSolution.FAILED, RemarkMessageStore.URL_PATH_UNDERSCORE_DETECTED);
}
} catch (MalformedURLException ex) {
testSolution = TestSolution.NOT_APPLICABLE;
}
return processResultDataService.getDefiniteResult(test, sspHandler.getPage(), testSolution, processRemarkService.getRemarkList());
}
use of org.asqatasun.service.ProcessRemarkService in project Asqatasun by Asqatasun.
the class SeoRule07013 method check.
@Override
protected void check(final SSPHandler sspHandler, TestSolutionHandler testSolutionHandler) {
super.check(sspHandler, testSolutionHandler);
ProcessRemarkService prs = sspHandler.getProcessRemarkService();
if (CollectionUtils.isNotEmpty(prs.getRemarkList())) {
for (ProcessRemark pr : prs.getRemarkList()) {
addElementNameEvidenceElementToOverrideTarget(prs, pr);
}
}
}
Aggregations