use of hudson.slaves.NodePropertyDescriptor in project workflow-job-plugin by jenkinsci.
the class WorkflowRunTest method globalNodePropertiesInEnv.
@Test
@Issue("JENKINS-43396")
public void globalNodePropertiesInEnv() throws Exception {
DescribableList<NodeProperty<?>, NodePropertyDescriptor> original = r.jenkins.getGlobalNodeProperties();
EnvironmentVariablesNodeProperty envProp = new EnvironmentVariablesNodeProperty(new EnvironmentVariablesNodeProperty.Entry("KEY", "VALUE"));
original.add(envProp);
WorkflowJob j = r.jenkins.createProject(WorkflowJob.class, "envVars");
j.setDefinition(new CpsFlowDefinition("echo \"KEY is ${env.KEY}\"", true));
WorkflowRun b = r.assertBuildStatusSuccess(j.scheduleBuild2(0));
r.assertLogContains("KEY is " + envProp.getEnvVars().get("KEY"), b);
}
use of hudson.slaves.NodePropertyDescriptor in project hudson-2.x by hudson.
the class Functions method getNodePropertyDescriptors.
public static List<NodePropertyDescriptor> getNodePropertyDescriptors(Class<? extends Node> clazz) {
List<NodePropertyDescriptor> result = new ArrayList<NodePropertyDescriptor>();
Collection<NodePropertyDescriptor> list = (Collection) Hudson.getInstance().getDescriptorList(NodeProperty.class);
for (NodePropertyDescriptor npd : list) {
if (npd.isApplicable(clazz)) {
result.add(npd);
}
}
return result;
}
Aggregations