Package hudson.model

Examples of hudson.model.ParametersAction


        //prepare GerritTrigger object with the escapeQuotes setting is on.
        GerritTrigger triggerWithEscapeQuotesOn = Setup.createDefaultTrigger(null);
        when(project.getTrigger(GerritTrigger.class)).thenReturn(triggerWithEscapeQuotesOn);

        //the Trigger is creating parameters with escaped quote in "subject".
        ParametersAction paremetersAction =
                triggerWithEscapeQuotesOn.createParameters(eventWithQuotes, project);
        ParameterValue strPara =
                new StringParameterValue(GERRIT_CHANGE_SUBJECT.name(), stringWithQuotesEscaped);
        verify(changeWithQuotes, times(1)).getSubject();
        assertEquals(strPara, paremetersAction.getParameter(GERRIT_CHANGE_SUBJECT.name()));

        //the Trigger is creating parameters without escaped quote in "subject".
        paremetersAction = triggerWithEscapeQuotesOn.createParameters(eventWithoutQuotes, project);
        strPara = new StringParameterValue(GERRIT_CHANGE_SUBJECT.name(), stringWithoutQuotes);
        verify(changeWithoutQuotes, times(1)).getSubject();
        assertEquals(strPara, paremetersAction.getParameter(GERRIT_CHANGE_SUBJECT.name()));

    }
View Full Code Here


        GerritTrigger triggerWithEscapeQuotesOff = Setup.createDefaultTrigger(null);
        when(project.getTrigger(GerritTrigger.class)).thenReturn(triggerWithEscapeQuotesOff);
        triggerWithEscapeQuotesOff.setEscapeQuotes(false);

        //the Trigger is creating parameters with escaped quote in "subject"
        ParametersAction paremetersAction =
                triggerWithEscapeQuotesOff.createParameters(eventWithQuotes, project);
        ParameterValue strPara =
                new StringParameterValue(GERRIT_CHANGE_SUBJECT.name(), stringWithQuotes);
        verify(changeWithQuotes, times(1)).getSubject();
        assertEquals(strPara, paremetersAction.getParameter(GERRIT_CHANGE_SUBJECT.name()));

        //the Trigger is creating parameters without escaped quote in "subject"
        paremetersAction = triggerWithEscapeQuotesOff.createParameters(eventWithoutQuotes, project);
        strPara = new StringParameterValue(GERRIT_CHANGE_SUBJECT.name(), stringWithoutQuotes);
        verify(changeWithoutQuotes, times(1)).getSubject();
        assertEquals(strPara, paremetersAction.getParameter(GERRIT_CHANGE_SUBJECT.name()));
    }
View Full Code Here

        GerritTrigger triggerWithReadableMessageOn = Setup.createDefaultTrigger(null);
        when(project.getTrigger(GerritTrigger.class)).thenReturn(triggerWithReadableMessageOn);
        triggerWithReadableMessageOn.setReadableMessage(true);

        //the Trigger is creating parameters with encoded message in "commitMessage".
        ParametersAction paremetersAction =
                triggerWithReadableMessageOn.createParameters(event, project);
        ParameterValue strPara =
                new TextParameterValue(GERRIT_CHANGE_COMMIT_MESSAGE.name(), stringReadable);
        verify(change, times(1)).getCommitMessage();
        assertEquals(strPara, paremetersAction.getParameter(GERRIT_CHANGE_COMMIT_MESSAGE.name()));
    }
View Full Code Here

        //prepare GerritTrigger object with the escapeQuotes setting is off.
        GerritTrigger triggerWithReadableMessageOff = Setup.createDefaultTrigger(null);
        when(project.getTrigger(GerritTrigger.class)).thenReturn(triggerWithReadableMessageOff);

        //the Trigger is creating parameters with escaped quote in "subject"
        ParametersAction paremetersAction =
                triggerWithReadableMessageOff.createParameters(event, project);
        ParameterValue strPara =
                new Base64EncodedStringParameterValue(GERRIT_CHANGE_COMMIT_MESSAGE.name(), stringEncoded);
        verify(change, times(1)).getCommitMessage();
        assertEquals(strPara, paremetersAction.getParameter(GERRIT_CHANGE_COMMIT_MESSAGE.name()));
    }
View Full Code Here

            projectbuildDelay = 0;
        } else if (project.getHasCustomQuietPeriod()
                && project.getQuietPeriod() > projectbuildDelay) {
            projectbuildDelay = project.getQuietPeriod();
        }
        ParametersAction parameters = createParameters(event, project);
        Future build = project.scheduleBuild2(
                projectbuildDelay,
                cause,
                badgeAction,
                new RetriggerAction(cause.getContext()),
View Full Code Here

     * @return the ParameterAction.
     */
    protected ParametersAction createParameters(GerritTriggeredEvent event, AbstractProject project) {
        List<ParameterValue> parameters = getDefaultParametersValues(project);
        setOrCreateParameters(event, project, parameters);
        return new ParametersAction(parameters);
    }
View Full Code Here

TOP

Related Classes of hudson.model.ParametersAction

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.