Package org.hudsonci.service

Examples of org.hudsonci.service.NodeService


        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();
        doReturn(true).when(security).hasPermission(masterNode, Permission.READ);

        List<Node> result = inst.getAllNodes();

        assertThat(result, not(contains(node)));
        assertThat(result, contains(masterNode));
        Mockito.verify(security).hasPermission(node, Permission.READ);
        Mockito.verify(security).hasPermission(masterNode, Permission.READ);
View Full Code Here


    public void getNodesSecurity() {

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

        NodeService inst = spy(getInst());

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

        List<Node> result = inst.getNodes();

        assertThat(result, contains(node));

        Mockito.verify(security).hasPermission(node, Permission.READ);
View Full Code Here

        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);
        // try to fake it out
        doReturn(hudson).when(inst).getMasterNode();
        doReturn(true).when(security).hasPermission(masterNode, Permission.READ);

        List<Node> result = inst.getNodes();

        assertThat(result, contains(node));
        assertThat(result, not(contains(masterNode)));
    }
View Full Code Here

TOP

Related Classes of org.hudsonci.service.NodeService

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.