@Test
    public void testCombinedClusterWithJvmHeapSizeOverride() {
        String xmlWithNodes =
                "<?xml version='1.0' encoding='utf-8' ?>" +
                        "<services>" +
                        "  <container version='1.0' id='container1'>" +
                        "     <search/>" +
                        "     <nodes of='content1'>" +
                        "      <jvm allocated-memory=\"30%\"/>" +
                        "     </nodes>" +
                        "  </container>" +
                        "  <content version='1.0' id='content1'>" +
                        "     <redundancy>2</redundancy>" +
                        "     <documents>" +
                        "       <document type='type1' mode='index'/>" +
                        "     </documents>" +
                        "     <nodes count='2'>" +
                        "       <resources vcpu='1' memory='3Gb' disk='9Gb'/>" +
                        "     </nodes>" +
                        "   </content>" +
                        "</services>";
        VespaModelTester tester = new VespaModelTester();
        tester.addHosts(5);
        VespaModel model = tester.createModel(xmlWithNodes, true, deployStateWithClusterEndpoints("container1"));
        assertEquals(2, model.getContentClusters().get("content1").getRootGroup().getNodes().size(), "Nodes in content1");
        assertEquals(2, model.getContainerClusters().get("container1").getContainers().size(), "Nodes in container1");
        assertEquals(30, physicalMemoryPercentage(model.getContainerClusters().get("container1")), "Heap size is lowered with combined clusters");
        assertEquals((long) ((3 - memoryOverheadGb) * (Math.pow(1024, 3)) * (1 - 0.30)), protonMemorySize(model.getContentClusters()
                                                                                                                   .get("content1")), "Memory for proton is lowered to account for the jvm heap");
        assertProvisioned(0, ClusterSpec.Id.from("container1"), ClusterSpec.Type.container, model);
        assertProvisioned(2, ClusterSpec.Id.from("content1"), ClusterSpec.Id.from("container1"), ClusterSpec.Type.combined, 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