Package net.jsunit.configuration

Examples of net.jsunit.configuration.ServerConfiguration


        assertTrue(hitter.urlsPassed.contains(url1));
        assertTrue(hitter.urlsPassed.contains(url2));
    }

    public void testNoURL() throws Exception {
        configuration = new ServerConfiguration(new DummyConfigurationSource() {
            public String url() {
                return null;
            }
        });
        String url1 = DummyConfigurationSource.REMOTE_URL_1 + "/runner";
View Full Code Here


        super.setUp();
        baseURL = "http://www.example.com:1234/jsunit";
    }

    public void testSimple() throws Exception {
        ServerConfiguration configuration = new ServerConfiguration(new DummyConfigurationSource());
        MockRemoteServerHitter mockHitter = new MockRemoteServerHitter();
        mockHitter.urlToDocument.put(baseURL + "/config", new Document(configuration.asXml()));

        RemoteConfigurationSource remoteSource = new RemoteConfigurationSource(mockHitter, baseURL);
        assertTrue(remoteSource.isInitialized());

        ServerConfiguration remoteConfiguration = new ServerConfiguration(remoteSource);
        assertEquals(XmlUtility.asString(configuration.asXml()),
                XmlUtility.asString(remoteConfiguration.asXml())
        );
    }
View Full Code Here

    }

    public static Test suite() {
        TestSuite suite = new TestSuite();
        ConfigurationSource originalSource = CompositeConfigurationSource.resolve();
        ServerConfiguration configuration = new ServerConfiguration(originalSource);
        for (final Browser browser : configuration.getBrowsers())
            suite.addTest(new StandaloneTest(new DelegatingConfigurationSource(originalSource) {
                public String browserFileNames() {
                    return browser.getFullFileName();
                }
            }));
View Full Code Here

        return suite;
    }

    public void setUp() throws Exception {
        super.setUp();
        server = new JsUnitServer(new ServerConfiguration(configurationSource));
        server.start();
        testRunManager = createTestRunManager();
    }
View Full Code Here

        assertEquals(browser0, retrieved.get(0));
        assertEquals(browser1, retrieved.get(1));
    }

    public void testBuildURLNoBrowsers() throws Exception {
        URL url = spec.buildFullURL(new ServerConfiguration(new DummyConfigurationSource()), overrideURL);
        assertEquals("http://www.example.com/runner?url=" + URLEncoder.encode(overrideURL, "UTF-8"), url.toString());
    }
View Full Code Here

    public void testBuildURLWithBrowsers() throws Exception {
        spec.addBrowser(new Browser("browser8.exe", 8));
        spec.addBrowser(new Browser("browser4.exe", 4));
        URL url = spec.buildFullURL(
                new ServerConfiguration(new DummyConfigurationSource()),
                overrideURL
        );
        assertEquals(
                "http://www.example.com/runner?url=" + URLEncoder.encode(overrideURL, "UTF-8") + "&browserId=8&browserId=4",
                url.toString()
View Full Code Here

    }

    public static void main(String args[]) {
        try {
            ConfigurationSource source = CompositeConfigurationSource.forArguments(args);
            JsUnitServer server = new JsUnitServer(new ServerConfiguration(source));
            server.start();
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }
View Full Code Here

TOP

Related Classes of net.jsunit.configuration.ServerConfiguration

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.