Package hudson.plugins.parameterizedtrigger

Examples of hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig


   */
  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);
    projectB.setQuietPeriod(1);
View Full Code Here


    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

     */
    public void testGetProjectListDynamic() throws Exception {
        Project<?, ?> masterProject = createFreeStyleProject("project");

        // trigger two dynamic project
        BlockableBuildTriggerConfig masterConfig = createConfig("sub${JOB_NAME}1, sub${JOB_NAME}2");
        addParameterizedTrigger(masterProject, masterConfig);

        // Only create 1 sub project
        Project subProject1 = createFreeStyleProject("subproject1");
        subProject1.setQuietPeriod(0);
View Full Code Here

     */
    public void testGetProjectListStatic() throws Exception {
        Project<?, ?> masterProject = createFreeStyleProject("project");

        // trigger two fixed project
        BlockableBuildTriggerConfig masterConfig = createConfig("subproject1, subproject2");
        addParameterizedTrigger(masterProject, masterConfig);

        // Only create 1 sub project
        Project subProject1 = createFreeStyleProject("subproject1");
        subProject1.setQuietPeriod(0);
View Full Code Here

     */
    public void testGetProjectListMix() throws Exception {
        Project<?, ?> masterProject = createFreeStyleProject("project");

        // trigger two fixed project
        BlockableBuildTriggerConfig masterConfig = createConfig("subproject1, sub${JOB_NAME}2");
        addParameterizedTrigger(masterProject, masterConfig);

        // Create 2 sub projects
        createFreeStyleProject("subproject1").setQuietPeriod(0);
        createFreeStyleProject("subproject2").setQuietPeriod(0);
View Full Code Here

     */
    public void testGetProjectListTriggered() throws Exception {
        Project<?, ?> masterProject = createFreeStyleProject("project");

        // trigger two fixed project
        BlockableBuildTriggerConfig masterConfig = createConfig("subproject1, sub${JOB_NAME}2");
        addParameterizedTrigger(masterProject, masterConfig);

        // Create 2 sub projects
        createFreeStyleProject("subproject1").setQuietPeriod(0);
        createFreeStyleProject("subproject2").setQuietPeriod(0);
View Full Code Here

      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

    }
   
    private TriggerBuilder createTriggerBuilder(AbstractProject project, NoFilesFoundEnum action, String encoding){

        TriggerBuilder tBuilder = new TriggerBuilder(
                                new BlockableBuildTriggerConfig(project.getName(),
                                new BlockingBehaviour(Result.FAILURE, Result.UNSTABLE, Result.FAILURE),
                                ImmutableList.<AbstractBuildParameterFactory>of(
                                    new FileBuildParameterFactory("*.txt", encoding, action)),
                                Collections.<AbstractBuildParameters>emptyList()));
        return tBuilder;
View Full Code Here

    public void testWithOneParameter() throws Exception {
        Project<?,?> projectA = createFreeStyleProject();
        Project projectB = createFreeStyleProject();
        projectA.getBuildersList().add(
                new TriggerBuilder(
                        new BlockableBuildTriggerConfig(projectB.getName(),
                                new BlockingBehaviour(Result.FAILURE, Result.UNSTABLE, Result.FAILURE),
                                ImmutableList.<AbstractBuildParameterFactory>of(new CounterBuildParameterFactory("0","1","1", "TEST=COUNT$COUNT")),
                                Collections.<AbstractBuildParameters>emptyList())));

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

    public void testWithTwoParameters() throws Exception {
        Project<?,?> projectA = createFreeStyleProject();
        Project projectB = createFreeStyleProject();
        projectA.getBuildersList().add(
                new TriggerBuilder(
                        new BlockableBuildTriggerConfig(projectB.getName(),
                                new BlockingBehaviour(Result.FAILURE, Result.UNSTABLE, Result.FAILURE),
                                ImmutableList.<AbstractBuildParameterFactory>of(
                                        new CounterBuildParameterFactory("0","1","1", "TEST=COUNT$COUNT"),
                                        new CounterBuildParameterFactory("0","2","1", "NEWTEST=COUNT$COUNT")
                                        ),
View Full Code Here

TOP

Related Classes of hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig

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.