use of com.netflix.discovery.shared.Application in project eureka by Netflix.
the class BackUpRegistryTest method testRemoteEnabledButLocalOnlyQueried.
@Test
public void testRemoteEnabledButLocalOnlyQueried() throws Exception {
setUp(true);
Applications applications = client.getApplications();
List<Application> registeredApplications = applications.getRegisteredApplications();
Assert.assertNotNull("Local region apps not found.", registeredApplications);
// Remote region comes with no instances.
Assert.assertEquals("Local apps size not as expected.", 2, registeredApplications.size());
Application localRegionApp = null;
Application remoteRegionApp = null;
for (Application registeredApplication : registeredApplications) {
if (registeredApplication.getName().equals(LOCAL_REGION_APP_NAME)) {
localRegionApp = registeredApplication;
} else if (registeredApplication.getName().equals(REMOTE_REGION_APP_NAME)) {
remoteRegionApp = registeredApplication;
}
}
Assert.assertNotNull("Local region apps not present.", localRegionApp);
Assert.assertTrue("Remote region instances returned for local query.", null == remoteRegionApp || remoteRegionApp.getInstances().isEmpty());
}
use of com.netflix.discovery.shared.Application 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);
}
use of com.netflix.discovery.shared.Application 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);
}
use of com.netflix.discovery.shared.Application 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);
}
use of com.netflix.discovery.shared.Application 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);
}
Aggregations