use of org.asqatasun.entity.subject.Site in project Asqatasun by Asqatasun.
the class ContentLoaderImpl method run.
private List<Content> run(WebResource webResource) {
// TODO Handle exceptions like 404, 403, 500, ...
List<Content> localResult = new ArrayList<>();
if (webResource instanceof Page) {
downloader.setURL(webResource.getURL());
downloader.run();
String stringContent = downloader.getResult();
Content content = contentDataService.getSSP(dateFactory.createDate(), webResource.getURL(), stringContent, (Page) webResource, HTTP_CODE_OK);
localResult.add(content);
}
if (webResource instanceof Site) {
Site site = (Site) webResource;
for (WebResource component : site.getComponentList()) {
localResult.addAll(run(component));
}
}
return localResult;
}
use of org.asqatasun.entity.subject.Site in project Asqatasun by Asqatasun.
the class FileContentLoaderImpl method run.
/**
*
* @param webResource
* @return
*/
private List<Content> run(WebResource webResource) {
List<Content> localResult = new ArrayList<>();
if (webResource instanceof Page) {
Content content = contentDataService.getSSP(dateFactory.createDate(), webResource.getURL(), fileMap.get(FileNaming.removeFilePrefix(webResource.getURL())), (Page) webResource, HttpStatus.SC_OK);
localResult.add(content);
} else if (webResource instanceof Site) {
Site site = (Site) webResource;
for (WebResource component : site.getComponentList()) {
localResult.addAll(run(component));
}
}
return localResult;
}
use of org.asqatasun.entity.subject.Site in project Asqatasun by Asqatasun.
the class Aw22Rule11032Test method setUpWebResourceMap.
@Override
protected void setUpWebResourceMap() {
getWebResourceMap().put("AW22.Test.11.3.2-4NA-01", getWebResourceFactory().createPage(getTestcasesFilePath() + "accessiweb22/Aw22Rule11032/AW22.Test.11.3.2-3NMI-01.html"));
Site site = getWebResourceFactory().createSite("file:Site-NotTested");
getWebResourceMap().put("AW22.Test.11.3.2-5NT-01", site);
Page page = getWebResourceFactory().createPage(getTestcasesFilePath() + "accessiweb22/Aw22Rule11032/AW22.Test.11.3.2-3NMI-01.html");
site.addChild(page);
getWebResourceMap().put("AW22.Test.11.3.2-5NT-01-page1", page);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "accessiweb22/Aw22Rule11032/AW22.Test.11.3.2-3NMI-01.html");
site.addChild(page);
getWebResourceMap().put("AW22.Test.11.3.2-5NT-01-page1", page);
}
use of org.asqatasun.entity.subject.Site in project Asqatasun by Asqatasun.
the class Aw22Rule12051Test method setUpWebResourceMap.
@Override
protected void setUpWebResourceMap() {
getWebResourceMap().put("AW22.Test.12.5.1-4NA-01", getWebResourceFactory().createPage(getTestcasesFilePath() + "accessiweb22/Aw22Rule12051/AW22.Test.12.5.1-3NMI-01.html"));
Site site = getWebResourceFactory().createSite("file:Site-NotTested");
getWebResourceMap().put("AW22.Test.12.5.1-5NT-01", site);
Page page = getWebResourceFactory().createPage(getTestcasesFilePath() + "accessiweb22/Aw22Rule12051/AW22.Test.12.5.1-3NMI-01.html");
site.addChild(page);
getWebResourceMap().put("AW22.Test.12.5.1-5NT-01-page1", page);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "accessiweb22/Aw22Rule12051/AW22.Test.12.5.1-3NMI-01.html");
site.addChild(page);
getWebResourceMap().put("AW22.Test.12.5.1-5NT-01-page1", page);
}
use of org.asqatasun.entity.subject.Site in project Asqatasun by Asqatasun.
the class Aw22Rule12052Test method setUpWebResourceMap.
@Override
protected void setUpWebResourceMap() {
getWebResourceMap().put("AW22.Test.12.5.2-4NA-01", getWebResourceFactory().createPage(getTestcasesFilePath() + "accessiweb22/Aw22Rule12052/AW22.Test.12.5.2-3NMI-01.html"));
Site site = getWebResourceFactory().createSite("file:Site-NotTested");
getWebResourceMap().put("AW22.Test.12.5.2-5NT-01", site);
Page page = getWebResourceFactory().createPage(getTestcasesFilePath() + "accessiweb22/Aw22Rule12052/AW22.Test.12.5.2-3NMI-01.html");
site.addChild(page);
getWebResourceMap().put("AW22.Test.12.5.2-5NT-01-page1", page);
page = getWebResourceFactory().createPage(getTestcasesFilePath() + "accessiweb22/Aw22Rule12052/AW22.Test.12.5.2-3NMI-01.html");
site.addChild(page);
getWebResourceMap().put("AW22.Test.12.5.2-5NT-01-page1", page);
}
Aggregations