Search in sources :

Example 11 with Site

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);
}
Also used : Site(org.asqatasun.entity.subject.Site) ArrayList(java.util.ArrayList) ProcessResult(org.asqatasun.entity.audit.ProcessResult) WebResource(org.asqatasun.entity.subject.WebResource) List(java.util.List) ArrayList(java.util.ArrayList) Page(org.asqatasun.entity.subject.Page) Map(java.util.Map) DefiniteResult(org.asqatasun.entity.audit.DefiniteResult)

Example 12 with Site

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

Example 13 with Site

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

Example 14 with Site

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

Example 15 with Site

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

Aggregations

Site (org.asqatasun.entity.subject.Site)76 Page (org.asqatasun.entity.subject.Page)68 WebResource (org.asqatasun.entity.subject.WebResource)9 Audit (org.asqatasun.entity.audit.Audit)7 Query (javax.persistence.Query)6 ArrayList (java.util.ArrayList)5 ProcessResult (org.asqatasun.entity.audit.ProcessResult)4 ForbiddenPageException (org.asqatasun.webapp.exception.ForbiddenPageException)4 Contract (org.asqatasun.webapp.entity.contract.Contract)3 ForbiddenUserException (org.asqatasun.webapp.exception.ForbiddenUserException)3 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3 List (java.util.List)2 Map (java.util.Map)2 Content (org.asqatasun.entity.audit.Content)2 DefiniteResult (org.asqatasun.entity.audit.DefiniteResult)2 SSP (org.asqatasun.entity.audit.SSP)2 ResultCounter (org.asqatasun.webapp.presentation.data.ResultCounter)2 Secured (org.springframework.security.access.annotation.Secured)2 Criterion (org.asqatasun.entity.reference.Criterion)1 Theme (org.asqatasun.entity.reference.Theme)1