Search in sources :

Example 1 with Content

use of com.yahoo.vespa.model.content.Content in project vespa by vespa-engine.

the class ClusterTest method newContentCluster.

private static ContentCluster newContentCluster(String contentSearchXml, boolean globalDocType) throws ParseException {
    ApplicationPackage app = new MockApplicationPackage.Builder().withHosts(joinLines("<hosts>", "  <host name='localhost'><alias>my_host</alias></host>", "</hosts>")).withServices(joinLines("<services version='1.0'>", "  <admin version='2.0'>", "    <adminserver hostalias='my_host' />", "  </admin>", "  <content version='1.0'>", "    <documents>", "    " + getDocumentXml(globalDocType), "    </documents>", "    <engine><proton /></engine>", "    <group>", "      <node hostalias='my_host' distribution-key='0' />", "    </group>", contentSearchXml, "  </content>", "</services>")).withSearchDefinitions(ApplicationPackageUtils.generateSearchDefinition("my_document")).build();
    List<Content> contents = new TestDriver().buildModel(app).getConfigModels(Content.class);
    assertEquals(1, contents.size());
    return contents.get(0).getCluster();
}
Also used : Content(com.yahoo.vespa.model.content.Content) SearchBuilder(com.yahoo.searchdefinition.SearchBuilder) ApplicationPackage(com.yahoo.config.application.api.ApplicationPackage) MockApplicationPackage(com.yahoo.config.model.test.MockApplicationPackage) TestDriver(com.yahoo.config.model.test.TestDriver)

Aggregations

ApplicationPackage (com.yahoo.config.application.api.ApplicationPackage)1 MockApplicationPackage (com.yahoo.config.model.test.MockApplicationPackage)1 TestDriver (com.yahoo.config.model.test.TestDriver)1 SearchBuilder (com.yahoo.searchdefinition.SearchBuilder)1 Content (com.yahoo.vespa.model.content.Content)1