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

Examples of com.sonyericsson.hudson.plugins.metadata.model.definitions.MetadataDefinition


     * Tests getting a StringMetadataValue for a StringMetadataDefinition.
     */
    @Test
    public void testGetStringValueForDefinition() {
        MetadataValueDefinitionHelper helper = new MetadataValueDefinitionHelper(values);
        MetadataDefinition definitionLeaf = TreeStructureUtil.getLeaf(startTreeNode, "child1", "child12");
        Object valueForDefinition = helper.getValueForDefinition(definitionLeaf);
        Assert.assertThat(valueForDefinition, instanceOf(StringMetadataValue.class));
        StringMetadataValue stringMetadataValue = (StringMetadataValue)valueForDefinition;
        assertThat(stringMetadataValue.getValue(), equalTo("nonDefaultVal"));
        assertThat(helper.getValues().size(), equalTo(0));
View Full Code Here


                JSONObject formDefinitions = formData.getJSONObject("definitions");
                if (!formDefinitions.isNullObject()) {
                    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

TOP

Related Classes of com.sonyericsson.hudson.plugins.metadata.model.definitions.MetadataDefinition

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.