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

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


     */
    @Test
    public void testGetGerritFrontEndUrlForChangeBasedEvent() {
        Config config = new Config();
        config.setGerritFrontEndURL("http://gerrit/");
        PatchsetCreated event = Setup.createPatchsetCreated();
        assertEquals(event.getChange().getUrl(), config.getGerritFrontEndUrlFor(event));
    }
View Full Code Here


     */
    @Test
    public void testGetGerritFrontEndUrlForChangeBasedEventProvider() {
        Config config = new Config();
        config.setGerritFrontEndURL("http://gerrit/");
        PatchsetCreated event = Setup.createPatchsetCreated();
        event.getChange().setUrl(null);
        assertEquals("http://gerrit/1000", config.getGerritFrontEndUrlFor(event));
    }
View Full Code Here

     */
    @Test
    public void shouldNotifyGerritEventListener() {
        GerritEventListener eventListenerMock = mock(GerritEventListener.class);
        gerritHandler.addListener(eventListenerMock);
        PatchsetCreated patchset = Setup.createPatchsetCreated();

        gerritHandler.notifyListeners(patchset);

        verify(eventListenerMock).gerritEvent(patchset);
    }
View Full Code Here

        when(b.getCause(GerritCause.class)).thenReturn(null);
        annotateAndVerify(b,
            "test\ntest\nChange-Id: I1234567890123456789012345678901234567890",
            "test\ntest\nChange-Id: I1234567890123456789012345678901234567890");

        PatchsetCreated patchsetCreated = Setup.createPatchsetCreated();
        GerritCause gerritCause = new GerritCause();
        gerritCause.setEvent(patchsetCreated);
        when(b.getCause(GerritCause.class)).thenReturn(gerritCause);
        annotateAndVerify(b,
                          "test\ntest\nChange-Id: <a href='http://gerrit/r/I1234567890123456789012345678901234567890'>"
View Full Code Here

     * An Item is first checked when in the Queue. Once it canRun(), it is checked again when the executor
     * actually pulls it from the queue. But at that time, dependency-wise, we don't care anymore.
     */
    @Test
    public void shouldNotBlockBuildableItem() {
        PatchsetCreated patchsetCreated = Setup.createPatchsetCreated("someGerritServer", "someProject",
            "refs/changes/1/1/1");
        Queue.Item item = createItem(patchsetCreated, null);

        CauseOfBlockage cause = dispatcher.canRun(new Queue.BuildableItem((WaitingItem)item));
        assertNull("Build should not be blocked", cause);
View Full Code Here

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

    /**
     * Test that it should not block item which has no dependencies.
     */
    @Test
    public void shouldNotBlockItemWithNoDependencies() {
        PatchsetCreated patchsetCreated = Setup.createPatchsetCreated("someGerritServer", "someProject",
            "refs/changes/1/1/1");
        Queue.Item item = createItem(patchsetCreated, "");
        assertNull("Build should not be blocked", dispatcher.canRun(item));
    }
View Full Code Here

    /**
     * Test that it should not block item which has null dependencies.
     */
    @Test
    public void shouldNotBlockItemWithNullDependencies() {
        PatchsetCreated patchsetCreated = Setup.createPatchsetCreated("someGerritServer", "someProject",
            "refs/changes/1/1/1");
        Queue.Item item = createItem(patchsetCreated, null);
        assertNull("Build should not be blocked", dispatcher.canRun(item));
    }
View Full Code Here

            if (project.isBuilding()) {
                started = true;
            }
            Thread.sleep(1000);
        }
        PatchsetCreated patchsetCreated = Setup.createPatchsetCreated();
        patchsetCreated.getChange().setNumber("2000");
        gerritServer.triggerEvent(patchsetCreated);

        while (project.isBuilding() || project.isInQueue()) {
            Thread.sleep(1000);
        }
View Full Code Here

     * Test that an event marked as onTriggering blocks any build linked to it, and after
     * onDoneTriggeringAll, the build should wait for the dependency to be done, and then should build.
     */
    @Test
    public void shouldBlockTriggeringEvents() {
        PatchsetCreated patchsetCreated = Setup.createPatchsetCreated("someGerritServer", "someProject",
            "refs/changes/1/1/1");
        dispatcher.onTriggeringAll(patchsetCreated);
        Queue.Item item = createItem(patchsetCreated, "upstream");
        CauseOfBlockage cause = dispatcher.canRun(item);
        assertNotNull("Build should be blocked", cause);
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.