use of com.yahoo.prelude.templates.PageTemplateSet in project vespa by vespa-engine.
the class PageWithBlendingTestCase method testExecution.
@Test
public void testExecution() {
// Create the page template
Choice page = Choice.createSingleton(importPage("PageWithBlending.xml"));
// Create a federated result
Query query = new Query();
Result result = new Result(query);
result.hits().add(createHits("news", 2));
result.hits().add(createHits("htmlSource", 1));
// Resolve (noop here)
Resolver resolver = new DeterministicResolver();
Resolution resolution = resolver.resolve(page, query, result);
// Execute
Organizer organizer = new Organizer();
organizer.organize(page, resolution, result);
// Check rendering
assertRendered(result, "PageWithBlendingResult.xml", new PageTemplateSet());
}
use of com.yahoo.prelude.templates.PageTemplateSet in project vespa by vespa-engine.
the class SourceChoiceTestCase method testExecution.
@Test
public void testExecution() {
// Create the page template
Choice page = Choice.createSingleton(importPage("SourceChoice.xml"));
// Create a federated result
Query query = new Query();
Result result = new Result(query);
result.hits().add(createHits("web", 3));
result.hits().add(createHits("news", 3));
result.hits().add(createHits("blog", 3));
// Resolve (noop here)
Resolver resolver = new DeterministicResolver();
Resolution resolution = resolver.resolve(page, query, result);
// Execute
Organizer organizer = new Organizer();
organizer.organize(page, resolution, result);
// Check rendering
assertRendered(result, "SourceChoiceResult.xml", new PageTemplateSet(), true);
}
use of com.yahoo.prelude.templates.PageTemplateSet in project vespa by vespa-engine.
the class PageTestCase method testExecution.
@Test
public void testExecution() {
// Create the page template
Choice page = Choice.createSingleton(importPage("Page.xml"));
// Create a federated result
Query query = new Query();
Result result = new Result(query);
result.hits().add(createHits("news", 2));
result.hits().add(createHits("htmlSource", 1));
// Resolve (noop here)
Resolver resolver = new DeterministicResolver();
Resolution resolution = resolver.resolve(page, query, result);
// Execute
Organizer organizer = new Organizer();
organizer.organize(page, resolution, result);
// Check rendering
assertRendered(result, "PageResult.xml", new PageTemplateSet());
}
use of com.yahoo.prelude.templates.PageTemplateSet in project vespa by vespa-engine.
the class PageWithSourceRendererTestCase method testExecution.
@Test
public void testExecution() {
// Create the page template
Choice page = Choice.createSingleton(importPage("PageWithSourceRenderer.xml"));
// Create a federated result
Query query = new Query();
Result result = new Result(query);
result.hits().add(createHits("news", 2));
result.hits().add(createHits("htmlSource", 1));
// Resolve
Resolver resolver = new DeterministicResolver();
Resolution resolution = resolver.resolve(page, query, result);
// Execute
Organizer organizer = new Organizer();
organizer.organize(page, resolution, result);
// Check rendering
assertRendered(result, "PageWithSourceRendererResult.xml", new PageTemplateSet());
}
Aggregations