Search in sources :

Example 1 with PageTemplates

use of com.yahoo.vespa.model.container.search.PageTemplates in project vespa by vespa-engine.

the class PageTemplatesTestCase method testExport.

@Test
public void testExport() throws IOException {
    List<NamedReader> pageFiles = new ArrayList<>(2);
    pageFiles.add(new NamedReader(root + "/slottingSerp.xml", IOUtils.createReader(root + "/slottingSerp.xml")));
    pageFiles.add(new NamedReader(root + "/richSerp.xml", IOUtils.createReader(root + "/richSerp.xml")));
    pageFiles.add(new NamedReader(root + "/footer.xml", IOUtils.createReader(root + "/footer.xml")));
    pageFiles.add(new NamedReader(root + "/richerSerp.xml", IOUtils.createReader(root + "/richerSerp.xml")));
    pageFiles.add(new NamedReader(root + "/header.xml", IOUtils.createReader(root + "/header.xml")));
    assertEquals(IOUtils.readFile(new File(root, "/pages.cfg")), StringUtilities.implodeMultiline(ConfigInstance.serialize(new PageTemplates(pageFiles).getConfig())));
}
Also used : ArrayList(java.util.ArrayList) NamedReader(com.yahoo.io.reader.NamedReader) PageTemplates(com.yahoo.vespa.model.container.search.PageTemplates) File(java.io.File) Test(org.junit.Test)

Aggregations

NamedReader (com.yahoo.io.reader.NamedReader)1 PageTemplates (com.yahoo.vespa.model.container.search.PageTemplates)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1