Search in sources :

Example 6 with TenantId

use of com.yahoo.vespa.applicationmodel.TenantId in project vespa by vespa-engine.

the class NodeGroupTest method testBasics.

@Test
public void testBasics() {
    ApplicationInstance applicationInstance = new ApplicationInstance(new TenantId("tenant"), new ApplicationInstanceId("application-instance"), new HashSet<>());
    HostName hostName1 = new HostName("host1");
    HostName hostName2 = new HostName("host2");
    HostName hostName3 = new HostName("host3");
    NodeGroup nodeGroup = new NodeGroup(applicationInstance, hostName1, hostName3);
    nodeGroup.addNode(hostName2);
    // hostnames are sorted (for no good reason other than testability due to stability, readability)
    assertEquals(Arrays.asList(hostName1, hostName2, hostName3), nodeGroup.getHostNames());
    assertEquals("host1,host2,host3", nodeGroup.toCommaSeparatedString());
}
Also used : ApplicationInstanceId(com.yahoo.vespa.applicationmodel.ApplicationInstanceId) TenantId(com.yahoo.vespa.applicationmodel.TenantId) ApplicationInstance(com.yahoo.vespa.applicationmodel.ApplicationInstance) HostName(com.yahoo.vespa.applicationmodel.HostName) Test(org.junit.Test)

Aggregations

ApplicationInstanceId (com.yahoo.vespa.applicationmodel.ApplicationInstanceId)6 TenantId (com.yahoo.vespa.applicationmodel.TenantId)6 ApplicationInstanceReference (com.yahoo.vespa.applicationmodel.ApplicationInstanceReference)5 HostName (com.yahoo.vespa.applicationmodel.HostName)5 ApplicationInstance (com.yahoo.vespa.applicationmodel.ApplicationInstance)4 ClusterId (com.yahoo.vespa.applicationmodel.ClusterId)4 ConfigId (com.yahoo.vespa.applicationmodel.ConfigId)4 ServiceCluster (com.yahoo.vespa.applicationmodel.ServiceCluster)4 ServiceInstance (com.yahoo.vespa.applicationmodel.ServiceInstance)4 ServiceType (com.yahoo.vespa.applicationmodel.ServiceType)4 Test (org.junit.Test)3 ApplicationId (com.yahoo.config.provision.ApplicationId)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Map (java.util.Map)2 ApplicationInfo (com.yahoo.config.model.api.ApplicationInfo)1 HostInfo (com.yahoo.config.model.api.HostInfo)1 ServiceInfo (com.yahoo.config.model.api.ServiceInfo)1 SuperModel (com.yahoo.config.model.api.SuperModel)1 Zone (com.yahoo.config.provision.Zone)1