Package com.dtolabs.rundeck.core.plugins.configuration

Examples of com.dtolabs.rundeck.core.plugins.configuration.Property


                       true, //int validator
                       false);
    }

    public void testFactoryProperty() {
        Property test1 = PropertyBuilder.builder()
            .type(Property.Type.String)
            .name("test")
            .description("desc test")
            .defaultValue("def test")
            .title("title test")
            .values("a", "b", "c")
            .required(true)
            .validator(testValidator)
            .build();
        PropertyBuilder builder = PropertyBuilder.builder(test1);

        assertProperty(builder.build(),
                       test1.getName(),
                       test1.getType(),
                       test1.getDescription(),
                       test1.getDefaultValue(),
                       test1.getTitle(),
                       test1.getSelectValues(),
                       test1.getValidator(),
                       true,
                       test1.isRequired());
    }
View Full Code Here


                       test1.getValidator(),
                       true,
                       test1.isRequired());
    }
    public void testFactoryPropertySelect() {
        Property test1 = PropertyBuilder.builder()
            .type(Property.Type.Select)
            .name("test")
            .description("desc test")
            .defaultValue("def test")
            .title("title test")
            .values("a", "b", "c")
            .required(true)
            .build();
        PropertyBuilder builder = PropertyBuilder.builder(test1);

        assertProperty(builder.build(),
                       test1.getName(),
                       test1.getType(),
                       test1.getDescription(),
                       test1.getDefaultValue(),
                       test1.getTitle(),
                       test1.getSelectValues(),
                       null,
                       true,
                       test1.isRequired());
    }
View Full Code Here

                    .build()
            );

        Description build1 = builder.build();
        assertProperties(build1, 1, Arrays.asList("ptest1"));
        Property p1 = build1.getProperties().get(0);
        assertEquals("ptest1", p1.getName());
        assertEquals("ptitle1", p1.getTitle());
        assertEquals("pdesc1", p1.getDescription());
        assertEquals(null, p1.getDefaultValue());
        assertEquals(Property.Type.String, p1.getType());

        //replace ptest1 with another type
        builder.property(
            builder
                .property("ptest1")//get the property builder for existing property
                .type(Property.Type.Boolean) //set new type
                .description("pdesc2") //set new desc
                .defaultValue("pdef2") //set new default
        );
        Description build = builder.build();
        assertProperties(build, 1, Arrays.asList("ptest1"));
        Property p = build.getProperties().get(0);
        assertEquals("ptest1", p.getName());
        assertEquals("ptitle1", p.getTitle());
        assertEquals("pdesc2", p.getDescription());
        assertEquals("pdef2", p.getDefaultValue());
        assertEquals(Property.Type.Boolean, p.getType());
    }
View Full Code Here

    /**
     * Remove a previously defined property by name
     */
    public DescriptionBuilder removeProperty(final String name) {
        final Property found = findProperty(name);
        if (null != found) {
            properties.remove(found);
        }
        return this;
    }
View Full Code Here

     * Returns a new {@link PropertyBuilder} preconfigured with an existing property or a new one to add a new property.
     * Be sure to call {@link #property(com.dtolabs.rundeck.core.plugins.configuration.Property)} to add the result of
     * the final call to {@link com.dtolabs.rundeck.plugins.util.PropertyBuilder#build()}.
     */
    public PropertyBuilder property(final String name) {
        final Property found = findProperty(name);
        if (null != found) {
            return PropertyBuilder.builder(found);
        } else {
            return PropertyBuilder.builder().name(name);
        }
View Full Code Here

TOP

Related Classes of com.dtolabs.rundeck.core.plugins.configuration.Property

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.