Package net.jsunit.configuration

Examples of net.jsunit.configuration.AggregateConfiguration


    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


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

    protected static JsUnitAggregateServer server;
    private MockRemoteServerHitter mockHitter;

    protected JsUnitAggregateServer createServer() {
        final int port = new TestPortManager().newPort();
        AggregateConfiguration configuration = new AggregateConfiguration(new FunctionalTestConfigurationSource(port));
        JsUnitAggregateServer result = new JsUnitAggregateServer(configuration, mockHitter);
        Runtime.getRuntime().addShutdownHook(new Thread() {
            public void run() {
                if (server != null)
                    server.dispose();
View Full Code Here

        );
        return mockHitter;
    }

    protected ServerConfiguration remoteServer1Configuration() {
        return new AggregateConfiguration(new StubConfigurationSource() {
            public String osString() {
                return "Windows XP";
            }

            public String browserFileNames() {
View Full Code Here

            }
        });
    }

    protected ServerConfiguration remoteServer2Configuration() {
        return new AggregateConfiguration(new StubConfigurationSource() {
            public String osString() {
                return "Mac OS X";
            }

            public String browserFileNames() {
View Full Code Here

            server.dispose();
        super.tearDown();
    }

    public void testStartTestRun() throws Exception {
        server = new JsUnitAggregateServer(new AggregateConfiguration(new DummyConfigurationSource()));
        assertEquals(ServerType.AGGREGATE, server.serverType());
    }
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

TOP

Related Classes of net.jsunit.configuration.AggregateConfiguration

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.