Package org.hudsonci.api.model

Examples of org.hudsonci.api.model.IProjectProperty


        assertEquals(childProject1.getCustomWorkspace(), parentWorkspace);
    }

    @Test
    public void testDoResetProjectPropertyOneProperty() throws IOException {
        final IProjectProperty filterProperty = createMock(StringProjectProperty.class);
        String input = MatrixProject.TOUCH_STONE_COMBINATION_FILTER_PROPERTY_NAME;
        MatrixProject project = new MatrixProjectMock("parent") {
            public IProjectProperty getProperty(String key) {
                if (MatrixProject.TOUCH_STONE_COMBINATION_FILTER_PROPERTY_NAME.equals(key)) {
                    return filterProperty;
                } else {
                    return null;
                }
            }
        };
        filterProperty.resetValue();
        replay(filterProperty);
        project.doResetProjectProperty(input);
        verify(filterProperty);
    }
View Full Code Here


        verify(filterProperty);
    }

    @Test
    public void testDoResetProjectPropertyTwoProperties() throws IOException {
        final IProjectProperty filterProperty = createMock(StringProjectProperty.class);
        final IProjectProperty resultProperty = createMock(ResultProjectProperty.class);

        String input = MatrixProject.TOUCH_STONE_COMBINATION_FILTER_PROPERTY_NAME + PROPERTY_NAME_SEPARATOR +
            MatrixProject.TOUCH_STONE_RESULT_CONDITION_PROPERTY_NAME;
        MatrixProject project = new MatrixProjectMock("parent") {
            public IProjectProperty getProperty(String key) {
                if (MatrixProject.TOUCH_STONE_COMBINATION_FILTER_PROPERTY_NAME.equals(key)) {
                    return filterProperty;
                } else if (MatrixProject.TOUCH_STONE_RESULT_CONDITION_PROPERTY_NAME.equals(key)) {
                    return resultProperty;
                } else {
                    return null;
                }
            }
        };
        filterProperty.resetValue();
        resultProperty.resetValue();
        replay(filterProperty, resultProperty);
        project.doResetProjectProperty(input);
        verify(filterProperty, resultProperty);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public static <T extends IProjectProperty> T getProjectProperty(ICascadingJob currentJob, String key, Class<T> clazz) {
        if (currentJob == null) {
            throw new IllegalArgumentException("Job cannot be null");
        }
        IProjectProperty t = (IProjectProperty) currentJob.getProjectProperties().get(key);
        if (null == t && null != clazz) {
            try {
                t = clazz.getConstructor(ICascadingJob.class).newInstance(currentJob);
                t.setKey(key);
                currentJob.putProjectProperty(key, t);
            } catch (InstantiationException e) {
                throw new RuntimeException(e);
            } catch (IllegalAccessException e) {
                throw new RuntimeException(e);
View Full Code Here

     * @throws java.io.IOException exception.
     */
    public void doResetProjectProperty(@QueryParameter final String propertyName) throws IOException {
        checkPermission(CONFIGURE);
        for (String name : StringUtils.split(propertyName, PROPERTY_NAME_SEPARATOR)) {
            final IProjectProperty property = getProperty(name);
            if (null != property) {
                property.resetValue();
            }
        }
        save();
    }
View Full Code Here

     * @throws IOException if any.
     */
    protected void buildProjectProperties() throws IOException {
        initProjectProperties();
        for (Map.Entry<String, IProjectProperty> entry : jobProperties.entrySet()) {
            IProjectProperty property = entry.getValue();
            property.setKey(entry.getKey());
            property.setJob(this);
        }
        convertLogRotatorProperty();
        convertJobProperties();
    }
View Full Code Here

     *
     * @param cascadingJobPropertyKey key of cascading JobProperty.
     */
    private void removeCascadingJobProperty(String cascadingJobPropertyKey) {
        if (null != cascadingJobPropertyKey) {
            IProjectProperty projectProperty = CascadingUtil.getProjectProperty(this, cascadingJobPropertyKey);
            if (null != projectProperty) {
                projectProperty.resetValue();
            }
            cascadingJobProperties.remove(cascadingJobPropertyKey);
        }
    }
View Full Code Here

    private CopyOnWriteList getCascadingJobProperties() {
        CopyOnWriteList result = new CopyOnWriteList();
        CopyOnWriteList<ParametersDefinitionProperty> definitionProperties = getParameterDefinitionProperties();
        if (null != cascadingJobProperties && !cascadingJobProperties.isEmpty()) {
            for (String key : cascadingJobProperties) {
                IProjectProperty projectProperty = CascadingUtil.getProjectProperty(this, key);
                Object value = projectProperty.getValue();
                if (null != value) {
                    result.add(value);
                }
            }
        }
View Full Code Here

                propertyName = new StringBuilder(propertyName.length())
                    .append(Character.toLowerCase((propertyName.charAt(0))))
                    .append(propertyName.substring(1))
                    .toString();
            }
            IProjectProperty property = getProperty(propertyName);
            if (null != property && property instanceof ExternalProjectProperty) {
                ((ExternalProjectProperty) property).setModified(true);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.hudsonci.api.model.IProjectProperty

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.