Package net.jsunit.model

Examples of net.jsunit.model.TestRunResult


            }
        }
    }

    private void addUnresponsiveResultTo(URL baseURL, List<TestRunResult> results) {
        TestRunResult unresponsiveResult = new TestRunResult(baseURL);
        unresponsiveResult.setUnresponsive();
        results.add(unresponsiveResult);
    }
View Full Code Here


    private void addResultsTo(Document responseDocument, List<TestRunResult> results) {
        if (isMultipleTestRunResultsResult(responseDocument)) {
            DistributedTestRunResult multiple = new DistributedTestRunResultBuilder().build(responseDocument);
            results.addAll(multiple._getTestRunResults());
        } else {
            TestRunResult single = new TestRunResultBuilder().build(responseDocument);
            results.add(single);
        }
    }
View Full Code Here

    public void testFailedRun() {
        DistributedTest test = new DistributedTest(source());
        TestResult testResult = test.run();
        assertFalse(testResult.wasSuccessful());
        assertEquals(1, test.getTestRunResults().size());
        TestRunResult testRunResult = test.getTestRunResults().get(0);
        assertEquals(1, testRunResult._getBrowserResults().size());
        BrowserResult browserResult = testRunResult._getBrowserResults().get(0);
        assertEquals(Browser.DEFAULT_SYSTEM_BROWSER, browserResult.getBrowser().getStartCommand());
        assertEquals(0, browserResult.getBrowser().getId());
    }
View Full Code Here

        mockHitter.urlToDocument.put(FunctionalTestConfigurationSource.REMOTE_SERVER_URL_2 + "/runner?url=foo.html", unsuccessfulResult());
        return mockHitter;
    }

    private Document successfulResult() {
        TestRunResult testRunResult = new TestRunResult();
        testRunResult.addBrowserResult(new DummyBrowserResult(true, 0, 0));
        return testRunResult.asXmlDocument();
    }
View Full Code Here

        webTester.beginAt("runner?url=foo.html");
        Document document = responseXmlDocument();
        DistributedTestRunResult distributedTestRunResult = new DistributedTestRunResultBuilder().build(document);
        List<TestRunResult> results = distributedTestRunResult._getTestRunResults();
        assertEquals(2, results.size());
        TestRunResult result0 = results.get(0);
        TestRunResult result1 = results.get(1);
        assertTrue(result0.wasSuccessful());
        assertEquals(1, result0._getBrowserResults().size());
        assertEquals(FunctionalTestConfigurationSource.REMOTE_SERVER_URL_1, result0.getUrl());
        assertFalse(result1.wasSuccessful());
        assertEquals(2, result1._getBrowserResults().size());
        assertEquals(FunctionalTestConfigurationSource.REMOTE_SERVER_URL_2, result1.getUrl());
    }
View Full Code Here

    public Document hitURL(URL url) {
        return successfulTestRunResult();
    }

    private Document successfulTestRunResult() {
        return new Document(new TestRunResult().asXml());
    }
View Full Code Here

        testStandaloneRun();
    }

    public void testStandaloneRun() throws Exception {
        testRunManager.runTests();
        TestRunResult result = testRunManager.getTestRunResult();
        if (!result.wasSuccessful()) {
            StringBuffer buffer = new StringBuffer();
            result.addErrorStringTo(buffer);
            System.err.println(buffer.toString());
            fail(result.displayString());
        }
    }
View Full Code Here

TOP

Related Classes of net.jsunit.model.TestRunResult

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.