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

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


            assert opDefs.size() == 2;

            for (OperationDefinition odef : opDefs) {
                if (odef.getName().equals("invokeSql")) {
                    assert odef.getDescription().startsWith("Execute");
                    ConfigurationDefinition conf = odef.getParametersConfigurationDefinition();
                    assert conf != null;
                    Map<String, PropertyDefinition> props = conf.getPropertyDefinitions();
                    assert props.size() == 2;
                    for (PropertyDefinition pd : props.values()) {
                        PropertyDefinitionSimple pds = (PropertyDefinitionSimple) pd;
                        if (pds.getName().equals("sleep")) {
                            assert pds.getDescription() == null;
View Full Code Here


            vLayout = new EnhancedVLayout();

            vLayout.setOverflow(Overflow.AUTO);

            Configuration startingConfig = wizard.getSnapshotDriftDef().getConfiguration();
            ConfigurationDefinition def = DriftConfigurationDefinition.getNewPinnedTemplateInstance();
            editor = new ConfigurationEditor(def, startingConfig);
            vLayout.addMember(editor);
        }

        return vLayout;
View Full Code Here

        List<OperationDefinition> operationDefs =
            new ArrayList<OperationDefinition>(resourceType.getOperationDefinitions());

        assertEquals("Expected to find an operation definition", 1, operationDefs.size());

        ConfigurationDefinition params = operationDefs.get(0).getParametersConfigurationDefinition();

        assertNotNull("Expected to find parameters for operation definition", params);
        assertEquals("Expected to find 2 parameters", 2, params.getPropertyDefinitions().size());
        assertNotNull("Expected to find parameter named <param1>", params.get("param1"));
        assertNotNull("Expected to find parameter named <param2>", params.get("param2"));
    }
View Full Code Here

    @Test(groups = {"plugin.metadata", "Operations.UpgradePlugin"}, dependsOnMethods = {"upgradeOperationsPlugin"})
    public void addResultsToUpgradedOperationDef() {
        OperationDefinition operationDef = loadOperationDefinition("OperationServer23.Operation1", "OperationServer23",
            "OperationMetadataManagerBeanTestPlugin");
        ConfigurationDefinition resultsDef = operationDef.getResultsConfigurationDefinition();

        assertNotNull("Results definition should have been added", resultsDef);
        assertEquals("Expected results to contain one property", 1, resultsDef.getPropertyDefinitions().size());
        assertNotNull("Expected results to contain property named <exitCode>", resultsDef.get("exitCode"));
    }
View Full Code Here

    @Test(groups = {"plugin.metadata", "Operations.UpgradePlugin"}, dependsOnMethods = {"upgradeOperationsPlugin"})
    public void addParamsToUpgradedOperationDef() {
        OperationDefinition operationDef = loadOperationDefinition("OperationServer24.Operation1", "OperationServer24",
            "OperationMetadataManagerBeanTestPlugin");
        ConfigurationDefinition paramsDef = operationDef.getParametersConfigurationDefinition();

        assertNotNull("Operation parameters definition should have been added.", paramsDef);
        assertEquals("Expected to find one parameter definition.", 1, paramsDef.getPropertyDefinitions().size());
        assertNotNull("Expected parameters to contain property named <param1>",
            paramsDef.getPropertyDefinitions().get("param1"));
  }
View Full Code Here

    @Test(groups = {"plugin.metadata", "Operations.UpgradePlugin"}, dependsOnMethods = {"upgradeOperationsPlugin"})
    public void removeResultsInUpgradedOperationDef() {
        OperationDefinition operationDef = loadOperationDefinition("OperationServer24.Operation1", "OperationServer24",
            "OperationMetadataManagerBeanTestPlugin");
        ConfigurationDefinition resultsDef = operationDef.getResultsConfigurationDefinition();

        assertNull("Results definition should have been removed", resultsDef);
    }
View Full Code Here

                }

                if (lge.serverType == null) {
                    lge.serverType = new ResourceType("LargeGroupTestServerType", "testPlugin",
                        ResourceCategory.SERVER, lge.platformType);
                    lge.serverPluginConfiguration = new ConfigurationDefinition("LargeGroupTestPCDef", "pc desc");
                    lge.serverPluginConfiguration.put(new PropertyDefinitionSimple(PC_PROP1_NAME, "pc prop1desc",
                        false, PropertySimpleType.STRING));
                    lge.serverPluginConfiguration.put(new PropertyDefinitionSimple(PC_PROP2_NAME, "pc prop2desc",
                        false, PropertySimpleType.STRING));
                    lge.serverType.setPluginConfigurationDefinition(lge.serverPluginConfiguration);

                    lge.serverResourceConfiguration = new ConfigurationDefinition("LargeGroupTestRCDef", "rc desc");
                    lge.serverResourceConfiguration.put(new PropertyDefinitionSimple(RC_PROP1_NAME, "rc prop1desc",
                        false, PropertySimpleType.STRING));
                    lge.serverResourceConfiguration.put(new PropertyDefinitionSimple(RC_PROP2_NAME, "rc prop2desc",
                        false, PropertySimpleType.STRING));
                    lge.serverType.setResourceConfigurationDefinition(lge.serverResourceConfiguration);
View Full Code Here

    @Test(groups = { "plugin.metadata", "Content.UpgradePlugin" }, dependsOnMethods = { "upgradeContentPlugin" })
    public void addNewDeploymentConfigurationDefinition() throws Exception {
        PackageType packageType = loadPackageType("ContentServer", "ContentMetadataManagerBeanTestPlugin",
            "ContentServer.Content.1");

        ConfigurationDefinition deploymentConfigDef = packageType.getDeploymentConfigurationDefinition();

        assertNotNull(
            "Failed to create new deployment configuration definition for package type that previously did not have one",
            deploymentConfigDef);
        assertEquals("Expected to find 1 property definition in new deployment configuration definition", 1,
            deploymentConfigDef.getPropertyDefinitions().size());
        assertNotNull("Expected to find 1 property definition, <version>, in new deployment configuration definition",
            deploymentConfigDef.get("version"));
    }
View Full Code Here

    @Test(groups = { "plugin.metadata", "Content.UpgradePlugin" }, dependsOnMethods = { "upgradeContentPlugin" })
    public void updateDeploymentConfigDefThatExistsInOldAndNewResourceType() throws Exception {
        PackageType packageType = loadPackageType("ContentServer5", "ContentMetadataManagerBeanTestPlugin",
            "ContentServer5.Content.1");
        ConfigurationDefinition deploymentConfigDef = packageType.getDeploymentConfigurationDefinition();

        assertNotNull("Failed to update deployment configuration definition for package type", deploymentConfigDef);
        assertEquals("Expected to find 2 property definitions in updated deployment configuration definition", 2,
            deploymentConfigDef.getPropertyDefinitions().size());
        assertNotNull("Expected existing property definition to be retained across update",
            deploymentConfigDef.get("x"));
        assertNotNull("Expected new property definition to be added during update", deploymentConfigDef.get("y"));
    }
View Full Code Here

            String bundleVersion = "1.2.3";
            String bundleDescription = "test bundle desc";
            DeploymentProperties bundleMetadata = new DeploymentProperties(0, bundleName, bundleVersion,
                bundleDescription);

            ConfigurationDefinition configDef = new ConfigurationDefinition("foo", null);
            int propDefaultValue1 = 998877;
            String propDefaultValue4 = "this.is.the.default";
            String propName1 = "prop1requiredWithDefault";
            String propName2 = "prop2";
            String propName3 = "prop3requiredWithNoDefault";
            String propName4 = "prop4notRequiredWithDefault";
            String propDesc1 = "prop1desc";
            String propDesc2 = "prop2desc";
            String propDesc3 = "prop3desc";
            String propDesc4 = "prop4desc";
            PropertyDefinitionSimple propdef1requiredWithDefault = new PropertyDefinitionSimple(propName1, propDesc1,
                true, PropertySimpleType.INTEGER);
            PropertyDefinitionSimple propdef2 = new PropertyDefinitionSimple(propName2, propDesc2, false,
                PropertySimpleType.STRING);
            PropertyDefinitionSimple propdef3requiredWithNoDefault = new PropertyDefinitionSimple(propName3, propDesc3,
                true, PropertySimpleType.STRING);
            PropertyDefinitionSimple propdef4notRequiredWithDefault = new PropertyDefinitionSimple(propName4,
                propDesc4, false, PropertySimpleType.STRING);
            propdef1requiredWithDefault.setDefaultValue(String.valueOf(propDefaultValue1));
            propdef4notRequiredWithDefault.setDefaultValue(propDefaultValue4);
            configDef.put(propdef1requiredWithDefault);
            configDef.put(propdef2);
            configDef.put(propdef3requiredWithNoDefault);
            configDef.put(propdef4notRequiredWithDefault);

            Map<String, File> bundleFiles = new HashMap<String, File>(3);
            bundleFiles.put(bundleFile1, new File(tmpDir, bundleFile1));
            bundleFiles.put(bundleFile2, new File(tmpDir, bundleFile2));
            bundleFiles.put(bundleFile3, new File(tmpDir, bundleFile3));
View Full Code Here

TOP

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

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.