Search in sources :

Example 11 with Page

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);
}
Also used : Site(org.asqatasun.entity.subject.Site) Page(org.asqatasun.entity.subject.Page) WebResourceStatistics(org.asqatasun.entity.statistics.WebResourceStatistics)

Example 12 with Page

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);
}
Also used : Site(org.asqatasun.entity.subject.Site) Page(org.asqatasun.entity.subject.Page)

Example 13 with 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());
}
Also used : ProcessResult(org.asqatasun.entity.audit.ProcessResult) List(java.util.List) Page(org.asqatasun.entity.subject.Page)

Example 14 with Page

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);
}
Also used : Site(org.asqatasun.entity.subject.Site) Page(org.asqatasun.entity.subject.Page)

Example 15 with 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);
}
Also used : Site(org.asqatasun.entity.subject.Site) Page(org.asqatasun.entity.subject.Page)

Aggregations

Page (org.asqatasun.entity.subject.Page)77 Site (org.asqatasun.entity.subject.Site)68 WebResource (org.asqatasun.entity.subject.WebResource)7 ArrayList (java.util.ArrayList)6 Query (javax.persistence.Query)6 Audit (org.asqatasun.entity.audit.Audit)4 ProcessResult (org.asqatasun.entity.audit.ProcessResult)4 List (java.util.List)3 Map (java.util.Map)3 SSP (org.asqatasun.entity.audit.SSP)3 Content (org.asqatasun.entity.audit.Content)2 DefiniteResult (org.asqatasun.entity.audit.DefiniteResult)2 ForbiddenPageException (org.asqatasun.webapp.exception.ForbiddenPageException)2 ColumnBuilderException (ar.com.fdvs.dj.domain.builders.ColumnBuilderException)1 IOException (java.io.IOException)1 JRException (net.sf.jasperreports.engine.JRException)1 PreProcessResult (org.asqatasun.entity.audit.PreProcessResult)1 Scope (org.asqatasun.entity.reference.Scope)1 ContentDataService (org.asqatasun.entity.service.audit.ContentDataService)1 WebResourceDataService (org.asqatasun.entity.service.subject.WebResourceDataService)1