Package hudson.model.Queue

Examples of hudson.model.Queue.Task


     * - a computer with 1 executor, idle.
     * - a future load of size 1 is predicted
     * - hence the consideration of the current task at hand shall fail, as it'll collide with the estimated future load.
     */
    public void test1() throws Exception {
        Task t = mock(Task.class);
        when(t.getEstimatedDuration()).thenReturn(10000L);
        when(t.getSubTasks()).thenReturn((Collection) asList(t));


        Computer c = createMockComputer(1);

        JobOffer o = createMockOffer(c.getExecutors().get(0));
View Full Code Here


     * - a computer with two executors, one is building something now
     * - a future load of size 1 is predicted but it'll start after the currently building something is completed.
     * - hence the currently available executor should be considered available (unlike in test1)
     */
    public void test2() throws Exception {
        Task t = mock(Task.class);
        when(t.getEstimatedDuration()).thenReturn(10000L);
        when(t.getSubTasks()).thenReturn((Collection) asList(t));


        Computer c = createMockComputer(2);
        Executor e = c.getExecutors().get(0);

View Full Code Here

     * Returns the {@link MavenModule}s that are in the queue.
     */
    public List<Queue.Item> getQueueItems() {
        List<Queue.Item> r = new ArrayList<hudson.model.Queue.Item>();
        for( Queue.Item item : Jenkins.getInstance().getQueue().getItems() ) {
            Task t = item.task;
            if((t instanceof MavenModule && ((MavenModule)t).getParent()==this) || t ==this)
                r.add(item);
        }
        return r;
    }
View Full Code Here

        }

        // Check for builds in the queue which have the same emulator config as this task
        Queue queue = Hudson.getInstance().getQueue();
        for (BuildableItem item : queue.getBuildableItems()) {
            Task queuedTask = item.task;
            if (task == queuedTask) {
                continue;
            }

            // If build with matching config is about to start (is "pending"), hold off for a moment
View Full Code Here

     * Returns the {@link IvyModule}s that are in the queue.
     */
    public List<Queue.Item> getQueueItems() {
        List<Queue.Item> r = new ArrayList<hudson.model.Queue.Item>();
        for( Queue.Item item : Hudson.getInstance().getQueue().getItems() ) {
            Task t = item.task;
            if((t instanceof IvyModule && ((IvyModule)t).getParent()==this) || t ==this)
                r.add(item);
        }
        return r;
    }
View Full Code Here

TOP

Related Classes of hudson.model.Queue.Task

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.