Package hudson.plugins.parameterizedtrigger

Examples of hudson.plugins.parameterizedtrigger.CurrentBuildParameters


public class CurrentBuildParametersTest extends HudsonTestCase {

  public void test() throws Exception {
    Project<?,?> projectA = createFreeStyleProject("projectA");
    projectA.getPublishersList().add(
        new BuildTrigger(new BuildTriggerConfig("projectB", ResultCondition.SUCCESS, new CurrentBuildParameters())));

    CaptureEnvironmentBuilder builder = new CaptureEnvironmentBuilder();
    Project projectB = createFreeStyleProject("projectB");
    projectB.getBuildersList().add(builder);
    projectB.setQuietPeriod(1);
View Full Code Here


   }
 
  public void testPostBuildTriggerNoParameters(boolean pWithoutParameters) throws Exception {
    Project<?,?> projectA = createFreeStyleProject("projectA");
    List<AbstractBuildParameters> buildParameters = new ArrayList<AbstractBuildParameters>();
    buildParameters.add(new CurrentBuildParameters());
    projectA.getPublishersList().add(new BuildTrigger(new BuildTriggerConfig("projectB", ResultCondition.SUCCESS, pWithoutParameters, buildParameters)));
    CaptureEnvironmentBuilder builder = new CaptureEnvironmentBuilder();

    Project<?,?> projectB = createFreeStyleProject("projectB");
    projectB.getBuildersList().add(builder);
View Full Code Here

   * @throws Exception
   */
  public void testBuildStepTriggerBuildNoParameters() throws Exception {
    Project<?,?> projectA = createFreeStyleProject("projectA");
    List<AbstractBuildParameters> buildParameters = new ArrayList<AbstractBuildParameters>();
    buildParameters.add(new CurrentBuildParameters());
    projectA.getBuildersList().add(new TriggerBuilder(new BlockableBuildTriggerConfig("projectB", null, buildParameters)));
    CaptureEnvironmentBuilder builder = new CaptureEnvironmentBuilder();

    Project<?,?> projectB = createFreeStyleProject("projectB");
    projectB.getBuildersList().add(builder);
View Full Code Here

public class BuildTriggerConfigTest extends HudsonTestCase {

    private BlockableBuildTriggerConfig createConfig(String projectToTrigger){
        List<AbstractBuildParameters> buildParameters = new ArrayList<AbstractBuildParameters>();
        buildParameters.add(new CurrentBuildParameters());
        BlockingBehaviour neverFail = new BlockingBehaviour("never", "never", "never");
        return new BlockableBuildTriggerConfig(projectToTrigger, neverFail, buildParameters);
    }
View Full Code Here

  private Project<?, ?> createParentProject(String parentJobName, String... childJobNames) throws IOException {
    //create ProjectA
    Project<?,?> project = createFreeStyleProject(parentJobName);

    List<AbstractBuildParameters> buildParameters = new ArrayList<AbstractBuildParameters>();
    buildParameters.add(new CurrentBuildParameters());
   
    StringBuilder childJobNamesString = new StringBuilder();
    for(String childJobName : childJobNames){
      childJobNamesString.append(childJobName);
      childJobNamesString.append(",");
    }
   
    //setup build step trigger
    project.getBuildersList().add(new TriggerBuilder(new BlockableBuildTriggerConfig(childJobNamesString.toString(), null, buildParameters)));
   
    // setup triggers for conditional buildsteps
    // test conditional builder (multi)
    List<BuildStep> blist = new ArrayList<BuildStep>();
    TriggerBuilder tb = new TriggerBuilder(new BlockableBuildTriggerConfig(childJobNamesString.toString(), null, buildParameters));
      blist.add(tb);
      project.getBuildersList().add(new ConditionalBuilder(new AlwaysRun(), new BuildStepRunner.Run(), blist));
     
      // test conditional builder (single)
      TriggerBuilder tb2 = new TriggerBuilder(new BlockableBuildTriggerConfig(childJobNamesString.toString(), null, buildParameters));       
      project.getBuildersList().add(new SingleConditionalBuilder(tb2, new AlwaysRun(), new BuildStepRunner.Run()));

    //setup post build trigger
    project.getPublishersList().add(new BuildTrigger(new BuildTriggerConfig(childJobNamesString.toString(), ResultCondition.SUCCESS, new CurrentBuildParameters())));
    return project;
  }
View Full Code Here

       
        p1.getPublishersList().add(new BuildTrigger(new BuildTriggerConfig(
                p2.getName(),   // This should not be getFullName().
                ResultCondition.ALWAYS,
                true,
                Arrays.asList((AbstractBuildParameters)new CurrentBuildParameters())
        )));
       
        jenkins.rebuildDependencyGraph();
       
        // Test this works
View Full Code Here

                String.format("%s/%s", folder2.getName(), p2.getName()),
                    // This should not be getFullName().
                ResultCondition.ALWAYS,
                true,
                null,
                Arrays.asList((AbstractBuildParameters)new CurrentBuildParameters())
        )));
       
        jenkins.rebuildDependencyGraph();
       
        // Test this works
View Full Code Here

                String.format("../%s", p2.getName()),
                    // This should not be getFullName().
                ResultCondition.ALWAYS,
                true,
                null,
                Arrays.asList((AbstractBuildParameters)new CurrentBuildParameters())
        )));
       
        jenkins.rebuildDependencyGraph();
       
        // Test this works
View Full Code Here

        projectA.getPublishersList().add(new BuildTrigger(new BuildTriggerConfig(
                String.format("%s,%s", projectB.getName(), projectB2.getName()),
                ResultCondition.ALWAYS,
                true,
                null,
                Arrays.asList((AbstractBuildParameters)new CurrentBuildParameters())
        )));
       
        jenkins.rebuildDependencyGraph();
       
        projectB.renameTo("ProjectB-renamed");
View Full Code Here

public class BuildInfoExporterTest extends HudsonTestCase {

  public void test() throws Exception {
    Project<?, ?> projectA = createFreeStyleProject("projectA");
    List<AbstractBuildParameters> buildParameters = new ArrayList<AbstractBuildParameters>();
    buildParameters.add(new CurrentBuildParameters());
    BlockingBehaviour neverFail = new BlockingBehaviour("never", "never", "never");
    BlockableBuildTriggerConfig config = new BlockableBuildTriggerConfig("projectB", neverFail, buildParameters);
    projectA.getBuildersList().add(new TriggerBuilder(config));

    CaptureEnvironmentBuilder builder = new CaptureEnvironmentBuilder();
View Full Code Here

TOP

Related Classes of hudson.plugins.parameterizedtrigger.CurrentBuildParameters

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.