Package hudson.model

Examples of hudson.model.ParameterValue


        }
        ParametersDefinitionProperty pdp = (ParametersDefinitionProperty) project.getProperty(hudson.model.ParametersDefinitionProperty.class);
        if (pdp != null) {
            for (ParameterDefinition pd : pdp.getParameterDefinitions()) {
                try {
                    ParameterValue defaultValue = pd.getDefaultParameterValue();
                    if (defaultValue != null) {
                        String name = defaultValue.getName();
                        String value = defaultValue.createVariableResolver(null).resolve(name);
                        subst.put(name, value);
                    }
                } catch (Exception e) {
                    // Do nothing
                }
View Full Code Here


            Map<String, String> keyValues = new TreeMap<String, String>();
   
            /* Scan for all parameter with an associated default values */
            for (ParameterDefinition paramDefinition : paramDefProp.getParameterDefinitions()) {
               
                ParameterValue defaultValue = paramDefinition.getDefaultParameterValue();

                if (defaultValue instanceof StringParameterValue) {
                    StringParameterValue strdefvalue = (StringParameterValue) defaultValue;
                    keyValues.put(defaultValue.getName(), strdefvalue.value);
                }
            }

            final EnvVars environment = new EnvVars(keyValues);
            localStream = environment.expand(this.stream);
View Full Code Here

    private static String getStringParameterValue(AbstractBuild<?,?> build, String name) {
        ParametersAction action = build.getAction(ParametersAction.class);
        if (action == null) {
            return null;
        }
        ParameterValue v = action.getParameter(name);
        if (v == null || !(v instanceof StringParameterValue)) {
            return null;
        }
        return ((StringParameterValue)v).value;
    }
View Full Code Here

        );
       
        whenParametersAreParsed("run=job#123");
       
        assertEquals(1, parsedParameters.size());
        ParameterValue parameter = parsedParameters.get(0);
        assertTrue(parameter instanceof RunParameterValue);
        RunParameterValue passwordParameter = (RunParameterValue) parameter;
        assertEquals("123", passwordParameter.getNumber());
        assertEquals("job", passwordParameter.getJobName());
    }
View Full Code Here

            } else {
                commandReply.append("Unsupported parameter type " + pd.getClass().getSimpleName()
                        + " for parameter " + pd.getName() + "!\n");
            }
        } else {
          ParameterValue pv = pd.getDefaultParameterValue();
          if (pv != null) {
            parameters.add(pv);
          }
        }
      }
View Full Code Here

                        d = def;
                }
                if (d == null)
                    throw new IllegalArgumentException("No such parameter definition: " + name);

                ParameterValue v = d.createValue(request, jo);
                if (v == null) {
                    continue;
                }
                mapResult.put(name, convert(name, v));
            }
View Full Code Here

            return new ParametersAction();
        }

        List<ParameterValue> parameters = new ArrayList<ParameterValue>();
        for (ParameterDefinition pd : property.getParameterDefinitions()) {
            ParameterValue param = pd.getDefaultParameterValue();
            if (param != null) {
                parameters.add(param);
            }
        }
View Full Code Here

        @Override
        public boolean matches(Object argument) {
            Action action = (Action)argument;
            if (action instanceof ParametersAction) {
                for (NameAndValue nv : nameAndValues) {
                    ParameterValue parameterValue = ((ParametersAction)action).getParameter(nv.name);

                    if (parameterValue != null && parameterValue instanceof StringParameterValue) {
                        StringParameterValue param = (StringParameterValue)parameterValue;
                        if (!nv.name.equals(param.getName()) || !nv.value.equals(param.value)) {
                            System.err.println("Required parameter is [" + param.getName() + "=" + param.value
View Full Code Here

        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".
View Full Code Here

        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"
View Full Code Here

TOP

Related Classes of hudson.model.ParameterValue

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.