private JsonObject getReportSummaryCounts(JsonArray testObjects) {
        logger.entering(testObjects);

        int runningCount = 0;
        int skippedCount = 0;
        int passedCount = 0;
        int failedCount = 0;
        String result;

        for (JsonElement test : testObjects) {
            result = test.getAsJsonObject().get("status").getAsString();
            switch (result) {
            case "Running":
                runningCount += 1;
                break;
            case "Passed":
                passedCount += 1;
                break;
            case "Failed":
                failedCount += 1;
                break;
            case "Skipped":
                skippedCount += 1;
                break;
            default:
                logger.warning("Found invalid status of the test being run. Status: " + result);
            }
        }

        JsonObject testSummary = new JsonObject();
        if (0 < runningCount) {
            testSummary.addProperty("running", runningCount);
        }
        testSummary.addProperty("passed", passedCount);
        testSummary.addProperty("failed", failedCount);
        testSummary.addProperty("skipped", skippedCount);

        logger.exiting(testSummary);
        return testSummary;
    }
private JsonObject getReportSummaryCounts ( JsonArray testObjects ) { logger . entering ( testObjects ) ; int runningCount = 0 ; int skippedCount = 0 ; int passedCount = 0 ; int failedCount = 0 ; String result ; for ( JsonElement test : testObjects ) { result = test . getAsJsonObject ( ) . get ( "status" ) . getAsString ( ) ; switch ( result ) { case "Running" : runningCount += 1 ; break ; case "Passed" : passedCount += 1 ; break ; case "Failed" : failedCount += 1 ; break ; case "Skipped" : skippedCount += 1 ; break ; default : logger . warning ( "Found invalid status of the test being run. Status: " + result ) ; } } JsonObject testSummary = new JsonObject ( ) ; if ( 0 < runningCount ) { testSummary . addProperty ( "running" , runningCount ) ; } testSummary . addProperty ( "passed" , passedCount ) ; testSummary . addProperty ( "failed" , failedCount ) ; testSummary . addProperty ( "skipped" , skippedCount ) ; logger . exiting ( testSummary ) ; return testSummary ; }
Provides a JSON object representing the counts of tests passed, failed, skipped and running.

@param testObjects
Array of the current tests as a {@link JsonArray}.
@return A {@link JsonObject} with counts for various test results.