Package hudson.model

Examples of hudson.model.ParametersDefinitionProperty


    }

    public ListBoxModel doFillTagItems(@AncestorInPath Job<?,?> context, @QueryParameter String param) {
        ListBoxModel model = new ListBoxModel();
        if (context != null) {
            ParametersDefinitionProperty prop = context.getProperty(ParametersDefinitionProperty.class);
            if (prop != null) {
                ParameterDefinition def = prop.getParameterDefinition(param);
                if (def instanceof ListSubversionTagsParameterDefinition) {
                    for (String tag : ((ListSubversionTagsParameterDefinition) def).getTags(context)) {
                        if (tag.startsWith("!")) {
                            model.add(tag.substring(1), "");
                        } else {
View Full Code Here


        for (NodeProperty nodeProperty : Hudson.getInstance().getGlobalNodeProperties()) {
            if (nodeProperty instanceof EnvironmentVariablesNodeProperty) {
                subst.putAll(((EnvironmentVariablesNodeProperty) nodeProperty).getEnvVars());
            }
        }
        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);
View Full Code Here

        listener.getLogger().println("Last build on " + buildDate);

        final String localStream;
        if(!useWorkspace){
        if (hasStringVariableReference(this.stream)) {
            ParametersDefinitionProperty paramDefProp = (ParametersDefinitionProperty) project
                    .getProperty(ParametersDefinitionProperty.class);

            if (paramDefProp == null) {
                listener.getLogger().println(
                        "Polling is not supported when stream name has a variable reference '" + this.stream + "'.");

                // as we don't know which stream to check we just state that
                // there is no changes
                return PollingResult.NO_CHANGES;
            }

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

public class ProjectSpecificParameterValuesActionTransformTest extends HudsonTestCase {
    public void test() throws IOException {
        Project project = createFreeStyleProject("project");

        project.addProperty(new ParametersDefinitionProperty(
                    new BooleanParameterDefinition("key1", false, "derp")
                    ));

        ParametersAction action = new ParametersAction(
                new StringParameterValue("key1", "true")
View Full Code Here

public class DefaultParameterValuesActionsTransformTest extends HudsonTestCase {
    public void test() throws IOException {
        Project project = createFreeStyleProject("project");

        project.addProperty(new ParametersDefinitionProperty(
                    new StringParameterDefinition("key1", "value1"),
                    new StringParameterDefinition("key2", "value2")
                    ));

        ParametersAction action = new ParametersAction(
View Full Code Here

        new BuildTrigger(new BuildTriggerConfig("projectB", ResultCondition.SUCCESS,
            new CurrentBuildParameters())));

    CaptureEnvironmentBuilder builder = new CaptureEnvironmentBuilder();
    Project projectB = createFreeStyleProject("projectB");
    projectB.addProperty(new ParametersDefinitionProperty(
        new StringParameterDefinition("key1", "value1"),
        new StringParameterDefinition("key2", "value2")
        ));
    projectB.getBuildersList().add(builder);
    projectB.setQuietPeriod(1);
View Full Code Here

        Project projectB = createFreeStyleProject("projectB");
        //    projectB defaults: FOO=bar  BAR=override-me
        // Invoke projectA with:          BAR=foo  BAZ=override-me
        //  Merge in predefined:                   BAZ=moo  HOHO=blah
        //      Expected result: FOO=bar  BAR=foo  BAZ=moo  HOHO=blah
        projectB.addProperty(new ParametersDefinitionProperty(
                new StringParameterDefinition("FOO", "bar"),
                new StringParameterDefinition("BAR", "override-me")));
        CaptureEnvironmentBuilder builder = new CaptureEnvironmentBuilder();
        projectB.getBuildersList().add(builder);
        projectB.setQuietPeriod(1);
View Full Code Here

              commandReply.append("Unparseable parameter: " + args[i] + "\n");
          }
        }

        List<ParameterValue> parameters = new ArrayList<ParameterValue>();
      ParametersDefinitionProperty propDefs = project.getProperty(ParametersDefinitionProperty.class);
      for (ParameterDefinition pd : propDefs.getParameterDefinitions()) {
        if (pd.getName() != null && parsedParameters.containsKey(pd.getName())) {
            if (pd instanceof SimpleParameterDefinition) {
                SimpleParameterDefinition spd = (SimpleParameterDefinition) pd;
                parameters.add(spd.createValue(parsedParameters.get(pd.getName())));
            } else {
View Full Code Here

       
        AbstractProject<?, ?> project = mockProject(jobProvider);
        project = mockProject(jobProvider);
        when(project.isParameterized()).thenReturn(Boolean.TRUE);
        when(project.getProperty(ParametersDefinitionProperty.class)).thenReturn(
                new ParametersDefinitionProperty(
                        new StringParameterDefinition("key", "default value", ""),
                        new BooleanParameterDefinition("key2", false, "")));
       
        Sender sender = new Sender("sender");
        cmd.getReply(bot, sender, new String[]{ "build", "project", "3s", "key=value", "key2=true" });
View Full Code Here

        cmd.setJobProvider(jobProvider);
       
        AbstractProject<?, ?> project = mockProject(jobProvider);
        when(project.isParameterized()).thenReturn(Boolean.TRUE);
        when(project.getProperty(ParametersDefinitionProperty.class)).thenReturn(
                new ParametersDefinitionProperty(new StringParameterDefinition("key", "default value", "")));
       
        Sender sender = new Sender("sender");
        cmd.getReply(bot, sender, new String[]{ "build", "project", "key=value", "unexisting_key=value" });
       
        ArgumentCaptor<ParametersAction> captor = ArgumentCaptor.forClass(ParametersAction.class);
View Full Code Here

TOP

Related Classes of hudson.model.ParametersDefinitionProperty

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.