Package hudson.slaves.EnvironmentVariablesNodeProperty

Examples of hudson.slaves.EnvironmentVariablesNodeProperty.Entry


  /**
   * Slave properties are available
   */
  public void testSlavePropertyOnSlave() throws Exception {
    setVariables(slave, new Entry("KEY", "slaveValue"));
    Map<String, String> envVars = executeBuild(slave);
    Assert.assertEquals("slaveValue", envVars.get("KEY"));
  }
View Full Code Here


   * Master properties are available
   */
  public void testMasterPropertyOnMaster() throws Exception {
        hudson.getGlobalNodeProperties().replaceBy(
                Collections.singleton(new EnvironmentVariablesNodeProperty(
                        new Entry("KEY", "masterValue"))));

    Map<String, String> envVars = executeBuild(hudson);

    Assert.assertEquals("masterValue", envVars.get("KEY"));
  }
View Full Code Here

   * Both slave and master properties are available, but slave properties have priority
   */
  public void testSlaveAndMasterPropertyOnSlave() throws Exception {
        hudson.getGlobalNodeProperties().replaceBy(
                Collections.singleton(new EnvironmentVariablesNodeProperty(
                        new Entry("KEY", "masterValue"))));
    setVariables(slave, new Entry("KEY", "slaveValue"));

    Map<String, String> envVars = executeBuild(slave);

    Assert.assertEquals("slaveValue", envVars.get("KEY"));
  }
View Full Code Here

      throws Exception {
    ParametersDefinitionProperty pdp = new ParametersDefinitionProperty(
        new StringParameterDefinition("KEY", "parameterValue"));
    project.addProperty(pdp);

    setVariables(hudson, new Entry("KEY", "masterValue"));
    setVariables(slave, new Entry("KEY", "slaveValue"));

    Map<String, String> envVars = executeBuild(slave);

    Assert.assertEquals("parameterValue", envVars.get("KEY"));
  }
View Full Code Here

  }
 
  public void testVariableResolving() throws Exception {
        hudson.getGlobalNodeProperties().replaceBy(
                Collections.singleton(new EnvironmentVariablesNodeProperty(
                        new Entry("KEY1", "value"), new Entry("KEY2", "$KEY1"))));
    Map<String,String> envVars = executeBuild(hudson);
    Assert.assertEquals("value", envVars.get("KEY1"));
    Assert.assertEquals("value", envVars.get("KEY2"));
  }
View Full Code Here

  }
 
  public void testFormRoundTripForMaster() throws Exception {
        hudson.getGlobalNodeProperties().replaceBy(
                Collections.singleton(new EnvironmentVariablesNodeProperty(
                        new Entry("KEY", "value"))));
   
    WebClient webClient = new WebClient();
    HtmlPage page = webClient.getPage(hudson, "configure");
    HtmlForm form = page.getFormByName("config");
    submit(form);
View Full Code Here

    Assert.assertEquals(1, prop.getEnvVars().size());
    Assert.assertEquals("value", prop.getEnvVars().get("KEY"));
  }

  public void testFormRoundTripForSlave() throws Exception {
    setVariables(slave, new Entry("KEY", "value"));
   
    WebClient webClient = new WebClient();
    HtmlPage page = webClient.getPage(slave, "configure");
    HtmlForm form = page.getFormByName("config");
    submit(form);
View Full Code Here

        String javaVar = javaHome.substring(0, 3);
        JDK varJDK = new JDK("varJDK", javaHomeVar);
        hudson.getJDKs().add(varJDK);
        Jenkins.getInstance().getNodeProperties().replaceBy(
                Collections.singleton(new EnvironmentVariablesNodeProperty(
                        new Entry("VAR_MAVEN", mavenVar), new Entry("VAR_JAVA",
                                javaVar))));

        FreeStyleProject project = createFreeStyleProject();
        project.getBuildersList().add(new Maven("--help", varMaven.getName()));
        project.setJDK(varJDK);
View Full Code Here

    // For HUDSON-7411
    public void testNodeEnvVarsAvailable() throws Exception {
        FreeStyleProject project = setupSimpleProject("master");
        Node s = createSlave();
        setVariables(s, new Entry("TESTKEY", "slaveValue"));
        project.setAssignedLabel(s.getSelfLabel());
        final String commitFile1 = "commitFile1";
        commit(commitFile1, johnDoe, "Commit number 1");
        build(project, Result.SUCCESS, commitFile1);
View Full Code Here

TOP

Related Classes of hudson.slaves.EnvironmentVariablesNodeProperty.Entry

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.