use of org.asqatasun.entity.subject.Page 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.Page 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.Page in project Asqatasun by Asqatasun.
the class SeoRule06041Test method setConsolidate.
@Override
protected void setConsolidate() {
//----------------------------------------------------------------------
//------------------------------1Passed-01------------------------------
//----------------------------------------------------------------------
Collection<ProcessResult> processResult = consolidateWithListAsReturn("Seo.Test.6.4.1-1Passed-01");
assertEquals(3, processResult.size());
assertEquals(TestSolution.PASSED, ((List<ProcessResult>) processResult).get(0).getValue());
assertEquals(TestSolution.PASSED, ((List<ProcessResult>) processResult).get(1).getValue());
assertEquals(TestSolution.PASSED, ((List<ProcessResult>) processResult).get(2).getValue());
//----------------------------------------------------------------------
//------------------------------1Passed-02------------------------------
//----------------------------------------------------------------------
processResult = consolidateWithListAsReturn("Seo.Test.6.4.1-1Passed-02");
assertEquals(3, processResult.size());
assertEquals(TestSolution.NOT_APPLICABLE, ((List<ProcessResult>) processResult).get(0).getValue());
assertEquals(TestSolution.PASSED, ((List<ProcessResult>) processResult).get(1).getValue());
assertEquals(TestSolution.PASSED, ((List<ProcessResult>) processResult).get(2).getValue());
//----------------------------------------------------------------------
//------------------------------1Passed-03------------------------------
//----------------------------------------------------------------------
processResult = consolidateWithListAsReturn("Seo.Test.6.4.1-1Passed-03");
assertEquals(3, processResult.size());
assertEquals(TestSolution.PASSED, ((List<ProcessResult>) processResult).get(0).getValue());
assertEquals(TestSolution.PASSED, ((List<ProcessResult>) processResult).get(1).getValue());
assertEquals(TestSolution.PASSED, ((List<ProcessResult>) processResult).get(2).getValue());
//----------------------------------------------------------------------
//------------------------------2Failed-01------------------------------
//----------------------------------------------------------------------
processResult = consolidateWithListAsReturn("Seo.Test.6.4.1-2Failed-01");
assertEquals(3, processResult.size());
assertEquals(TestSolution.FAILED, ((List<ProcessResult>) processResult).get(0).getValue());
assertEquals(TestSolution.FAILED, ((List<ProcessResult>) processResult).get(1).getValue());
assertEquals(TestSolution.FAILED, ((List<ProcessResult>) processResult).get(2).getValue());
assertEquals(2, ((List<ProcessResult>) processResult).get(0).getRemarkSet().size());
assertEquals(RemarkMessageStore.TITLE_IDENTICAL_TO_ANOTHER_PAGE_MSG, ((ProcessRemark) ((List<ProcessResult>) processResult).get(0).getRemarkSet().toArray()[0]).getMessageCode());
assertEquals(RemarkMessageStore.TITLE_IDENTICAL_TO_ANOTHER_PAGE_MSG, ((ProcessRemark) ((List<ProcessResult>) processResult).get(0).getRemarkSet().toArray()[1]).getMessageCode());
assertEquals(2, ((List<ProcessResult>) processResult).get(1).getRemarkSet().size());
assertEquals(RemarkMessageStore.TITLE_IDENTICAL_TO_ANOTHER_PAGE_MSG, ((ProcessRemark) ((List<ProcessResult>) processResult).get(1).getRemarkSet().toArray()[0]).getMessageCode());
assertEquals(RemarkMessageStore.TITLE_IDENTICAL_TO_ANOTHER_PAGE_MSG, ((ProcessRemark) ((List<ProcessResult>) processResult).get(1).getRemarkSet().toArray()[1]).getMessageCode());
assertEquals(2, ((List<ProcessResult>) processResult).get(2).getRemarkSet().size());
assertEquals(RemarkMessageStore.TITLE_NOT_UNIQUE_MSG, ((ProcessRemark) ((List<ProcessResult>) processResult).get(2).getRemarkSet().toArray()[0]).getMessageCode());
//----------------------------------------------------------------------
//------------------------------2Failed-02------------------------------
//----------------------------------------------------------------------
processResult = consolidateWithListAsReturn("Seo.Test.6.4.1-2Failed-02");
assertEquals(4, processResult.size());
for (ProcessResult pr : processResult) {
if (pr.getSubject().getURL().contains("2Failed-05")) {
assertEquals(TestSolution.PASSED, pr.getValue());
} else {
assertEquals(TestSolution.FAILED, pr.getValue());
assertEquals(2, pr.getRemarkSet().size());
if (pr.getSubject() instanceof Page) {
assertEquals(RemarkMessageStore.TITLE_IDENTICAL_TO_ANOTHER_PAGE_MSG, ((ProcessRemark) pr.getRemarkSet().toArray()[0]).getMessageCode());
assertEquals(RemarkMessageStore.TITLE_IDENTICAL_TO_ANOTHER_PAGE_MSG, ((ProcessRemark) pr.getRemarkSet().toArray()[1]).getMessageCode());
} else {
assertEquals(RemarkMessageStore.TITLE_NOT_UNIQUE_MSG, ((ProcessRemark) pr.getRemarkSet().toArray()[0]).getMessageCode());
assertEquals(RemarkMessageStore.TITLE_NOT_UNIQUE_MSG, ((ProcessRemark) pr.getRemarkSet().toArray()[1]).getMessageCode());
}
}
}
//----------------------------------------------------------------------
//------------------------------2Failed-03------------------------------
//----------------------------------------------------------------------
processResult = consolidateWithListAsReturn("Seo.Test.6.4.1-2Failed-03");
assertEquals(4, processResult.size());
for (ProcessResult pr : processResult) {
if (pr.getSubject().getURL().contains("2Failed-07")) {
assertEquals(TestSolution.PASSED, pr.getValue());
} else {
assertEquals(TestSolution.FAILED, pr.getValue());
assertEquals(2, pr.getRemarkSet().size());
if (pr.getSubject() instanceof Page) {
assertEquals(RemarkMessageStore.TITLE_IDENTICAL_TO_ANOTHER_PAGE_MSG, ((ProcessRemark) pr.getRemarkSet().toArray()[0]).getMessageCode());
assertEquals(RemarkMessageStore.TITLE_IDENTICAL_TO_ANOTHER_PAGE_MSG, ((ProcessRemark) pr.getRemarkSet().toArray()[1]).getMessageCode());
} else {
assertEquals(RemarkMessageStore.TITLE_NOT_UNIQUE_MSG, ((ProcessRemark) pr.getRemarkSet().toArray()[0]).getMessageCode());
assertEquals(RemarkMessageStore.TITLE_NOT_UNIQUE_MSG, ((ProcessRemark) pr.getRemarkSet().toArray()[1]).getMessageCode());
}
}
}
//----------------------------------------------------------------------
//------------------------------2Failed-04------------------------------
//----------------------------------------------------------------------
processResult = consolidateWithListAsReturn("Seo.Test.6.4.1-2Failed-04");
assertEquals(5, processResult.size());
for (ProcessResult pr : processResult) {
if (pr.getSubject().getURL().contains("2Failed-11") || pr.getSubject().getURL().contains("2Failed-12")) {
assertEquals(TestSolution.PASSED, pr.getValue());
} else {
assertEquals(TestSolution.FAILED, pr.getValue());
assertEquals(2, pr.getRemarkSet().size());
if (pr.getSubject() instanceof Page) {
assertEquals(RemarkMessageStore.TITLE_IDENTICAL_TO_ANOTHER_PAGE_MSG, ((ProcessRemark) pr.getRemarkSet().toArray()[0]).getMessageCode());
assertEquals(RemarkMessageStore.TITLE_IDENTICAL_TO_ANOTHER_PAGE_MSG, ((ProcessRemark) pr.getRemarkSet().toArray()[1]).getMessageCode());
} else {
assertEquals(RemarkMessageStore.TITLE_NOT_UNIQUE_MSG, ((ProcessRemark) pr.getRemarkSet().toArray()[0]).getMessageCode());
assertEquals(RemarkMessageStore.TITLE_NOT_UNIQUE_MSG, ((ProcessRemark) pr.getRemarkSet().toArray()[1]).getMessageCode());
}
}
}
//----------------------------------------------------------------------
//------------------------------4NA-01----------------------------------
//----------------------------------------------------------------------
processResult = consolidateWithListAsReturn("Seo.Test.6.4.1-4NA-01");
assertEquals(3, processResult.size());
assertEquals(TestSolution.NOT_APPLICABLE, ((List<ProcessResult>) processResult).get(0).getValue());
assertEquals(TestSolution.NOT_APPLICABLE, ((List<ProcessResult>) processResult).get(1).getValue());
assertEquals(TestSolution.NOT_APPLICABLE, ((List<ProcessResult>) processResult).get(2).getValue());
}
use of org.asqatasun.entity.subject.Page 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.Page 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