Package hudson.model.Queue

Examples of hudson.model.Queue.WaitingItem


        assertTrue(mw.executors.isEmpty());
        assertEquals(1,mw.works.size());
    }

    private BuildableItem wrap(Queue.Task t) {
        return new BuildableItem(new WaitingItem(new GregorianCalendar(),t,new ArrayList<Action>()));
    }
View Full Code Here


        if (c != null) {
            queueActions.add(new CauseAction(c));
        }

        WaitingItem i = Jenkins.getInstance().getQueue().schedule(this, quietPeriod, queueActions);
        if(i!=null)
            return (Future)i.getFuture();
        return null;
    }
View Full Code Here

        if (c != null) {
            queueActions.add(new CauseAction(c));
        }

        WaitingItem i = Hudson.getInstance().getQueue().schedule(this, quietPeriod, queueActions);
        if(i!=null)
            return (Future)i.getFuture();
        return null;
    }
View Full Code Here

     * Test that it should not block an item the task of which is not an AbstractProject.
     */
    @Test
    public void shouldNotBlockNonAbstractProjects() {
        List<Action> actions = new ArrayList<Action>();
        Queue.Item item = new WaitingItem(Calendar.getInstance(), null, actions);
        CauseOfBlockage cause = dispatcher.canRun(new Queue.BuildableItem((WaitingItem)item));
        assertNull("Build should not be blocked", cause);
    }
View Full Code Here

        when(abstractProjectMock.getTrigger(GerritTrigger.class)).thenReturn(gerritTriggerMock);
        abstractProjectDependencyMock = mock(AbstractProject.class);
        when(abstractProjectDependencyMock.getTrigger(GerritTrigger.class)).thenReturn(gerritTriggerMock);
        when(gerritTriggerMock.getDependencyJobsNames()).thenReturn(dependency);
        when(jenkinsMock.getItem(eq("upstream"), any(Item.class), Item.class)).thenReturn(abstractProjectDependencyMock);
        WaitingItem waitingItem = PowerMockito.spy(new WaitingItem(Calendar.getInstance(),
                abstractProjectMock, actions));
        when(waitingItem.getInQueueSince()).thenReturn(System.currentTimeMillis()
                - TimeUnit.SECONDS.toMillis(GerritDefaultValues.DEFAULT_BUILD_SCHEDULE_DELAY));
        return waitingItem;
    }
View Full Code Here

            for (String slave : slaves) {
                gerritSlaves.add(new GerritSlave(slave + " display name", slave , 0));
            }
            when(gerritTriggerMock.gerritSlavesToWaitFor(any(String.class))).thenReturn(gerritSlaves);
        }
        return new WaitingItem(Calendar.getInstance(), abstractProjectMock, actions);
    }
View Full Code Here

TOP

Related Classes of hudson.model.Queue.WaitingItem

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.