Package org.apache.sling.junit

Examples of org.apache.sling.junit.Renderer


                return;
            }
        }

        final TestSelector selector = getTestSelector(request);
        final Renderer renderer = rendererSelector.getRenderer(selector);
        if(renderer == null) {
            throw new ServletException("No Renderer found for " + selector);
        }
        log.debug("GET request: {}", selector);

        renderer.setup(response, getClass().getSimpleName());
        renderer.info("info", "Test selector: " + selector);
       
        // Any test classes?
        final List<String> testNames = getTestNames(selector, forceReload);
        if(testNames.isEmpty()) {
            renderer.info(
                    "warning",
                    "No test classes found for selector " + selector
                    + ", check the requirements of the active " +
                    "TestsProvider services for how to supply tests."
                    );
        } else {
            try {
                testsManager.listTests(testNames, renderer);
                final String postPath = getTestExecutionPath(request, selector, renderer.getExtension());
                renderer.link("Execute these tests", postPath, "POST");
            } catch(Exception e) {
                throw new ServletException(e);
            }
        }
        renderer.cleanup();
    }
View Full Code Here


        final TestSelector selector = getTestSelector(request);
        final boolean forceReload = getForceReloadOption(request);
        log.info("POST request, executing tests: {}, {}={}",
                new Object[] { selector, FORCE_RELOAD_PARAM, forceReload});
       
        final Renderer renderer = rendererSelector.getRenderer(selector);
        if(renderer == null) {
            throw new ServletException("No Renderer found for " + selector);
        }
        renderer.setup(response, getClass().getSimpleName());
       
        final List<String> testNames = getTestNames(selector, forceReload);
        if(testNames.isEmpty()) {
            response.sendError(
                    HttpServletResponse.SC_NOT_FOUND,
                    "No tests found for " + selector);
        }
        try {
            testsManager.executeTests(testNames, renderer, selector);
        } catch(Exception e) {
            throw new ServletException(e);
        }
       
        renderer.cleanup();
    }
View Full Code Here

   
    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 {
View Full Code Here

TOP

Related Classes of org.apache.sling.junit.Renderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.