use of com.yahoo.vespa.model.test.VespaModelTester in project vespa by vespa-engine.
the class ModelProvisioningTest method test2ContentNodesProduces1ClusterController.
@Test
public void test2ContentNodesProduces1ClusterController() {
String services = "<?xml version='1.0' encoding='utf-8' ?>\n" + "<services>" + " <content version='1.0' id='bar'>" + " <redundancy>2</redundancy>" + " <documents>" + " <document type='type1' mode='index'/>" + " </documents>" + " <nodes count='2'/>" + " </content>" + "</services>";
int numberOfHosts = 2;
VespaModelTester tester = new VespaModelTester();
tester.addHosts(numberOfHosts);
VespaModel model = tester.createModel(services, true);
assertThat(model.getRoot().getHostSystem().getHosts().size(), is(numberOfHosts));
ContentCluster cluster = model.getContentClusters().get("bar");
ContainerCluster clusterControllers = cluster.getClusterControllers();
assertEquals(1, clusterControllers.getContainers().size());
}
use of com.yahoo.vespa.model.test.VespaModelTester in project vespa by vespa-engine.
the class ModelProvisioningTest method testNoNodeTagMeans1Node.
@Test
public void testNoNodeTagMeans1Node() {
String services = "<?xml version='1.0' encoding='utf-8' ?>\n" + "<services>" + " <jdisc id='foo' version='1.0'>" + " <search/>" + " <document-api/>" + " </jdisc>" + " <content version='1.0' id='bar'>" + " <documents>" + " <document type='type1' mode='index'/>" + " </documents>" + " </content>" + "</services>";
VespaModelTester tester = new VespaModelTester();
tester.addHosts(1);
VespaModel model = tester.createModel(services, true);
assertEquals(1, model.getRoot().getHostSystem().getHosts().size());
assertEquals(1, model.getAdmin().getSlobroks().size());
assertEquals(1, model.getContainerClusters().get("foo").getContainers().size());
assertEquals(1, model.getContentClusters().get("bar").getRootGroup().countNodes());
}
use of com.yahoo.vespa.model.test.VespaModelTester in project vespa by vespa-engine.
the class ModelProvisioningTest method testClusterControllersCanSupplementWithAllContainerClusters.
@Test
public void testClusterControllersCanSupplementWithAllContainerClusters() throws ParseException {
String services = "<?xml version='1.0' encoding='utf-8' ?>\n" + "<services>" + " <admin version='4.0'/>" + " <container version='1.0' id='foo1'>" + " <nodes count='2'/>" + " </container>" + " <container version='1.0' id='foo2'>" + " <nodes count='1'/>" + " </container>" + " <content version='1.0' id='bar'>" + " <redundancy>2</redundancy>" + " <documents>" + " <document type='type1' mode='index'/>" + " </documents>" + " <controllers><nodes dedicated='false' count='5'/></controllers>" + " <nodes count='2'/>" + " </content>" + "</services>";
int numberOfHosts = 5;
VespaModelTester tester = new VespaModelTester();
tester.addHosts(numberOfHosts);
VespaModel model = tester.createModel(services, true);
assertThat(model.getRoot().getHostSystem().getHosts().size(), is(numberOfHosts));
ContentCluster cluster = model.getContentClusters().get("bar");
ContainerCluster clusterControllers = cluster.getClusterControllers();
// TODO: Expected 5 with this feature reactivated
assertEquals(1, clusterControllers.getContainers().size());
}
Aggregations