Package com.sonyericsson.hudson.plugins.metadata.model.values

Examples of com.sonyericsson.hudson.plugins.metadata.model.values.MetadataValue


        //give the controller some time to work on the separate thread
        Thread.sleep(4000);
        matrix = (MatrixProject)Jenkins.getInstance().getItem("myMatrix");
        property = matrix.getProperty(MetadataJobProperty.class);
        assertNotNull(property);
        MetadataValue path = TreeStructureUtil.getPath(property, "the", "world", "says");
        assertNotNull(path);
        assertEquals("hello", path.getValue());
        for (MatrixConfiguration config : matrix.getActiveConfigurations()) {
            property = config.getProperty(MetadataJobProperty.class);
            assertNotNull(property);
            path = TreeStructureUtil.getPath(property, "the", "world", "says");
            assertNotNull(path);
            assertEquals("hello", path.getValue());
        }
    }
View Full Code Here


     * @param definition the MetadataDefinition to find the corresponding String value for.
     * @return the user input value or default if not found.
     */
    public Object getValueForDefinition(Metadata definition) {
        String[] fullPath = definition.getFullPath();
        MetadataValue m = TreeStructureUtil.getLeaf(values, fullPath);
        if (m == null) {
            return definition;
        } else if (m.getParent() instanceof Metadata) {
            MetadataParent parent = m.getParent();
            ParentUtil.removeChild(parent, m);
            ParentUtil.removeEmptyBranches(values);
            return m;
        } else {
            ParentUtil.removeChild(values, m);
View Full Code Here

                    for (int i = 0; i < formDefinitions.size(); i++) {
                        String name = (String)formDefinitions.names().get(i);
                        Object definition = formDefinitions.get(name);
                        MetadataDefinition foundDefinition = TreeStructureUtil.getLeaf(definitions, name.split("_"));
                        if (foundDefinition != null) {
                            MetadataValue value = foundDefinition.createValue(definition);
                            presetValues.add(createAncestry(foundDefinition, value));
                        }
                    }
                }
            }
View Full Code Here

            if (parent == null || (parent instanceof MetadataContainer)) {
                return value;
            }
            //create the corresponding MetadataValue from the MetadataDefinition by calling createValue,
            //then continue walking up the tree.
            MetadataValue valueParent = ((MetadataDefinition)parent).createValue(value);
            return createAncestry((MetadataDefinition)parent, valueParent);
        }
View Full Code Here

TOP

Related Classes of com.sonyericsson.hudson.plugins.metadata.model.values.MetadataValue

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.