Examples of IGerritHudsonTriggerConfig


Examples of com.sonyericsson.hudson.plugins.gerrit.trigger.config.IGerritHudsonTriggerConfig

        trigger.setEscapeQuotes(false);
        PatchsetCreated event = Setup.createPatchsetCreatedWithAccounts(owner, null, null);
        GerritCause gerritCause = new GerritCause(event, true);
        gerritCause = spy(gerritCause);
        doReturn("http://mock.url").when(gerritCause).getUrl();
        IGerritHudsonTriggerConfig config = Setup.createConfig();
        config = spy(config);
        doReturn("http://mock.url").when(config).getGerritFrontEndUrlFor(any(String.class), any(String.class));
        when(server.getConfig()).thenReturn(config);

        trigger.schedule(gerritCause, event);
View Full Code Here

Examples of com.sonyericsson.hudson.plugins.gerrit.trigger.config.IGerritHudsonTriggerConfig

        trigger.setEscapeQuotes(false);
        PatchsetCreated event = Setup.createPatchsetCreatedWithAccounts(owner, uploader, uploader);
        GerritCause gerritCause = new GerritCause(event, true);
        gerritCause = spy(gerritCause);
        doReturn("http://mock.url").when(gerritCause).getUrl();
        IGerritHudsonTriggerConfig config = Setup.createConfig();
        config = spy(config);
        doReturn("http://mock.url").when(config).getGerritFrontEndUrlFor(any(String.class), any(String.class));
        when(server.getConfig()).thenReturn(config);

        trigger.schedule(gerritCause, event);
View Full Code Here

Examples of com.sonyericsson.hudson.plugins.gerrit.trigger.config.IGerritHudsonTriggerConfig

        PluginImpl plugin = PowerMockito.mock(PluginImpl.class);
        GerritServer server = mock(GerritServer.class);
        when(plugin.getServer(any(String.class))).thenReturn(server);
        GerritHandler handler = mock(GerritHandler.class);
        when(plugin.getHandler()).thenReturn(handler);
        IGerritHudsonTriggerConfig config = Setup.createConfig();
        config = spy(config);
        doReturn("http://mock.url").when(config).getGerritFrontEndUrlFor(any(String.class), any(String.class));
        when(server.getConfig()).thenReturn(config);
        PowerMockito.when(PluginImpl.getInstance()).thenReturn(plugin);
View Full Code Here

Examples of com.sonyericsson.hudson.plugins.gerrit.trigger.config.IGerritHudsonTriggerConfig

        PluginImpl plugin = PowerMockito.mock(PluginImpl.class);
        GerritServer server = mock(GerritServer.class);
        when(plugin.getServer(any(String.class))).thenReturn(server);
        GerritHandler handler = mock(GerritHandler.class);
        when(plugin.getHandler()).thenReturn(handler);
        IGerritHudsonTriggerConfig config = Setup.createConfig();
        config = spy(config);
        doReturn("http://mock.url").when(config).getGerritFrontEndUrlFor(any(String.class), any(String.class));
        when(server.getConfig()).thenReturn(config);
        PowerMockito.when(PluginImpl.getInstance()).thenReturn(plugin);
View Full Code Here

Examples of com.sonyericsson.hudson.plugins.gerrit.trigger.config.IGerritHudsonTriggerConfig

        PluginImpl plugin = PowerMockito.mock(PluginImpl.class);
        GerritServer server = mock(GerritServer.class);
        when(plugin.getServer(any(String.class))).thenReturn(server);
        GerritHandler handler = mock(GerritHandler.class);
        when(plugin.getHandler()).thenReturn(handler);
        IGerritHudsonTriggerConfig config = Setup.createConfig();
        config = spy(config);
        doReturn("http://mock.url").when(config).getGerritFrontEndUrlFor(any(String.class), any(String.class));
        when(server.getConfig()).thenReturn(config);
        PowerMockito.when(PluginImpl.getInstance()).thenReturn(plugin);
View Full Code Here

