Package org.auraframework.test.perf.PerfResultsUtil

Examples of org.auraframework.test.perf.PerfResultsUtil.ResultsJSON


import org.json.JSONObject;

public final class PerfResultsUtilTest extends UnitTestCase {

    public void testResultsJSON() throws Exception {
        ResultsJSON resultsJSON = new ResultsJSON(false);
        JSONObject json = resultsJSON.getJSON();

        // has build info
        JSONObject build = json.getJSONObject("build");
        assertNotNull(build);

        // results files
        resultsJSON.addResultsFile(new File(PerfResultsUtil.RESULTS_DIR + "/goldfiles/ui/label.json"));
        resultsJSON.addResultsFile(new File(PerfResultsUtil.RESULTS_DIR + "/goldfiles/ui/console.json"));
        resultsJSON.addResultsFile(new File(PerfResultsUtil.RESULTS_DIR + "/goldfiles/ui/button.json"));
        resultsJSON.addResultsFile(new File(PerfResultsUtil.RESULTS_DIR + "/timelines/iteration.json"));
        JSONObject results = json.getJSONObject("results");
        assertEquals(
                "{\"timelines\":{\"list\":[\"iteration.json\"]},\"goldfiles\":{\"ui\":{\"list\":[\"button.json\",\"console.json\",\"label.json\"]}}}",
                results.toString());

        // removing results files
        resultsJSON.removeResultsFile(new File(PerfResultsUtil.RESULTS_DIR + "/goldfiles/ui/console.json"));
        assertEquals(
                "{\"timelines\":{\"list\":[\"iteration.json\"]},\"goldfiles\":{\"ui\":{\"list\":[\"button.json\",\"label.json\"]}}}",
                results.toString());
    }
View Full Code Here

TOP

Related Classes of org.auraframework.test.perf.PerfResultsUtil.ResultsJSON

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.