use of org.asqatasun.entity.subject.Site in project Asqatasun by Asqatasun.
the class ContentDAOImpl method findNumberOfRelatedContentFromWebResource.
@Override
public Long findNumberOfRelatedContentFromWebResource(WebResource webResource) {
if (webResource instanceof Page) {
Query query = entityManager.createQuery(SELECT_DISTINCT_RELATED_CONTENT + SSPImpl.class.getName() + " s" + " JOIN s.relatedContentSet rc" + JOIN_WR + WEB_RESOURCE_CONDITION + " AND s.httpStatusCode !=:httpStatusCode");
query.setParameter(WEB_RESOURCE_KEY, webResource);
query.setParameter(HTTP_STATUS_CODE_KEY, DEFAULT_HTTP_STATUS_VALUE);
return (Long) query.getSingleResult();
} else if (webResource instanceof Site) {
Query query = entityManager.createQuery(SELECT_DISTINCT_RELATED_CONTENT + SSPImpl.class.getName() + " s" + " JOIN s.relatedContentSet rc" + JOIN_WR + " WHERE w.parent.id=:idWebResource" + " AND s.httpStatusCode !=:httpStatusCode");
query.setParameter(ID_WEB_RESOURCE_KEY, webResource.getId());
query.setParameter(HTTP_STATUS_CODE_KEY, DEFAULT_HTTP_STATUS_VALUE);
return (Long) query.getSingleResult();
}
return (long) 0;
}
use of org.asqatasun.entity.subject.Site in project Asqatasun by Asqatasun.
the class CheckTitleContentUnicityAtSiteLevelTest method setUpWebResourceMap.
@Override
protected void setUpWebResourceMap() {
// file:Site-Passed1
Site site = getWebResourceFactory().createSite("file:Site-Passed1");
getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-1Passed-01", site);
Page page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-1Passed-01.html");
site.addChild(page);
getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page01", page);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-1Passed-02.html");
site.addChild(page);
getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page02", page);
// file:Site-Failed1
site = getWebResourceFactory().createSite("file:Site-Failed1");
getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-2Failed-01", site);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-2Failed-01.html");
site.addChild(page);
getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page03", page);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-2Failed-02.html");
site.addChild(page);
getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page04", page);
// file:Site-NA1
site = getWebResourceFactory().createSite("file:Site-NA1");
getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-4NA-01", site);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-4NA-01.html");
site.addChild(page);
getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page05", page);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-4NA-02.html");
site.addChild(page);
getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page06", page);
// file:Site-Passed2
site = getWebResourceFactory().createSite("file:Site-Passed2");
getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-1Passed-02", site);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-4NA-02.html");
site.addChild(page);
getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page07", page);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rulescreationdemo/CheckTitleContentUnicityAtSiteLevel/Rulescreationdemo.Test.3.1.1-1Passed-01.html");
site.addChild(page);
getWebResourceMap().put("Rulescreationdemo.Test.3.1.1-page08", page);
}
use of org.asqatasun.entity.subject.Site in project Asqatasun by Asqatasun.
the class Rgaa30Rule121104Test method setUpWebResourceMap.
@Override
protected void setUpWebResourceMap() {
getWebResourceMap().put("Rgaa30.Test.12.11.4-4NA-01", getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa30/Rgaa30Rule121104/Rgaa30.Test.12.11.4-3NMI-01.html"));
Site site = getWebResourceFactory().createSite("file:Site-NotTested");
getWebResourceMap().put("Rgaa30.Test.12.11.4-5NT-01", site);
Page page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa30/Rgaa30Rule121104/Rgaa30.Test.12.11.4-3NMI-01.html");
site.addChild(page);
getWebResourceMap().put("Rgaa30.Test.12.11.4-5NT-01-page1", page);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa30/Rgaa30Rule121104/Rgaa30.Test.12.11.4-3NMI-01.html");
site.addChild(page);
getWebResourceMap().put("Rgaa30.Test.12.11.4-5NT-01-page1", page);
}
use of org.asqatasun.entity.subject.Site in project Asqatasun by Asqatasun.
the class Rgaa30Rule120101Test method setUpWebResourceMap.
@Override
protected void setUpWebResourceMap() {
getWebResourceMap().put("Rgaa30.Test.12.01.01-4NA-01", getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa30/Rgaa30Rule120101/Rgaa30.Test.12.01.01-3NMI-01.html"));
Site site = getWebResourceFactory().createSite("file:Site-NotTested");
getWebResourceMap().put("Rgaa30.Test.12.01.01-5NT-01", site);
Page page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa30/Rgaa30Rule120101/Rgaa30.Test.12.01.01-3NMI-01.html");
site.addChild(page);
getWebResourceMap().put("Rgaa30.Test.12.01.01-5NT-01-page1", page);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa30/Rgaa30Rule120101/Rgaa30.Test.12.01.01-3NMI-01.html");
site.addChild(page);
getWebResourceMap().put("Rgaa30.Test.12.01.01-5NT-01-page1", page);
}
use of org.asqatasun.entity.subject.Site in project Asqatasun by Asqatasun.
the class Rgaa30Rule120603Test method setUpWebResourceMap.
@Override
protected void setUpWebResourceMap() {
getWebResourceMap().put("Rgaa30.Test.12.06.03-4NA-01", getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa30/Rgaa30Rule120603/Rgaa30.Test.12.06.03-3NMI-01.html"));
Site site = getWebResourceFactory().createSite("file:Site-NotTested");
getWebResourceMap().put("Rgaa30.Test.12.06.03-5NT-01", site);
Page page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa30/Rgaa30Rule120603/Rgaa30.Test.12.06.03-3NMI-01.html");
site.addChild(page);
getWebResourceMap().put("Rgaa30.Test.12.06.03-5NT-01-page1", page);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "rgaa30/Rgaa30Rule120603/Rgaa30.Test.12.06.03-3NMI-01.html");
site.addChild(page);
getWebResourceMap().put("Rgaa30.Test.12.06.03-5NT-01-page1", page);
}
Aggregations