Package org.rhq.core.domain.configuration.definition

Examples of org.rhq.core.domain.configuration.definition.ConfigurationTemplate


        when(mockResourceContext.getResourceType()).thenReturn(mockResourceType);

        ConfigurationDefinition mockConfigurationDefinition = mock(ConfigurationDefinition.class);
        when(mockResourceType.getResourceConfigurationDefinition()).thenReturn(mockConfigurationDefinition);

        ConfigurationTemplate mockConfigurationTemplate = mock(ConfigurationTemplate.class);
        when(mockConfigurationDefinition.getDefaultTemplate()).thenReturn(mockConfigurationTemplate);

        Configuration mockConfiguration = mock(Configuration.class);
        when(mockConfigurationTemplate.getConfiguration()).thenReturn(mockConfiguration);

        Property mockProperty = mock(Property.class);
        when(mockConfiguration.get("_type")).thenReturn(null);
        when(mockConfiguration.get(eq("__name"))).thenReturn(mockProperty);
View Full Code Here


        when(mockResourceType.getResourceConfigurationDefinition()).thenReturn(mockConfigurationDefinition);

        ConfigurationDefinition mockConfigurationDefinitionCopy = mock(ConfigurationDefinition.class);
        when(mockConfigurationDefinition.copy()).thenReturn(mockConfigurationDefinitionCopy);

        ConfigurationTemplate mockConfigurationTemplate = mock(ConfigurationTemplate.class);
        when(mockConfigurationDefinitionCopy.getDefaultTemplate()).thenReturn(mockConfigurationTemplate);

        Configuration mockConfiguration = mock(Configuration.class);
        when(mockConfigurationTemplate.getConfiguration()).thenReturn(mockConfiguration);

        Property mockProperty = mock(Property.class);
        when(mockConfiguration.get(eq("__type"))).thenReturn(mockProperty);

        Map<String, PropertyDefinition> mockMap = (Map<String, PropertyDefinition>) mock(Map.class);
View Full Code Here

        when(mockResourceType.getResourceConfigurationDefinition()).thenReturn(mockConfigurationDefinition);

        ConfigurationDefinition mockConfigurationDefinitionCopy = mock(ConfigurationDefinition.class);
        when(mockConfigurationDefinition.copy()).thenReturn(mockConfigurationDefinitionCopy);

        ConfigurationTemplate mockConfigurationTemplate = mock(ConfigurationTemplate.class);
        when(mockConfigurationDefinitionCopy.getDefaultTemplate()).thenReturn(mockConfigurationTemplate);

        Configuration mockConfiguration = mock(Configuration.class);
        when(mockConfigurationTemplate.getConfiguration()).thenReturn(mockConfiguration);

        Property mockProperty = mock(Property.class);
        when(mockConfiguration.get(eq("__type"))).thenReturn(null);
        when(mockConfiguration.get(eq("__name"))).thenReturn(mockProperty);
View Full Code Here

    public void testManualAdd() throws Exception {
        ResourceType jmxServerType = getPluginManager().getMetadataManager().getType(SERVER_TYPE_NAME, PLUGIN_NAME);
        assertNotNull(jmxServerType);

        ConfigurationDefinition pluginConfigurationDefinition = jmxServerType.getPluginConfigurationDefinition();
        ConfigurationTemplate template = pluginConfigurationDefinition.getTemplate(getPluginConfigTemplateName());
        assertNotNull(template);

        Configuration pluginConfig = template.createConfiguration();
        setupTemplatedPluginConfig(pluginConfig);

        MergeResourceResponse response = getInventoryManager().manuallyAddResource(jmxServerType,
            getPlatform().getId(), pluginConfig, -1);
View Full Code Here

    public static Configuration getDefaultPluginConfiguration(ResourceType resourceType)
    {
        ConfigurationDefinition pluginConfigurationDefinition = resourceType.getPluginConfigurationDefinition();
        if (pluginConfigurationDefinition != null)
        {
            ConfigurationTemplate template = pluginConfigurationDefinition.getDefaultTemplate();
            if (template != null)
                return template.getConfiguration().deepCopy();
        }
        return new Configuration(); // there is no default plugin config defined - return an empty one
    }
View Full Code Here

            throw new UnsupportedOperationException("Configuration wizard is only available in interactive model.");
        }

        Map<String, ConfigurationTemplate> templates = def.getTemplates();

        ConfigurationTemplate template = (ConfigurationTemplate) question(templates, null, "template", "Select from the available templates");

        return editConfiguration(def, template == null ? null : template.createConfiguration());
    }
View Full Code Here

        assert def.getPropertyDefinitionList("mike").getMin() == 0;
        assert def.getPropertyDefinitionList("mike").getMax() == Integer.MAX_VALUE;

        Map<String, ConfigurationTemplate> templates = def.getTemplates();
        ConfigurationTemplate t = templates.get("First Template");
        assert !t.isDefault();
        assert t.getConfiguration().getSimple("alpha").getStringValue().equals("template1:alpha value");
        assert t.getConfiguration().getSimple("charlie").getBooleanValue();
        assert t.getConfiguration().getSimple("delta").getIntegerValue() == 42;

        assert serverType.getBundleType() == null : "bundle should not be defined for type: " + serverType;

        // ensure the bundle target metadata is correct
        ResourceTypeBundleConfiguration bundleTargetConfig = serverType.getResourceTypeBundleConfiguration();
View Full Code Here

                null);
        return namingUrl == null;
    }

    private static Configuration getDefaultPluginConfiguration(ResourceType resourceType) {
        ConfigurationTemplate pluginConfigDefaultTemplate = resourceType.getPluginConfigurationDefinition()
            .getDefaultTemplate();
        return (pluginConfigDefaultTemplate != null) ? pluginConfigDefaultTemplate.createConfiguration()
            : new Configuration();
    }
View Full Code Here

            System.out.println("Updating Augeas root in default plugin config...");
            boolean deleteRoot = true;
            for (ResourceType resourceType : getResourceTypes(getPluginName())) {
                ConfigurationDefinition pluginConfigDef = resourceType.getPluginConfigurationDefinition();
                ConfigurationTemplate defaultPluginConfigTemplate = pluginConfigDef.getDefaultTemplate();
                Configuration defaultPluginConfig = defaultPluginConfigTemplate.getConfiguration();
                tweakDefaultPluginConfig(defaultPluginConfig);
                resetConfigFiles(defaultPluginConfig, deleteRoot);
                deleteRoot = false;
            }
View Full Code Here

    private void initSelectedOperationInfo()
    {
        ResourceType resourceType = getResourceType();
        this.selectedOperation = getOperationDefinition(resourceType, this.selectedOperationName);
        ConfigurationTemplate defaultTemplate = this.selectedOperation.getParametersConfigurationDefinition().getDefaultTemplate();
        if (defaultTemplate != null)
        {
            this.selectedOperationParameters = defaultTemplate.getConfiguration().deepCopy();
        }
        else
        {
            this.selectedOperationParameters = new Configuration();
        }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.configuration.definition.ConfigurationTemplate

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.