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

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


        Configuration config = new Configuration();
        PropertySimple prop = new PropertySimple("prop", "true");
        config.put(prop);

        ConfigurationInstanceDescriptor instance =
            ConfigurationInstanceDescriptorUtil.createConfigurationInstance(def, config);

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

        SimplePropertyInstanceDescriptor propInstance =
            (SimplePropertyInstanceDescriptor) instance.getConfigurationProperty().get(0).getValue();

        assertEquals(propInstance.getName(), "prop", "Unexpected property instance name");
        assertEquals(propInstance.getValue(), "true", "Unexpected property instance value");
        assertEquals(propInstance.getLongDescription(), "prop descr", "Unexpected property instance description");
        assertTrue(propInstance.isRequired(), "Unexpected property instance required flag");
View Full Code Here


        Configuration config = new Configuration();
        PropertyList list =
            new PropertyList("list", new PropertySimple("prop", "value1"), new PropertySimple("prop", "value2"));
        config.put(list);

        ConfigurationInstanceDescriptor instance =
            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");
View Full Code Here

            new PropertyList("list", new PropertyMap("map", new PropertySimple("prop1", "value1"), new PropertySimple(
                "prop2", "value1")), new PropertyMap("map", new PropertySimple("prop1", "value2"), new PropertySimple(
                "prop2", "value2")));
        config.put(list);

        ConfigurationInstanceDescriptor instance =
            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");
View Full Code Here

        String xml = "" +
            "<standaloneConfigurationInstance xmlns:ci='urn:xmlns:rhq-configuration-instance' xmlns:c='urn:xmlns:rhq-configuration'>" +
            "    <ci:simple-property value='42' name='my-name' type='integer'/>" +
            "</standaloneConfigurationInstance>";

        ConfigurationInstanceDescriptor descriptor = (ConfigurationInstanceDescriptor) CONFIGURATION_INSTANCE_UNMARSHALLER.unmarshal(new StringReader(xml));

        ConfigurationInstanceDescriptorUtil.ConfigurationAndDefinition ccd = ConfigurationInstanceDescriptorUtil.createConfigurationAndDefinition(descriptor);

        ConfigurationDefinition def = ccd.definition;
        Configuration conf = ccd.configuration;
View Full Code Here

        "            <ci:simple-value value='3'/>" +
        "        </ci:values>" +
        "    </ci:list-property>" +
        "</standaloneConfigurationInstance>";

        ConfigurationInstanceDescriptor descriptor = (ConfigurationInstanceDescriptor) CONFIGURATION_INSTANCE_UNMARSHALLER.unmarshal(new StringReader(xml));

        ConfigurationInstanceDescriptorUtil.ConfigurationAndDefinition ccd = ConfigurationInstanceDescriptorUtil.createConfigurationAndDefinition(descriptor);

        ConfigurationDefinition def = ccd.definition;
        Configuration conf = ccd.configuration;
View Full Code Here

        "            <ci:simple-value property-name='m2' value='v'/>" +
        "        </ci:values>" +
        "    </ci:map-property>" +
        "</standaloneConfigurationInstance>";

        ConfigurationInstanceDescriptor descriptor = (ConfigurationInstanceDescriptor) CONFIGURATION_INSTANCE_UNMARSHALLER.unmarshal(new StringReader(xml));

        ConfigurationInstanceDescriptorUtil.ConfigurationAndDefinition ccd = ConfigurationInstanceDescriptorUtil.createConfigurationAndDefinition(descriptor);

        ConfigurationDefinition def = ccd.definition;
        Configuration conf = ccd.configuration;
View Full Code Here

        "            </ci:map-value>" +
        "        </ci:values>" +
        "    </ci:list-property>" +
        "</standaloneConfigurationInstance>";

        ConfigurationInstanceDescriptor descriptor = (ConfigurationInstanceDescriptor) CONFIGURATION_INSTANCE_UNMARSHALLER.unmarshal(new StringReader(xml));

        ConfigurationInstanceDescriptorUtil.ConfigurationAndDefinition ccd = ConfigurationInstanceDescriptorUtil.createConfigurationAndDefinition(descriptor);

        ConfigurationDefinition def = ccd.definition;
        Configuration conf = ccd.configuration;
View Full Code Here

    private static class ToDescriptor {

        public static ConfigurationInstanceDescriptor createConfigurationInstance(ConfigurationDefinition definition,
            Configuration configuration) {

            ConfigurationInstanceDescriptor ret = new ConfigurationInstanceDescriptor();

            addAll(ret.getConfigurationProperty(), definition.getPropertyDefinitions(), configuration.getMap());

            return ret;
        }
View Full Code Here

TOP

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

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.