use of org.asqatasun.entity.subject.Site in project Asqatasun by Asqatasun.
the class AbstractGroupRuleWithPageResultImplementation method consolidateImpl.
/**
* This is the implementation of the method declared in
* {@link AbstractRuleImplementation}. It encapsulates the main algorithm of
* the consolidation operation of concrete {@link RuleImplementation}
* classes for tests with group scope. It calls the method
* {@link #consolidateGroup(org.asqatasun.entity.subject.Site, java.util.Set)}
* which should consolidate gross results by group. In common cases, this
* method should not be overriden.
*
* @param grossResultMap
* the gross result map to consolidate.
* @return the list of net results from the gross result list.
*/
@Override
protected List<ProcessResult> consolidateImpl(Map<WebResource, List<ProcessResult>> grossResultMap, ProcessRemarkService processRemarkService) {
List<ProcessResult> netResultList = new ArrayList<>();
for (Map.Entry<WebResource, List<ProcessResult>> entry : grossResultMap.entrySet()) {
WebResource key = entry.getKey();
List<ProcessResult> grossResultList = entry.getValue();
if (entry.getKey() instanceof Page) {
DefiniteResult netResult = processResultDataService.getDefiniteResult(test, key);
netResult.setDefiniteValue(TestSolution.NOT_APPLICABLE);
for (ProcessResult grossResult : grossResultList) {
// netResult.addChildResult(grossResult);
netResult.setNetResultAudit(grossResult.getGrossResultAudit());
}
netResultList.add(netResult);
continue;
} else {
netResultList.addAll(consolidateGroup((Site) key, grossResultList, processRemarkService));
}
}
return consolidateSite(netResultList, processRemarkService);
}
use of org.asqatasun.entity.subject.Site in project Asqatasun by Asqatasun.
the class AnalyserImpl method run.
@Override
public void run() {
WebResourceStatistics wrStats = webResourceStatisticsDataService.create();
// done in memory or through the db
if (webResource instanceof Page) {
extractTestSet(false);
netResultList = getProcessResultWithNotTested(testSet, processResultDataService.getNetResultFromAuditAndWebResource(audit, webResource));
wrStats = computeAuditStatisticsFromPrList(wrStats);
wrStats = computeHttpStatusCode(wrStats);
} else if (webResource instanceof Site) {
extractTestSet(true);
wrStats = computeAuditStatisticsFromDb(wrStats);
wrStats = computeCriterionStatisticsFromDb(wrStats);
wrStats = computeTestStatisticsFromDb(wrStats);
wrStats = computeThemeStatisticsFromDb(wrStats);
}
wrStats = computeMark(wrStats);
wrStats = computeRawMark(wrStats);
wrStats = computeNumberOfFailedOccurrences(wrStats);
wrStats.setAudit(audit);
wrStats.setWebResource(webResource);
webResourceStatisticsDataService.saveOrUpdate(wrStats);
}
use of org.asqatasun.entity.subject.Site in project Asqatasun by Asqatasun.
the class Rgaa32016Rule110302Test method setUpWebResourceMap.
@Override
protected void setUpWebResourceMap() {
getWebResourceMap().put("Rgaa32016.Test.11.03.02-4NA-01", getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa32016/Rgaa32016Rule110302/Rgaa32016.Test.11.03.02-3NMI-01.html"));
Site site = getWebResourceFactory().createSite("file:Site-NotTested");
getWebResourceMap().put("Rgaa32016.Test.11.03.02-5NT-01", site);
Page page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa32016/Rgaa32016Rule110302/Rgaa32016.Test.11.03.02-3NMI-01.html");
site.addChild(page);
getWebResourceMap().put("Rgaa32016.Test.11.03.02-5NT-01-page1", page);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa32016/Rgaa32016Rule110302/Rgaa32016.Test.11.03.02-3NMI-01.html");
site.addChild(page);
getWebResourceMap().put("Rgaa32016.Test.11.03.02-5NT-01-page1", page);
}
use of org.asqatasun.entity.subject.Site in project Asqatasun by Asqatasun.
the class SeoRule01041Test method setUpWebResourceMap.
@Override
protected void setUpWebResourceMap() {
Site site = getWebResourceFactory().createSite("file:Site-Passed1");
getWebResourceMap().put("Seo.Test.1.4.1-1Passed-01", site);
Page page = getWebResourceFactory().createPage(getTestcasesFilePath() + "SEO/SeoRule01041/Seo.Test.1.4.1-1Passed-01.html");
site.addChild(page);
getWebResourceMap().put("Seo.Test.1.4.1-page01", page);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "SEO/SeoRule01041/Seo.Test.1.4.1-1Passed-02.html");
site.addChild(page);
getWebResourceMap().put("Seo.Test.1.4.1-page02", page);
site = getWebResourceFactory().createSite("file:Site-Failed1");
getWebResourceMap().put("Seo.Test.1.4.1-2Failed-01", site);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "SEO/SeoRule01041/Seo.Test.1.4.1-2Failed-01.html");
site.addChild(page);
getWebResourceMap().put("Seo.Test.1.4.1-page03", page);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "SEO/SeoRule01041/Seo.Test.1.4.1-2Failed-02.html");
site.addChild(page);
getWebResourceMap().put("Seo.Test.1.4.1-page04", page);
site = getWebResourceFactory().createSite("file:Site-Passed2");
getWebResourceMap().put("Seo.Test.1.4.1-1Passed-02", site);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "SEO/SeoRule01041/Seo.Test.1.4.1-2Failed-02.html");
site.addChild(page);
getWebResourceMap().put("Seo.Test.1.4.1-page05", page);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "SEO/SeoRule01041/Seo.Test.1.4.1-1Passed-01.html");
site.addChild(page);
getWebResourceMap().put("Seo.Test.1.4.1-page06", page);
}
use of org.asqatasun.entity.subject.Site in project Asqatasun by Asqatasun.
the class SeoRule01051Test method setUpWebResourceMap.
@Override
protected void setUpWebResourceMap() {
Site site = getWebResourceFactory().createSite("http://site-robot.asqatasun.ovh");
getWebResourceMap().put("Seo.Test.1.5.1-1Passed-01", site);
Page page = getWebResourceFactory().createPage("http://site-robot.asqatasun.ovh");
site.addChild(page);
site = getWebResourceFactory().createSite("http://site.asqatasun.ovh");
getWebResourceMap().put("Seo.Test.1.5.1-2Failed-01", site);
page = getWebResourceFactory().createPage("http://site.asqatasun.ovh");
site.addChild(page);
site = getWebResourceFactory().createSite("http://site-sitemap.asqatasun.ovh");
getWebResourceMap().put("Seo.Test.1.5.1-2Failed-02", site);
page = getWebResourceFactory().createPage("http://site-sitemap.asqatasun.ovh");
site.addChild(page);
}
Aggregations