Package hudson.plugins.parameterizedtrigger

Examples of hudson.plugins.parameterizedtrigger.BuildInfoExporterAction$BuildReference


      {
          FreeStyleProject p = jenkins.getItemByFullName("upstream", FreeStyleProject.class);
          assertNotNull(p);
          FreeStyleBuild b = p.getLastBuild();
          assertNotNull(b);
          BuildInfoExporterAction action = b.getAction(BuildInfoExporterAction.class);
          assertNotNull(action);
         
          // action should contain following builds:
          //  downstream1#1
          //  downstream1#2
          //  downstream2#1
         
          assertEquals(
              Sets.newHashSet(
                      jenkins.getItemByFullName("downstream1", FreeStyleProject.class).getBuildByNumber(1),
                      jenkins.getItemByFullName("downstream1", FreeStyleProject.class).getBuildByNumber(2),
                      jenkins.getItemByFullName("downstream2", FreeStyleProject.class).getBuildByNumber(1)
              ),
              new HashSet<AbstractBuild<?,?>>(action.getTriggeredBuilds())
          );
         
          EnvVars env = new EnvVars();
          action.buildEnvVars(b, env);
          lastReferenceValue = env.get(BuildInfoExporterAction.JOB_NAME_VARIABLE);
          assertEquals("downstream1", lastReferenceValue);
         
          b.save();
      }
     
      {
          FreeStyleProject p = jenkins.getItemByFullName("upstream", FreeStyleProject.class);
          assertNotNull(p);
          FreeStyleBuild b = p.getLastBuild();
          assertNotNull(b);
          BuildInfoExporterAction action = b.getAction(BuildInfoExporterAction.class);
          assertNotNull(action);
         
          // action should contain following builds:
          //  downstream1#1
          //  downstream1#2
          //  downstream2#1
         
          assertEquals(
              Sets.newHashSet(
                      jenkins.getItemByFullName("downstream1", FreeStyleProject.class).getBuildByNumber(1),
                      jenkins.getItemByFullName("downstream1", FreeStyleProject.class).getBuildByNumber(2),
                      jenkins.getItemByFullName("downstream2", FreeStyleProject.class).getBuildByNumber(1)
              ),
              new HashSet<AbstractBuild<?,?>>(action.getTriggeredBuilds())
          );
         
          EnvVars env = new EnvVars();
          action.buildEnvVars(b, env);
          assertEquals(lastReferenceValue, env.get(BuildInfoExporterAction.JOB_NAME_VARIABLE));
      }
  }
View Full Code Here

TOP

Related Classes of hudson.plugins.parameterizedtrigger.BuildInfoExporterAction$BuildReference

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.