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

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


        // Add column header cells...
        for (PropertyDefinition summaryPropertyDefinition : listMemberMapPropertyDefinition
            .getSummaryPropertyDefinitions()) {
            // We can safely cast here, because we already validated the map member definitions.
            PropertyDefinitionSimple mapMemberSimplePropertyDefinition = (PropertyDefinitionSimple) listMemberMapPropertyDefinition
                .get(summaryPropertyDefinition.getName());
            FacesComponentUtility.addVerbatimText(parent, "<th class='"
                + PROPERTY_MAP_SUMMARY_DATA_HEADER_CELL_STYLE_CLASS + "'>");
            FacesComponentUtility.addOutputText(parent, this.config,
                mapMemberSimplePropertyDefinition.getDisplayName(), PROPERTY_MAP_SUMMARY_HEADER_TEXT_STYLE_CLASS);
            FacesComponentUtility.addVerbatimText(parent, "</th>\n");
        }

        // add the "Actions" header
        FacesComponentUtility.addVerbatimText(parent, "<th class='" + PROPERTY_MAP_SUMMARY_DATA_HEADER_CELL_STYLE_CLASS
View Full Code Here


   

    private ResourceType createResourceType() throws Exception {
        ResourceType resourceType = new ResourceType("RHQ Storage Node", "RHQStorage", ResourceCategory.SERVER, null);
        ConfigurationDefinition pluginConfigurationDefinition = new ConfigurationDefinition("config", null);
        pluginConfigurationDefinition.put(new PropertyDefinitionSimple("host", null, true, PropertySimpleType.STRING));
        resourceType.setPluginConfigurationDefinition(pluginConfigurationDefinition);
        getEntityManager().persist(resourceType);

        return resourceType;
    }
View Full Code Here

        assertEquals(project.getBundleVersion(), "1.0");
        assertEquals(project.getBundleDescription(), "example.com corporate website hosted on JBoss EAP 4.3");

        ConfigurationDefinition configDef = project.getConfigurationDefinition();
        assertEquals(configDef.getPropertyDefinitions().size(), 1, String.valueOf(configDef.getPropertyDefinitions()));
        PropertyDefinitionSimple propDef = configDef.getPropertyDefinitionSimple("listener.port");
        assertNotNull(propDef);
        assertEquals(propDef.getType(), PropertySimpleType.INTEGER);
        assertEquals(propDef.getDefaultValue(), "8080");
        assertEquals(propDef.getDescription(), "This is where the product will listen for incoming messages");
        assertTrue(propDef.isRequired());

        // all we did was parse, nothing should really have been extracted or installed
        assertFalse(DEPLOY_DIR.exists(), "Nothing should have been installed to the deploy dir");
    }
View Full Code Here

        assertEquals(project.getBundleVersion(), "1.0");
        assertEquals(project.getBundleDescription(), "example.com corporate website hosted on JBoss EAP 4.3");

        ConfigurationDefinition configDef = project.getConfigurationDefinition();
        assertEquals(configDef.getPropertyDefinitions().size(), 1, String.valueOf(configDef.getPropertyDefinitions()));
        PropertyDefinitionSimple propDef = configDef.getPropertyDefinitionSimple("listener.port");
        assertNotNull(propDef);
        assertEquals(propDef.getType(), PropertySimpleType.INTEGER);
        assertEquals(propDef.getDefaultValue(), "8080");
        assertEquals(propDef.getDescription(), "This is where the product will listen for incoming messages");
        assertTrue(propDef.isRequired());

        // make sure our test infrastruction setup the input properties correctly
        Configuration config = project.getConfiguration();
        assertEquals(config.getProperties().size(), 1, String.valueOf(config.getProperties()));
        assertEquals(config.getSimpleValue("listener.port", null), "10000", String.valueOf(config.getProperties()));
