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();
}
Aggregations