Package hudson.model

Examples of hudson.model.Computer$GetFallbackName


            throw new AbortException(Messages.MavenModuleSetBuild_NoMavenConfigured());

       
        mvn = mvn.forEnvironment(envs);
       
        Computer computer = Computer.currentComputer();
        if (computer != null) { // just in case were not in a build
            Node node = computer.getNode();
            if (node != null) {
                mvn = mvn.forNode(node, log);
                mvn.buildEnvVars(envs);
            }
        }
View Full Code Here


        this.item = item;
       
        // group executors by their computers
        Map<Computer,List<ExecutorSlot>> j = new HashMap<Computer, List<ExecutorSlot>>();
        for (ExecutorSlot o : offers) {
            Computer c = o.getExecutor().getOwner();
            List<ExecutorSlot> l = j.get(c);
            if (l==null)
                j.put(c,l=new ArrayList<ExecutorSlot>());
            l.add(o);
        }
View Full Code Here

        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));

        MappingWorksheet mw = new MappingWorksheet(wrap(t), asList(o));

        // the test load predictor should have pushed down the executor count to 0
        assertTrue(mw.executors.isEmpty());
View Full Code Here

        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);

        when(e.isIdle()).thenReturn(false);
        when(e.getEstimatedRemainingTimeMillis()).thenReturn(300L);

        JobOffer o = createMockOffer(c.getExecutors().get(1));

        MappingWorksheet mw = new MappingWorksheet(wrap(t), asList(o));

        // since the currently busy executor will free up before a future predicted load starts,
        // we should have a valid executor remain in the queue
View Full Code Here

        return o;
    }

    private Computer createMockComputer(int nExecutors) throws Exception {
        Node n = mock(Node.class);
        Computer c = mock(Computer.class);
        when(c.getNode()).thenReturn(n);

        List executors = new CopyOnWriteArrayList();

        for (int i=0; i<nExecutors; i++) {
            Executor e = mock(Executor.class);
            when(e.isIdle()).thenReturn(true);
            when(e.getOwner()).thenReturn(c);
            executors.add(e);
        }

        Field f = Computer.class.getDeclaredField("executors");
        f.setAccessible(true);
        f.set(c, executors);

        when(c.getExecutors()).thenReturn(executors);
       
        return c;
    }
View Full Code Here

            System.err.println("Skipping JNLPLauncherTest.testLaunch because we are running headless");
            return;
        }

        System.err.println("Not in headless mode, continuing with JNLPLauncherTest.testLaunch...");
        Computer c = addTestSlave();
        launchJnlpAndVerify(c, buildJnlpArgs(c));
    }
View Full Code Here

    /**
     * Tests the '-headless' option.
     * (Although this test doesn't really assert that the agent really is running in a headless mdoe.)
     */
    public void testHeadlessLaunch() throws Exception {
        Computer c = addTestSlave();
        launchJnlpAndVerify(c, buildJnlpArgs(c).add("-arg","-headless"));
        // make sure that onOffline gets called just the right number of times
        assertEquals(1, listener.offlined);
    }
View Full Code Here

        List<Node> slaves = new ArrayList<Node>(hudson.getNodes());
        File dir = Util.createTempDir();
        slaves.add(new DumbSlave("test","dummy",dir.getAbsolutePath(),"1", Mode.NORMAL, "",
                new JNLPLauncher(), RetentionStrategy.INSTANCE, new ArrayList<NodeProperty<?>>()));
        hudson.setNodes(slaves);
        Computer c = hudson.getComputer("test");
        assertNotNull(c);
        return c;
    }
View Full Code Here

            dnsMultiCast = new DNSMultiCast(this);

            updateComputerList();

            {// master is online now
                Computer c = toComputer();
                if(c!=null)
                    for (ComputerListener cl : ComputerListener.all())
                        cl.onOnline(c,StreamTaskListener.fromStdout());
            }
View Full Code Here

    /**
     * Removes a {@link Node} from Hudson.
     */
    public synchronized void removeNode(Node n) throws IOException {
        Computer c = n.toComputer();
        if (c!=null)
            c.disconnect(OfflineCause.create(Messages._Hudson_NodeBeingRemoved()));

        ArrayList<Node> nl = new ArrayList<Node>(this.slaves);
        nl.remove(n);
        setNodes(nl);
    }
View Full Code Here

TOP

Related Classes of hudson.model.Computer$GetFallbackName

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.