Package hudson.model

Examples of hudson.model.Node


    @Test
    public void getAllNodesSecurity() {

        List<Node> nodes = new ArrayList<Node>();
        nodes.add(node);
        Node masterNode = hudson;

        NodeService inst = spy(getInst());

        doReturn(nodes).when(hudson).getNodes();
        doReturn(hudson).when(inst).getMasterNode();
View Full Code Here


    @Test
    public void getNodesDoesNotIncludeMaster() {

        List<Node> nodes = new ArrayList<Node>();
        nodes.add(node);
        Node masterNode = hudson;

        NodeService inst = spy(getInst());

        doReturn(nodes).when(hudson).getNodes();
        doReturn(true).when(security).hasPermission(node, Permission.READ);
View Full Code Here

        assertThat(getInst().findNode("nodeName"), nullValue());
    }

    @Test
    public void findNodeReturnMaster() {
        Node masterNode = hudson;
        assertThat(getInst().findNode(""), equalTo(masterNode));
        Mockito.verify(hudson, Mockito.never()).getNode("");
    }
View Full Code Here

        Mockito.verify(security).checkPermission(node, Permission.READ);
    }

    @Test
    public void getMasterNodeIsHudson() {
        Node masterNode = hudson;
        assertThat(getInst().getMasterNode(), equalTo(masterNode));
    }
View Full Code Here

    public NodeServiceImpl(final SecurityService security) {
        this.security = Preconditions.checkNotNull(security);
    }

    public Node getNode(String nodeName) {
        Node node = findNode(nodeName);
        if (node == null) {
            throw new NodeNotFoundException(String.format("Node %s not found.", nodeName));
        }
        return node;
    }
View Full Code Here

    }

    public Node findNode(final String nodeName) {
        log.debug("findNode(\"{}\")", nodeName);
        checkNodeName(nodeName);
        Node node;
        // Provide the master node, if the name is ""
        if ("".equals(nodeName)) {
            node = getHudson();
        } else {
            node = getHudson().getNode(nodeName);
View Full Code Here

        }
        return node;
    }

    public Node getMasterNode() {
        Node masterNode = getHudson();
        this.security.checkPermission(masterNode, Permission.READ);
        return masterNode;
    }
View Full Code Here

        return masterNode;
    }

    public List<Node> getAllNodes() {
        List<Node> nodesToReturn = getNodes();
        Node masterNode = getHudson();
        if (this.security.hasPermission(masterNode, Permission.READ)) {
            nodesToReturn.add(masterNode);
        }
        return nodesToReturn;
    }
View Full Code Here

        }
        return nodesToReturn;
    }

    public Node getCurrentNode() {
        Node node = Computer.currentComputer().getNode();
        this.security.checkPermission(node, Permission.READ);
        return node;
    }
View Full Code Here

        Executor exec = b.getExecutor();
        if (exec==null)
            throw new AbortException(b.getFullDisplayName()+" is not building");

        Node node = exec.getOwner().getNode();

        if (t instanceof NodeSpecific) {
            NodeSpecific n = (NodeSpecific) t;
            t = (ToolInstallation)n.forNode(node,new StreamTaskListener(stderr));
        }
View Full Code Here

TOP

Related Classes of hudson.model.Node

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.