Package org.rhq.enterprise.server.xmlschema.generated.configuration.instance

Examples of org.rhq.enterprise.server.xmlschema.generated.configuration.instance.ListPropertyInstanceDescriptor


            ConfigurationInstanceDescriptorUtil.createConfigurationInstance(def, config);

        assertEquals(instance.getConfigurationProperty().size(), 1,
            "Unexpected number of properties in configuration instance.");

        ListPropertyInstanceDescriptor listInstance =
            (ListPropertyInstanceDescriptor) instance.getConfigurationProperty().get(0).getValue();

        assertEquals(listInstance.getName(), "list", "Unexpected list instance name");
        assertEquals(listInstance.getLongDescription(), "list descr", "Unexpected list instance description");
        assertTrue(listInstance.isRequired(), "Unexpected list instance required flag");

        SimpleProperty propDef = (SimpleProperty) listInstance.getConfigurationProperty().getValue();
        assertEquals(propDef.getName(), "prop", "Unexpected simple instance name");
        assertEquals(propDef.getLongDescription(), "prop descr", "Unexpected simple instance description");
        assertTrue(!propDef.isRequired(), "Unexpected simple instance required flag");

        assertEquals(listInstance.getValues().getComplexValue().size(), 2, "Unexpected number of list values");

        ComplexValueSimpleDescriptor value1 =
            (ComplexValueSimpleDescriptor) listInstance.getValues().getComplexValue().get(0).getValue();
        ComplexValueSimpleDescriptor value2 =
            (ComplexValueSimpleDescriptor) listInstance.getValues().getComplexValue().get(1).getValue();

        assertEquals(value1.getValue(), "value1");
        assertEquals(value2.getValue(), "value2");

        logInstance("List of simples", instance);
View Full Code Here


            ConfigurationInstanceDescriptorUtil.createConfigurationInstance(def, config);

        assertEquals(instance.getConfigurationProperty().size(), 1,
            "Unexpected number of properties in configuration instance.");

        ListPropertyInstanceDescriptor listInstance =
            (ListPropertyInstanceDescriptor) instance.getConfigurationProperty().get(0).getValue();

        assertEquals(listInstance.getName(), "list", "Unexpected list instance name");
        assertEquals(listInstance.getLongDescription(), "list descr", "Unexpected list instance description");
        assertTrue(listInstance.isRequired(), "Unexpected list instance required flag");

        MapProperty propDef = (MapProperty) listInstance.getConfigurationProperty().getValue();
        assertEquals(propDef.getName(), "map", "Unexpected simple instance name");
        assertEquals(propDef.getLongDescription(), "map descr", "Unexpected simple instance description");
        assertTrue(propDef.isRequired(), "Unexpected simple instance required flag");

        assertEquals(listInstance.getValues().getComplexValue().size(), 2, "Unexpected number of list values");

        ComplexValueMapDescriptor map1 =
            (ComplexValueMapDescriptor) listInstance.getValues().getComplexValue().get(0).getValue();
        ComplexValueMapDescriptor map2 =
            (ComplexValueMapDescriptor) listInstance.getValues().getComplexValue().get(1).getValue();

        assertEquals(map1.getComplexValue().size(), 2, "Unexpected number of map elements in the first map value.");
        assertEquals(map2.getComplexValue().size(), 2, "Unexpected number of map elements in the second map value.");

        ComplexValueSimpleDescriptor value11 = (ComplexValueSimpleDescriptor) map1.getComplexValue().get(0).getValue();
View Full Code Here

            return ret;
        }

        private static ListPropertyInstanceDescriptor createList(PropertyDefinitionList def, PropertyList prop) {
            ListPropertyInstanceDescriptor ret = new ListPropertyInstanceDescriptor();

            setCommonProps(ret, def, true);

            ConfigurationProperty memberDef = convertDefinition(def.getMemberDefinition());
            ret.setConfigurationProperty(new JAXBElement<ConfigurationProperty>(getTagName(memberDef),
                ConfigurationProperty.class, memberDef));

            if (prop != null) {
                PropertyValuesDescriptor values = new PropertyValuesDescriptor();

                ret.setValues(values);

                for (Property el : prop.getList()) {
                    ComplexValueDescriptor value = convertValue(el);

                    //we don't need the property-name in lists, because the list has just a single member definition
View Full Code Here

                prop = simpleProp;
            } else if (propertyInstance instanceof ListPropertyInstanceDescriptor) {
                def = convert((ConfigurationProperty) propertyInstance);
                def.setConfigurationDefinition(configurationDefinition);

                ListPropertyInstanceDescriptor listInstance = (ListPropertyInstanceDescriptor) propertyInstance;
                PropertyList listProp = new PropertyList(listInstance.getName());

                PropertyDefinition memberDefinition = ((PropertyDefinitionList) def).getMemberDefinition();

                if (listInstance.getValues() != null) {
                    for (JAXBElement<?> val : listInstance.getValues().getComplexValue()) {
                        ComplexValueDescriptor valDesc = (ComplexValueDescriptor) val.getValue();
                        Property child = convert(memberDefinition, valDesc);
                        listProp.add(child);
                    }
                }
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.xmlschema.generated.configuration.instance.ListPropertyInstanceDescriptor

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.