Package net.jsunit.configuration

Examples of net.jsunit.configuration.ServerConfiguration


    private void ensureTemporaryServerIsCreated() {
        //noinspection SynchronizeOnNonFinalField
        synchronized (blocker) {
            if (temporaryServer == null) {
                temporaryServer = serverFactory.create(new ServerConfiguration(source));
            }
        }
    }
View Full Code Here


    }

    public void setUp() throws Exception {
        super.setUp();
        RemoteMachineServerHitter serverHitter = new RemoteMachineServerHitter();
        ServerConfiguration configuration = new ServerConfiguration(source);
        List<RemoteRunSpecification> specs = new ArrayList<RemoteRunSpecification>();
        RemoteRunSpecificationBuilder builder = new RemoteRunSpecificationBuilder();
        if (remoteBrowser != null)
            specs.add(builder.forSingleRemoteBrowser(configuration.getRemoteMachineURLs().get(0), remoteBrowser));
        else
            specs.addAll(builder.forAllBrowsersFromRemoteURLs(configuration.getRemoteMachineURLs()));
        manager = new DistributedTestRunManager(serverHitter, configuration, overrideURL, specs);
        manager.setListener(new DistributedTestRunListenerImpl(configuration));
        ensureTemporaryServerIsCreated();
        startServerIfNecessary();
    }
View Full Code Here

        HashMap<String, String> config = (HashMap<String, String>)environments.get(environment);
        return config;
    }

    private void startJsUnitServer() throws Exception {
        server = new JsUnitServer(new ServerConfiguration(new DelegatingConfigurationSource(CompositeConfigurationSource.resolve())));
        server.start();
    }
View Full Code Here

    private int otherPort;

    public void setUp() throws Exception {
        super.setUp();
        otherPort = new TestPortManager().newPort();
        secondServer = new JsUnitServer(new ServerConfiguration(secondServerSource()));
        secondServer.start();
    }
View Full Code Here

    }

    public DistributedTestSuiteBuilder(ConfigurationSource localSource, RemoteServerHitter hitter) {
        this.localeSource = localSource;
        this.hitter = hitter;
        this.localConfiguration = new ServerConfiguration(localeSource);
    }
View Full Code Here

    public void testSimple() throws Exception {
        String remoteMachineURL = "http://localhost:" + port() + "/jsunit";
        RemoteConfigurationSource source = new RemoteConfigurationSource(new RemoteMachineServerHitter(), remoteMachineURL);
        assertTrue(source.isInitialized());
        ServerConfiguration remoteConfiguration = new ServerConfiguration(source);
        assertEquals(
                XmlUtility.asString(server.getConfiguration().asXml()),
                XmlUtility.asString(remoteConfiguration.asXml())
        );
    }
View Full Code Here

    private MockBrowserResultRepository mockBrowserResultRepository;
    private Browser browser;

    public void setUp() throws Exception {
        super.setUp();
        ServerConfiguration configuration = new ServerConfiguration(new StubConfigurationSource() {

            public String browserFileNames() {
                return "browser1.exe,browser2.exe,browser3.exe";
            }
View Full Code Here

public class RemoteConfigurationFetcherTest extends TestCase {

    public void testSimple() throws Exception {
        String remoteMachineURL = "http://www.example.com/jsunit";
        MockRemoteServerHitter hitter = new MockRemoteServerHitter();
        ServerConfiguration configuration = new ServerConfiguration(new DummyConfigurationSource());
        Document configurationDocument = new Document(configuration.asXml());
        hitter.urlToDocument.put(remoteMachineURL + "/config", configurationDocument);
        RemoteConfigurationFetcher fetcher = new RemoteConfigurationFetcher(hitter, new URL(remoteMachineURL));
        fetcher.start();
        fetcher.join();
        assertEquals(remoteMachineURL, fetcher.getRemoteMachineURL().toString());
        assertTrue(configuration.equals(fetcher.getRetrievedRemoteConfiguration()));
    }
View Full Code Here

    private ServerConfiguration configuration;

    public void setUp() throws Exception {
        super.setUp();
        configuration = new ServerConfiguration(new DummyConfigurationSource());
    }
View Full Code Here

        assertEquals(DummyConfigurationSource.REMOTE_URL_2, testRunResults.get(1).getUrl());
        assertEquals(ResultType.UNRESPONSIVE, testRunResults.get(1)._getResultType());
    }

    public void testRemoteURLBlowsUpButIgnored() throws MalformedURLException {
        configuration = new ServerConfiguration(new DummyConfigurationSource() {
            public String ignoreUnresponsiveRemoteMachines() {
                return "true";
            }
        });
        assertTrue(configuration.shouldIgnoreUnresponsiveRemoteMachines());
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.