public Result execute()

in src/main/java/org/apache/sling/junit/healthcheck/impl/JUnitHealthCheck.java [152:172]


    public Result execute() {
        final String extension ="json";
        final FormattingResultLog resultLog = new FormattingResultLog();
        final CustomRunListener listener = new CustomRunListener(resultLog);
        final Renderer r = new CustomRenderer(listener, extension, resultLog);
        final Collection<String> testNames = testsManager.getTestNames(testSelector);
        if(testNames.isEmpty()) {
            resultLog.warn("No tests found for selector {}", testSelector);
        } else {
            try {
                testsManager.executeTests(testNames, r, testSelector);
                if(listener.nTests == 0) {
                    resultLog.warn("No tests executed by {}", testSelector);
                }
            } catch(Exception e) {
                resultLog.warn("Exception while executing tests (" + testSelector + ")" + e);
            }
        }
        
        return new Result(resultLog);
    }