View Full Code Here

        assertEquals(project.getBundleVersion(), "2.5");
        assertEquals(project.getBundleDescription(), "updated bundle");

        ConfigurationDefinition configDef = project.getConfigurationDefinition();
        assertEquals(configDef.getPropertyDefinitions().size(), 1, String.valueOf(configDef.getPropertyDefinitions()));
        PropertyDefinitionSimple propDef = configDef.getPropertyDefinitionSimple("listener.port");
        assertNotNull(propDef);
        assertEquals(propDef.getType(), PropertySimpleType.INTEGER);
        assertEquals(propDef.getDefaultValue(), "9090");
        assertEquals(propDef.getDescription(), "This is where the product will listen for incoming messages");
        assertTrue(propDef.isRequired());

        // make sure our test infrastruction setup the input properties correctly
        Configuration config = project.getConfiguration();
        assertEquals(config.getProperties().size(), 1);
        assertEquals(config.getSimpleValue("listener.port", null), "20000", String.valueOf(config.getProperties()));
View Full Code Here

        assertEquals(project.getBundleVersion(), "2.5");
        assertEquals(project.getBundleDescription(), "updated bundle");

        ConfigurationDefinition configDef = project.getConfigurationDefinition();
        assertEquals(configDef.getPropertyDefinitions().size(), 1, String.valueOf(configDef.getPropertyDefinitions()));
        PropertyDefinitionSimple propDef = configDef.getPropertyDefinitionSimple("listener.port");
        assertNotNull(propDef);
        assertEquals(propDef.getType(), PropertySimpleType.INTEGER);
        assertEquals(propDef.getDefaultValue(), "9090");
        assertEquals(propDef.getDescription(), "This is where the product will listen for incoming messages");
        assertTrue(propDef.isRequired());

        // make sure our test infrastruction setup the input properties correctly
        Configuration config = project.getConfiguration();
        assertEquals(config.getProperties().size(), 1);
        assertEquals(config.getSimpleValue("listener.port", null), "20000", String.valueOf(config.getProperties()));
View Full Code Here

        assertNull(project.getBundleDescription());

        // we have one property that we use to realize our content
        ConfigurationDefinition configDef = project.getConfigurationDefinition();
        assertEquals(configDef.getPropertyDefinitions().size(), 1, String.valueOf(configDef.getPropertyDefinitions()));
        PropertyDefinitionSimple propDef = configDef.getPropertyDefinitionSimple("listener.port");
        assertNotNull(propDef);
        assertEquals(propDef.getType(), PropertySimpleType.INTEGER);
        assertNull(propDef.getDefaultValue(), "recipe didn't define a default for our property");
        assertNull(propDef.getDescription(), "recipe didn't define a description for our property");
        assertTrue(propDef.isRequired(), "recipe didn't make the property required, but the default should be required");

        if (!dryRun) {
            assertTrue(new File(DEPLOY_DIR, "file.zip").exists(), "should be here, we told it to stay compressed");
        } else {
            assertFalse(new File(DEPLOY_DIR, "file.zip").exists(), "this was a dry run, should not be here");
View Full Code Here

                    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;
                        }
                        if (pds.getName().equals("invokeSql")) {
                            List<PropertyDefinitionEnumeration> pde = pds.getEnumeratedValues();
                            assert pde.size() == 2;
                        }
                    }

                    conf = odef.getResultsConfigurationDefinition();
View Full Code Here

        return index;
    }

    public void refresh() {
        for (PropertyDefinition subDef : memberPropertyDefinitions) {
            PropertyDefinitionSimple subDefSimple = (PropertyDefinitionSimple) subDef;
            String propertyName = subDefSimple.getName();
            PropertySimple propertySimple = propertyMap.getSimple(propertyName);

            if ((propertySimple != null) && (propertySimple.getStringValue() != null)) {
                try {
                    switch (((PropertyDefinitionSimple) subDef).getType()) {
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);

                    em.persist(lge.serverType);
                    em.flush();
View Full Code Here

TOP

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

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.