本文整理匯總了Java中hudson.model.Computer.getNode方法的典型用法代碼示例。如果您正苦於以下問題:Java Computer.getNode方法的具體用法?Java Computer.getNode怎麽用?Java Computer.getNode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類hudson.model.Computer
的用法示例。
在下文中一共展示了Computer.getNode方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: localRootPathToNodeMountPoint
import hudson.model.Computer; //導入方法依賴的package包/類
@LocalData
@Test
public void localRootPathToNodeMountPoint() throws Exception {
// The node configuration version 1.0.0 contains a localRootPath field.
// This tests that future versions load this field as nodeMountPoint,
// in other words it tests NodeDisk.readResolve()
Computer computer = jr.getInstance().getComputer("node1");
Node node = computer.getNode();
DescribableList<NodeProperty<?>,NodePropertyDescriptor> props = node.getNodeProperties();
ExternalWorkspaceProperty exwsProp = props.get(ExternalWorkspaceProperty.class);
List<NodeDiskPool> diskPools = exwsProp.getNodeDiskPools();
assertThat(diskPools.size(), is(1));
NodeDiskPool diskPool = diskPools.get(0);
assertThat(diskPool.getDiskPoolRefId(), is ("dp1"));
List<NodeDisk> disks = diskPool.getNodeDisks();
assertThat(disks.size(), is(1));
NodeDisk disk = disks.get(0);
assertThat(disk.getDiskRefId(), is("d1"));
assertThat(disk.getNodeMountPoint(), is("/tmp/dp1/d1"));
}
示例2: getMasterNode
import hudson.model.Computer; //導入方法依賴的package包/類
@CheckForNull
private static Node getMasterNode() {
final Jenkins jenkins = Jenkins.getInstance();
if (jenkins == null) {
return null;
}
Computer computer = jenkins.toComputer();
if (computer == null) {
return null; //Master can have no executors
}
return computer.getNode();
}
示例3: workspaceToNode
import hudson.model.Computer; //導入方法依賴的package包/類
/** From GitSCM */
private static Node workspaceToNode(FilePath workspace) {
Jenkins j = Jenkins.getInstance();
if (workspace.isRemote()) {
for (Computer c : j.getComputers()) {
if (c.getChannel() == workspace.getChannel()) {
Node n = c.getNode();
if (n != null) {
return n;
}
}
}
}
return j;
}
示例4: workspaceToNode
import hudson.model.Computer; //導入方法依賴的package包/類
/**
* Helper: find the Node for slave build or return current instance.
*
* @param workspace Jenkins workspace on build node
* @return Node
*/
public static Node workspaceToNode(FilePath workspace) {
Computer computer = workspaceToComputer(workspace);
if (computer != null) {
return computer.getNode();
}
return Jenkins.getInstance();
}
示例5: getCurrentNode
import hudson.model.Computer; //導入方法依賴的package包/類
/**
* Returns the current {@link Node} on which we are building.
*/
private final Node getCurrentNode() {
Executor executor = Executor.currentExecutor();
if (executor != null) {
Computer owner = executor.getOwner();
if (owner != null) {
return owner.getNode();
}
}
return null;
}