@Test
  public void testAbortedCalculation() throws Exception {
    // a single task that is aborted
    Collection<HostRoleCommandEntity> tasks = getTaskEntities(HostRoleStatus.ABORTED);
    CalculatedStatus status = CalculatedStatus.statusFromTaskEntities(tasks, false);
    assertEquals(HostRoleStatus.ABORTED, status.getStatus());
    assertEquals(100.0, status.getPercent(), 0.1);

    // skippable
    status = CalculatedStatus.statusFromTaskEntities(tasks, true);
    assertEquals(HostRoleStatus.ABORTED, status.getStatus());
    assertEquals(100.0, status.getPercent(), 0.1);

    // a completed task and an aborted one
    tasks = getTaskEntities(HostRoleStatus.COMPLETED, HostRoleStatus.ABORTED);
    status = CalculatedStatus.statusFromTaskEntities(tasks, false);
    assertEquals(HostRoleStatus.ABORTED, status.getStatus());
    assertEquals(100.0, status.getPercent(), 0.1);

    // skippable
    status = CalculatedStatus.statusFromTaskEntities(tasks, true);
    assertEquals(HostRoleStatus.ABORTED, status.getStatus());
    assertEquals(100.0, status.getPercent(), 0.1);
  }
Tests that aborted states calculate correctly. This is needed for upgrades
where the upgrade can be ABORTED and must not be calculated as COMPLETED.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java