當前位置: 首頁>>代碼示例>>Java>>正文


Java Computer.getNode方法代碼示例

本文整理匯總了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"));
}
 
開發者ID:jenkinsci,項目名稱:external-workspace-manager-plugin,代碼行數:27,代碼來源:ConfigMigrationTest.java

示例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();
}
 
開發者ID:jenkinsci,項目名稱:envinject-api-plugin,代碼行數:13,代碼來源:EnvVarsResolver.java

示例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;
}
 
開發者ID:jenkinsci,項目名稱:yaml-project-plugin,代碼行數:16,代碼來源:AbstractBranchAwareProject.java

示例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();
}
 
開發者ID:p4paul,項目名稱:p4-jenkins,代碼行數:14,代碼來源:NodeHelper.java

示例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;
}
 
開發者ID:jenkinsci,項目名稱:mesos-plugin,代碼行數:14,代碼來源:MesosRunListener.java


注:本文中的hudson.model.Computer.getNode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。