private void sendEmail(JsonObject jsonTestResult) {
    try {
      // check if the test passed or failed
      boolean testFailed = false;
      for (StepPhase phase : phases) {
        if (test.isLoadTest()) {
          for (TestRunner runner : test) {
            Status status = runner.getReport(phase).getActualStatus();
            if (status.equals(Status.FAILED) || status.equals(Status.BROKEN)) {
              testFailed = true;
              break;
            }
          }
        } else {
          Status status = test.getReport(phase).getActualStatus();
          if (status.equals(Status.FAILED) || status.equals(Status.BROKEN)) {
            testFailed = true;
            break;
          }
        }
      }
      endTimestamp = System.currentTimeMillis();
      EmailSender emailSender = testConfig.getEmailSender();
      logger.info("Test " + (testFailed ? "FAILED" : "PASSED"));
      if (emailSender != null
        && ((emailSender.sendOnlyOnFailure() && testFailed) || !emailSender.sendOnlyOnFailure())) {
        if (emailSender.sendJsonResults()) {
          String emailText = "\r\n";
          emailText += jsonToString(jsonTestResult);
          emailSender.send(emailText);
        } else {
          emailSender.send();
        }
      }
    } catch (Exception e) {
      logger.error(getStackTrace(e));
    }
  }
Builds the test.

@return the kite base test
@throws ClassNotFoundException the class not found exception
@throws IllegalAccessException the illegal access exception
@throws InstantiationException the instantiation exception
@throws IOException Signals that an I/O exception has occurred.
KITE-Engine/src/main/java/org/webrtc/kite/TestManager.java