Search in sources :

Example 36 with InstanceInfo

use of com.netflix.appinfo.InstanceInfo in project eureka by Netflix.

the class BaseDiscoveryClientTester method setupDiscoveryClient.

protected void setupDiscoveryClient(int renewalIntervalInSecs) {
    InstanceInfo instanceInfo = newInstanceInfoBuilder(renewalIntervalInSecs).build();
    client = DiscoveryClientResource.setupDiscoveryClient(instanceInfo);
}
Also used : InstanceInfo(com.netflix.appinfo.InstanceInfo)

Example 37 with InstanceInfo

use of com.netflix.appinfo.InstanceInfo in project eureka by Netflix.

the class BaseDiscoveryClientTester method createLocalApps.

protected static List<Application> createLocalApps() {
    Application myapp1 = new Application(LOCAL_REGION_APP1_NAME);
    InstanceInfo instanceInfo1 = createInstance(LOCAL_REGION_APP1_NAME, ALL_REGIONS_VIP1_ADDR, LOCAL_REGION_APP1_INSTANCE1_HOSTNAME, null);
    myapp1.addInstance(instanceInfo1);
    Application myapp2 = new Application(LOCAL_REGION_APP2_NAME);
    InstanceInfo instanceInfo2 = createInstance(LOCAL_REGION_APP2_NAME, ALL_REGIONS_VIP2_ADDR, LOCAL_REGION_APP2_INSTANCE1_HOSTNAME, null);
    myapp2.addInstance(instanceInfo2);
    return Arrays.asList(myapp1, myapp2);
}
Also used : Application(com.netflix.discovery.shared.Application) InstanceInfo(com.netflix.appinfo.InstanceInfo)

Example 38 with InstanceInfo

use of com.netflix.appinfo.InstanceInfo in project eureka by Netflix.

the class BaseDiscoveryClientTester method createRemoteApps.

protected static List<Application> createRemoteApps() {
    Application myapp1 = new Application(REMOTE_REGION_APP1_NAME);
    InstanceInfo instanceInfo1 = createInstance(REMOTE_REGION_APP1_NAME, ALL_REGIONS_VIP1_ADDR, REMOTE_REGION_APP1_INSTANCE1_HOSTNAME, REMOTE_ZONE);
    myapp1.addInstance(instanceInfo1);
    Application myapp2 = new Application(REMOTE_REGION_APP2_NAME);
    InstanceInfo instanceInfo2 = createInstance(REMOTE_REGION_APP2_NAME, ALL_REGIONS_VIP2_ADDR, REMOTE_REGION_APP2_INSTANCE1_HOSTNAME, REMOTE_ZONE);
    myapp2.addInstance(instanceInfo2);
    return Arrays.asList(myapp1, myapp2);
}
Also used : Application(com.netflix.discovery.shared.Application) InstanceInfo(com.netflix.appinfo.InstanceInfo)

Example 39 with InstanceInfo

use of com.netflix.appinfo.InstanceInfo in project eureka by Netflix.

the class BaseDiscoveryClientTester method createLocalAppsDelta.

protected static List<Application> createLocalAppsDelta() {
    Application myapp1 = new Application(LOCAL_REGION_APP1_NAME);
    InstanceInfo instanceInfo1 = createInstance(LOCAL_REGION_APP1_NAME, ALL_REGIONS_VIP1_ADDR, LOCAL_REGION_APP1_INSTANCE2_HOSTNAME, null);
    instanceInfo1.setActionType(InstanceInfo.ActionType.ADDED);
    myapp1.addInstance(instanceInfo1);
    Application myapp2 = new Application(LOCAL_REGION_APP2_NAME);
    InstanceInfo instanceInfo2 = createInstance(LOCAL_REGION_APP2_NAME, ALL_REGIONS_VIP2_ADDR, LOCAL_REGION_APP2_INSTANCE2_HOSTNAME, null);
    instanceInfo2.setActionType(InstanceInfo.ActionType.ADDED);
    myapp2.addInstance(instanceInfo2);
    return Arrays.asList(myapp1, myapp2);
}
Also used : Application(com.netflix.discovery.shared.Application) InstanceInfo(com.netflix.appinfo.InstanceInfo)

Example 40 with InstanceInfo

use of com.netflix.appinfo.InstanceInfo in project eureka by Netflix.

the class BaseDiscoveryClientTester method addLocalAppDelta.

protected void addLocalAppDelta() {
    Application myappDelta = new Application(LOCAL_REGION_APP3_NAME);
    InstanceInfo instanceInfo = createInstance(LOCAL_REGION_APP3_NAME, ALL_REGIONS_VIP3_ADDR, LOCAL_REGION_APP3_INSTANCE1_HOSTNAME, null);
    instanceInfo.setActionType(InstanceInfo.ActionType.ADDED);
    myappDelta.addInstance(instanceInfo);
    mockLocalEurekaServer.addLocalRegionAppsDelta(LOCAL_REGION_APP3_NAME, myappDelta);
}
Also used : Application(com.netflix.discovery.shared.Application) InstanceInfo(com.netflix.appinfo.InstanceInfo)

Aggregations

InstanceInfo (com.netflix.appinfo.InstanceInfo)192 Test (org.junit.Test)74 Application (com.netflix.discovery.shared.Application)35 Applications (com.netflix.discovery.shared.Applications)22 AmazonInfo (com.netflix.appinfo.AmazonInfo)21 ArrayList (java.util.ArrayList)19 InstanceStatus (com.netflix.appinfo.InstanceInfo.InstanceStatus)11 Before (org.junit.Before)11 DiscoveryClient (com.netflix.discovery.DiscoveryClient)10 DecoderWrapper (com.netflix.discovery.converters.wrappers.DecoderWrapper)10 Lease (com.netflix.eureka.lease.Lease)9 HashMap (java.util.HashMap)8 Response (javax.ws.rs.core.Response)8 DataCenterInfo (com.netflix.appinfo.DataCenterInfo)7 CodecWrappers (com.netflix.discovery.converters.wrappers.CodecWrappers)7 EncoderWrapper (com.netflix.discovery.converters.wrappers.EncoderWrapper)7 ByteArrayInputStream (java.io.ByteArrayInputStream)7 ApplicationInfoManager (com.netflix.appinfo.ApplicationInfoManager)6 EurekaEntityFunctions.mergeApplications (com.netflix.discovery.util.EurekaEntityFunctions.mergeApplications)6 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)6