Package net.jsunit.configuration

Examples of net.jsunit.configuration.DummyConfigurationSource


public class DistributedTestSuiteBuilderTest extends TestCase {
    private DistributedTestSuiteBuilder builder;

    protected void setUp() throws Exception {
        super.setUp();
        DummyConfigurationSource originalSource = new DummyConfigurationSource();
        MockRemoteServerHitter mockHitter = new MockRemoteServerHitter();
        originalSource.setNeeds3rdRemoteMachineURL();
        mockHitter.urlToDocument.put(DummyConfigurationSource.REMOTE_URL_1 + "/config", remoteConfiguration1XmlDocument());
        mockHitter.urlToDocument.put(DummyConfigurationSource.REMOTE_URL_2 + "/config", remoteConfiguration2XmlDocument());
        mockHitter.urlToDocument.put(DummyConfigurationSource.REMOTE_URL_3 + "/config", remoteConfiguration3XmlDocument());
        builder = new DistributedTestSuiteBuilder(originalSource, mockHitter);
    }
View Full Code Here


        assertEquals(ServerType.AGGREGATE, server.serverType());
    }

    public void testStartCachesRemoteConfigurations() throws Exception {
        MockRemoteServerHitter hitter = new MockRemoteServerHitter();
        server = new JsUnitAggregateServer(new AggregateConfiguration(new DummyConfigurationSource()), hitter);
        hitter.urlToDocument.put(DummyConfigurationSource.REMOTE_URL_1 + "/config", configuration1Document());
        hitter.urlToDocument.put(DummyConfigurationSource.REMOTE_URL_2 + "/config", configurationToDocument());
        server.preStart();
        assertEquals(2, hitter.urlsPassed.size());
        assertTrue(hitter.urlsPassed.contains(DummyConfigurationSource.REMOTE_URL_1 + "/config"));
View Full Code Here

        assertEquals(2, server.getCachedRemoteConfigurations().size());
    }

    public void testStartServerWithBlowingUpRemoteServer() throws Exception {
        BlowingUpRemoteServerHitter hitter = new BlowingUpRemoteServerHitter();
        server = new JsUnitAggregateServer(new AggregateConfiguration(new DummyConfigurationSource()), hitter);
        server.preStart();
        assertTrue(server.getCachedRemoteConfigurations().isEmpty());
    }
View Full Code Here

        server.preStart();
        assertTrue(server.getCachedRemoteConfigurations().isEmpty());
    }

    private Document configuration1Document() {
        return new Document(new AggregateConfiguration(new DummyConfigurationSource() {
            public String browserFileNames() {
                return "/usr/bin/mozilla,/usr/bin/firefox";
            }
        }).asXml());
    }
View Full Code Here

            }
        }).asXml());
    }

    private Document configurationToDocument() {
        return new Document(new AggregateConfiguration(new DummyConfigurationSource() {
            public String browserFileNames() {
                return "c:\\program files\\iexplore.exe,c:\\program files\\netscape6.exe";
            }
        }).asXml());
    }
View Full Code Here

    private DistributedTestRunnerAction action;

    public void setUp() throws Exception {
        super.setUp();
        action = new DistributedTestRunnerAction();
        action.setAggregateServer(new JsUnitAggregateServer(new AggregateConfiguration(new DummyConfigurationSource())));
        action.setRemoteServerHitter(new SuccessfulRemoteServerHitter());
    }
View Full Code Here

    private JsUnitServer server;

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

                starter.commandPassed[1]
        );
    }

    public void testNoURLSpecified() throws Exception {
        server = new JsUnitServer(new ServerConfiguration(new DummyConfigurationSource() {
            public String url() {
                return "";
            }
        }), new MockBrowserResultRepository());
        MockProcessStarter starter = new MockProcessStarter();
View Full Code Here

import net.jsunit.utility.XmlUtility;

public class AggregateConfigurationActionTest extends TestCase {

    public void testSimple() throws Exception {
        AggregateConfiguration configuration = new AggregateConfiguration(new DummyConfigurationSource());
        AggregateConfigurationAction action = new AggregateConfigurationAction();
        action.setAggregateServer(new JsUnitAggregateServer(configuration));

        assertEquals(Action.SUCCESS, action.execute());
        assertEquals(XmlUtility.asPrettyString(configuration.asXml()), XmlUtility.asPrettyString(action.asXml()));
View Full Code Here

public class AggregateServerInterceptorTest extends TestCase {

    public void testSimple() throws Exception {
        MockAction action = new MockAction();
        JsUnitAggregateServer server = new JsUnitAggregateServer(new AggregateConfiguration(new DummyConfigurationSource()));
        assertNull(action.aggregateServer);
        AggregateServerInterceptor interceptor = new AggregateServerInterceptor();

        MockActionInvocation mockInvocation = new MockActionInvocation(action);
        interceptor.intercept(mockInvocation);
View Full Code Here

TOP

Related Classes of net.jsunit.configuration.DummyConfigurationSource

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.