@Test
    public void testSeparateClusters() {
        String xmlWithNodes =
                "<?xml version='1.0' encoding='utf-8' ?>" +
                "<services>" +
                "  <container version='1.0' id='container1'>" +
                "     <search/>" +
                "     <nodes count='1'/>" +
                "  </container>" +
                "  <container version='1.0' id='container2'>" +
                "     <search/>" +
                "     <nodes count='1'>" +
                "       <resources vcpu='10' memory='100Gb' disk='1Tb'/>" +
                "     </nodes>" +
                "  </container>" +
                "  <content version='1.0' id='content1'>" +
                "     <redundancy>2</redundancy>" +
                "     <documents>" +
                "       <document type='type1' mode='index'/>" +
                "     </documents>" +
                "     <nodes count='2'/>" +
                "   </content>" +
                "  <content version='1.0'>" +
                "     <redundancy>2</redundancy>" +
                "     <documents>" +
                "       <document type='type1' mode='index'/>" +
                "     </documents>" +
                "     <nodes count='2'/>" +
                "   </content>" +
                "</services>";
        VespaModelTester tester = new VespaModelTester();
        tester.addHosts(8);
        tester.addHosts(new NodeResources(20, 200, 2000, 1.0), 1);
        VespaModel model = tester.createModel(xmlWithNodes, true, deployStateWithClusterEndpoints("container1", "container2"));

        assertEquals(2, model.getContentClusters().get("content1").getRootGroup().getNodes().size(), "Nodes in content1");
        assertEquals(1, model.getContainerClusters().get("container1").getContainers().size(), "Nodes in container1");
        assertEquals(2, model.getContentClusters().get("content").getRootGroup().getNodes().size(), "Nodes in cluster without ID");
        assertEquals(85, physicalMemoryPercentage(model.getContainerClusters().get("container1")), "Heap size for container1");
        assertEquals(85, physicalMemoryPercentage(model.getContainerClusters().get("container2")), "Heap size for container2");
        assertProvisioned(2, ClusterSpec.Id.from("content1"), ClusterSpec.Type.content, model);
        assertProvisioned(1, ClusterSpec.Id.from("container1"), ClusterSpec.Type.container, model);
        assertProvisioned(2, ClusterSpec.Id.from("content"), ClusterSpec.Type.content, model);
    }
Test cases for provisioning nodes to entire Vespa models.

@author Vegard Havdal
@author bratseth
config-model/src/test/java/com/yahoo/config/model/provision/ModelProvisioningTest.java