Examples of Computer


Examples of hexenschach.player.Computer

    Player player1;
    Player player2;
    Player player3;
    // Ersten Spieler erstellen
    if(playerChoice1.getSelectedItem().equals(Dictionary.NewGameDialogChoice2))
      player1 = new Computer(true, "white", 1);
    else if(playerChoice1.getSelectedItem().equals(Dictionary.NewGameDialogChoice3))
      player1 = new Computer(true, "white", 2);
    else if(playerChoice1.getSelectedItem().equals(Dictionary.NewGameDialogChoice4))
      player1 = new Computer(true, "white", 3);
    else
      player1 = new Human(false, "white");
    // Zweiten Spieler erstellen
    if(playerChoice2.getSelectedItem().equals(Dictionary.NewGameDialogChoice2))
      player2 = new Computer(true, "brown", 1);
    else if(playerChoice2.getSelectedItem().equals(Dictionary.NewGameDialogChoice3))
      player2 = new Computer(true, "brown", 2);
    else if(playerChoice2.getSelectedItem().equals(Dictionary.NewGameDialogChoice4))
      player2 = new Computer(true, "brown", 3);
    else
      player2 = new Human(false, "brown");
    // Dritten Spieler erstellen
    if(playerChoice3.getSelectedItem().equals(Dictionary.NewGameDialogChoice2))
      player3 = new Computer(true, "black", 1);
    else if(playerChoice3.getSelectedItem().equals(Dictionary.NewGameDialogChoice3))
      player3 = new Computer(true, "black", 2);
    else if(playerChoice3.getSelectedItem().equals(Dictionary.NewGameDialogChoice4))
      player3 = new Computer(true, "black", 3);
    else
      player3 = new Human(false, "black");
    // Gameplay erzeugen
    Gameplay gameplay = new Gameplay(player1, player2, player3, parent);
    parent.setGameplay(gameplay);
View Full Code Here

Examples of hudson.model.Computer

            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

Examples of hudson.model.Computer

        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

Examples of hudson.model.Computer

        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

Examples of hudson.model.Computer

        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

Examples of hudson.model.Computer

        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

Examples of hudson.model.Computer

            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

Examples of hudson.model.Computer

    /**
     * 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

Examples of hudson.model.Computer

        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

Examples of hudson.model.Computer

            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
TOP
Copyright © 2018 www.massapi.com. 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.