Package com.sonymobile.tools.gerrit.gerritevents.dto.events

Examples of com.sonymobile.tools.gerrit.gerritevents.dto.events.PatchsetCreated


        trigger.setGerritProjects(Collections.nCopies(1, gP));
        trigger.setEscapeQuotes(false);
        trigger.setSilentMode(false);
        Whitebox.setInternalState(trigger, "myProject", project);

        PatchsetCreated event = Setup.createPatchsetCreated();

        trigger.gerritEvent(event);

        verify(listener, never()).onTriggered(same(project), same(event));
        verify(project).isBuildable();
View Full Code Here


        GerritTrigger trigger = Setup.createDefaultTrigger(null);
        when(project.getTrigger(GerritTrigger.class)).thenReturn(trigger);
        trigger.setGerritProjects(Collections.nCopies(1, gP));
        Whitebox.setInternalState(trigger, "myProject", project);

        PatchsetCreated event = Setup.createPatchsetCreated();

        trigger.gerritEvent(event);

        verify(listener, never()).onTriggered(same(project), same(event));
View Full Code Here

        Change changeWithQuotes = prepareChangeObjForMockTest("project", "branch", "I2343434344",
                "100", stringWithQuotes, "commitMessage", jsonAccount, "http://localhost:8080");
        Change changeWithoutQuotes = prepareChangeObjForMockTest("project", "branch", "I2343434344",
                "100", stringWithoutQuotes, "commitMessage", jsonAccount, "http://localhost:8080");

        PatchsetCreated eventWithQuotes = preparePatchsetCreatedObjForMockTest(changeWithQuotes,
                new PatchSet(patch), GerritEventType.PATCHSET_CREATED);
        PatchsetCreated eventWithoutQuotes = preparePatchsetCreatedObjForMockTest(changeWithoutQuotes,
                new PatchSet(patch), GerritEventType.PATCHSET_CREATED);
        //mock the returned url
        PowerMockito.mockStatic(PluginImpl.class);
        PluginImpl plugin = PowerMockito.mock(PluginImpl.class);
        GerritServer server = mock(GerritServer.class);
View Full Code Here

        Change changeWithQuotes = prepareChangeObjForMockTest("project", "branch", "I2343434344",
                "100", stringWithQuotes, "commitMessage", jsonAccount, "http://localhost:8080");
        Change changeWithoutQuotes = prepareChangeObjForMockTest("project", "branch", "I2343434344",
                "100", stringWithoutQuotes, "commitMessage", jsonAccount, "http://localhost:8080");

        PatchsetCreated eventWithQuotes = preparePatchsetCreatedObjForMockTest(changeWithQuotes,
                new PatchSet(patch), GerritEventType.PATCHSET_CREATED);
        PatchsetCreated eventWithoutQuotes = preparePatchsetCreatedObjForMockTest(changeWithoutQuotes,
                new PatchSet(patch), GerritEventType.PATCHSET_CREATED);

        //mock the returned url
        PowerMockito.mockStatic(PluginImpl.class);
        PluginImpl plugin = PowerMockito.mock(PluginImpl.class);
View Full Code Here

        jsonAccount.put(NAME, "Bobby");

        Change change = prepareChangeObjForMockTest("project", "branch", "I2343434344",
                "100", "Subject", stringReadable, jsonAccount, "http://localhost:8080");

        PatchsetCreated event = preparePatchsetCreatedObjForMockTest(change,
                new PatchSet(patch), GerritEventType.PATCHSET_CREATED);
        //mock the returned url
        PowerMockito.mockStatic(PluginImpl.class);
        PluginImpl plugin = PowerMockito.mock(PluginImpl.class);
        GerritServer server = mock(GerritServer.class);
View Full Code Here

        jsonAccount.put(NAME, "Bobby");

        Change change = prepareChangeObjForMockTest("project", "branch", "I2343434344",
                "100", "Subject", stringReadable, jsonAccount, "http://localhost:8080");

        PatchsetCreated event = preparePatchsetCreatedObjForMockTest(change,
                new PatchSet(patch), GerritEventType.PATCHSET_CREATED);

        //mock the returned url
        PowerMockito.mockStatic(PluginImpl.class);
        PluginImpl plugin = PowerMockito.mock(PluginImpl.class);
View Full Code Here

     */
    private PatchsetCreated preparePatchsetCreatedObjForMockTest(
            Change change,
            PatchSet patchSet,
            GerritEventType enentType) {
        PatchsetCreated patchsetCretedObj = PowerMockito.mock(PatchsetCreated.class);
        doReturn(change).when(patchsetCretedObj).getChange();
        doReturn(patchSet).when(patchsetCretedObj).getPatchSet();
        doReturn(enentType).when(patchsetCretedObj).getEventType();
        return patchsetCretedObj;
    }
View Full Code Here

    /**
     * Test that it should not block item without GerritTrigger configured.
     */
    @Test
    public void shouldNotBlockItemWithoutGerritTrigger() {
        Item item = createItemWithOneSlave(new PatchsetCreated());
        when(abstractProjectMock.getTrigger(GerritTrigger.class)).thenReturn(null);
        assertNull("Build should not be blocked", dispatcher.canRun(item));
    }
View Full Code Here

        AbstractProject project = mock(AbstractProject.class);
        when(project.getTrigger(GerritTrigger.class)).thenReturn(trigger);

        AbstractBuild r = Setup.createBuild(project, taskListener, Setup.createEnvVars());

        PatchsetCreated event = Setup.createPatchsetCreated();
        BuildsStartedStats stats = Setup.createBuildStartedStats(event);
        IGerritHudsonTriggerConfig config = Setup.createConfig();

        Hudson hudson = PowerMockito.mock(Hudson.class);
        when(hudson.getRootUrl()).thenReturn("http://localhost/");
View Full Code Here

    /**
     * Test that it should not block item when it not configured to wait for slaves.
     */
    @Test
    public void shouldNotBlockItemWhenNotConfiguredToWaitForSlaves() {
        PatchsetCreated patchsetCreated = Setup.createPatchsetCreated("someGerritServer", "someProject",
                "refs/changes/1/1/1");
        Item item = createItem(patchsetCreated, null);
        assertNull("Build should not be blocked", dispatcher.canRun(item));
    }
View Full Code Here

TOP

Related Classes of com.sonymobile.tools.gerrit.gerritevents.dto.events.PatchsetCreated

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.