use of com.yahoo.vespa.config.server.application.FileDistributionStatus.HostStatus in project vespa by vespa-engine.
the class FileDistributionStatusTest method require_different_statuses_many_hosts.
@Test
public void require_different_statuses_many_hosts() throws IOException {
application = createApplication("localhost", "localhost2");
Map<String, Double> fileReferenceStatuses = new HashMap<>();
fileReferenceStatuses.put("1234", 0.2);
fileReferenceStatuses.put("abcd", 1.0);
HostStatus localhost = statusWithError("localhost", Status.IN_PROGRESS, fileReferenceStatuses, "connection timed out");
Map<String, Double> fileReferenceStatuses2 = new HashMap<>();
fileReferenceStatuses2.put("1234", 1.0);
HostStatus localhost2 = statusFinished("localhost2", Status.FINISHED, fileReferenceStatuses2);
FileDistributionStatus status = new MockStatus(new HashSet<>(Arrays.asList(localhost, localhost2)));
application = createApplication("localhost", "localhost2");
HttpResponse response = getStatus(status, application);
assertResponse(200, "{" + "\"hosts\":[" + "{\"hostname\":\"localhost\"," + "\"status\":\"IN_PROGRESS\"," + "\"message\":\"connection timed out\"," + "\"fileReferences\":[" + "{\"1234\":0.2},{\"abcd\":1.0}]}," + "{\"hostname\":\"localhost2\"," + "\"status\":\"FINISHED\"," + "\"fileReferences\":[" + "{\"1234\":1.0}]}" + "]," + "\"status\":\"IN_PROGRESS\"}", response);
}
Aggregations