Examples of com.sonyericsson.hudson.plugins.gerrit.trigger.config.IGerritHudsonTriggerConfig

        PluginImpl plugin = PowerMockito.mock(PluginImpl.class);
        GerritServer server = mock(GerritServer.class);
        when(plugin.getServer(any(String.class))).thenReturn(server);
        GerritHandler handler = mock(GerritHandler.class);
        when(plugin.getHandler()).thenReturn(handler);
        IGerritHudsonTriggerConfig config = Setup.createConfig();
        config = spy(config);
        doReturn("http://mock.url").when(config).getGerritFrontEndUrlFor(any(String.class), any(String.class));
        when(server.getConfig()).thenReturn(config);
        PowerMockito.when(PluginImpl.getInstance()).thenReturn(plugin);
View Full Code Here

Examples of com.sonyericsson.hudson.plugins.gerrit.trigger.config.IGerritHudsonTriggerConfig

        PluginImpl plugin = PowerMockito.mock(PluginImpl.class);
        GerritServer server = mock(GerritServer.class);
        when(plugin.getServer(any(String.class))).thenReturn(server);
        GerritHandler handler = mock(GerritHandler.class);
        when(plugin.getHandler()).thenReturn(handler);
        IGerritHudsonTriggerConfig config = Setup.createConfig();
        config = spy(config);
        doReturn("http://mock.url").when(config).getGerritFrontEndUrlFor(any(String.class), any(String.class));
        when(server.getConfig()).thenReturn(config);
        PowerMockito.when(PluginImpl.getInstance()).thenReturn(plugin);
    }
View Full Code Here

Examples of com.sonyericsson.hudson.plugins.gerrit.trigger.config.IGerritHudsonTriggerConfig

     * Tests {@link GerritTrigger#gerritSlavesToWaitFor(String)}. It should
     * return empty slave list when not configured.
     */
    @Test
    public void shouldReturnEmptySlaveListWhenNotConfigured() {
        IGerritHudsonTriggerConfig configMock = setupSeverConfigMock();
        GerritTrigger gerritTrigger = Setup.createDefaultTrigger(null);

        // Replication config not defined
        List<GerritSlave> slaves = gerritTrigger.gerritSlavesToWaitFor(PluginImpl.DEFAULT_SERVER_NAME);
        assertNotNull(slaves);
        assertEquals(0, slaves.size());

        // ReplicationConfig is defined but is not configured
        ReplicationConfig replicationConfigMock = mock(ReplicationConfig.class);
        when(configMock.getReplicationConfig()).thenReturn(replicationConfigMock);
        slaves = gerritTrigger.gerritSlavesToWaitFor(PluginImpl.DEFAULT_SERVER_NAME);
        assertNotNull(slaves);
        assertEquals(0, slaves.size());
    }
View Full Code Here

Examples of com.sonyericsson.hudson.plugins.gerrit.trigger.config.IGerritHudsonTriggerConfig

    /**
     * Setup a ReplicationConfig mock
     * @return the ReplicationConfig mock
     */
    private ReplicationConfig setupReplicationConfigMock() {
        IGerritHudsonTriggerConfig configMock = setupSeverConfigMock();
        ReplicationConfig replicationConfigMock = mock(ReplicationConfig.class);
        when(configMock.getReplicationConfig()).thenReturn(replicationConfigMock);
        return replicationConfigMock;
    }
View Full Code Here

Examples of com.sonyericsson.hudson.plugins.gerrit.trigger.config.IGerritHudsonTriggerConfig

        PowerMockito.mockStatic(PluginImpl.class);
        PluginImpl pluginMock = mock(PluginImpl.class);
        when(PluginImpl.getInstance()).thenReturn(pluginMock);
        GerritServer serverMock = mock(GerritServer.class);
        when(pluginMock.getServer(PluginImpl.DEFAULT_SERVER_NAME)).thenReturn(serverMock);
        IGerritHudsonTriggerConfig configMock = mock(IGerritHudsonTriggerConfig.class);
        when(serverMock.getConfig()).thenReturn(configMock);
        return configMock;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.