Package org.rhq.core.domain.configuration

Examples of org.rhq.core.domain.configuration.Configuration


        assertEquals(configDef.getPropertyDefinitions().size(), 1, String.valueOf(configDef.getPropertyDefinitions()));
        PropertyDefinitionSimple propDef = configDef.getPropertyDefinitionSimple("listener.port");
        assertNotNull(propDef);

        // 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), "777", String.valueOf(config.getProperties()));

        String preinstallTargetExecuted = (String) project.getProperties().get("preinstallTargetExecuted");
        assertEquals(preinstallTargetExecuted, "1a");
        String postinstallTargetExecuted = (String) project.getProperties().get("postinstallTargetExecuted");
        assertEquals(postinstallTargetExecuted, "1b");
View Full Code Here


        propDef = projectConfigDef.getPropertyDefinitionSimple("myapp.runtime.name");
        assertNotNull(propDef);
        assertEquals(propDef.getType(), PropertySimpleType.STRING);
        assertTrue(propDef.isRequired());

        Configuration projectConfig = project.getConfiguration();
        assertNotNull(projectConfig);
        assertEquals(projectConfig.getProperties().size(), 3, String.valueOf(projectConfig.getProperties()));
        assertEquals(projectConfig.getSimpleValue("myapp.datasource.property"), "10",
            String.valueOf(projectConfig.getProperties()));
        assertEquals(projectConfig.getSimpleValue("myapp.listener.port"), "9777",
            String.valueOf(projectConfig.getProperties()));
        assertEquals(projectConfig.getSimpleValue("myapp.runtime.name"), "site.war",
            String.valueOf(projectConfig.getProperties()));

        assertEquals(handoverInfoArguments.size(), 2, String.valueOf(handoverInfoArguments));
        Iterator<HandoverInfoArgument> handoverInfoIterator = handoverInfoArguments.iterator();

        HandoverInfoArgument handoverInfoArgument = handoverInfoIterator.next();
View Full Code Here

* @author Ian Springer
*/
public class AggregateConfigurationBuilder {
    public static Configuration buildAggregateConfiguration(List<Configuration> configurations,
        ConfigurationDefinition configurationDefinition) {
        Configuration aggregateConfiguration = new Configuration();

        if (configurations.isEmpty()) {
            return aggregateConfiguration;
        }

View Full Code Here

                    res.setAgent(lge.agent);
                    res.setInventoryStatus(inventoryStatus);
                    lge.platformResource.addChildResource(res);

                    // give it an initial plugin configuration
                    Configuration pc = new Configuration();
                    pc.put(new PropertySimple(PC_PROP1_NAME, PC_PROP1_VALUE));
                    pc.put(new PropertySimple(PC_PROP2_NAME, res.getId()));
                    em.persist(pc);
                    res.setPluginConfiguration(pc);

                    if ((i % 100) == 0) {
                        System.out.print(i);
View Full Code Here

        assertDriftFilePersisted(driftFile2, "driftFile2", driftFile2Content);
    }

    public void persistResourceChangeSet() {
        // first create and persist the drift definition
        final DriftDefinition driftDef = new DriftDefinition(new Configuration());
        driftDef.setName(NAME_PREFIX + "persistResourceChangeSet");
        driftDef.setEnabled(true);
        driftDef.setDriftHandlingMode(normal);
        driftDef.setInterval(2400L);
        driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
View Full Code Here

        final JPADriftSet driftSet = new JPADriftSet();
        driftSet.addDrift(drift1);
        driftSet.addDrift(drift2);

        // next create the drift definition
        final DriftDefinition driftDef = new DriftDefinition(new Configuration());
        driftDef.setName(NAME_PREFIX + "copyChangeSet");
        driftDef.setEnabled(true);
        driftDef.setDriftHandlingMode(normal);
        driftDef.setInterval(2400L);
        driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
View Full Code Here

                assert bv.getConfigurationDefinition().getPropertyDefinitionSimple(propName4).getType() == PropertySimpleType.STRING;
                assert bv.getRecipe().equals(recipe);

                // make sure the default template is correct
                ConfigurationTemplate defaultTemplate = bv.getConfigurationDefinition().getDefaultTemplate();
                Configuration defaultConfig = defaultTemplate.getConfiguration();
                assert defaultConfig.getProperties().size() == 3; // prop2 is not required and has no default, thus is missing
                PropertySimple prop1 = defaultConfig.getSimple(propName1);
                PropertySimple prop2 = defaultConfig.getSimple(propName2);
                PropertySimple prop3 = defaultConfig.getSimple(propName3);
                PropertySimple prop4 = defaultConfig.getSimple(propName4);
                assert prop1 != null;
                assert prop2 == null : "prop2 was not required and has no default, it should not be in the default template config";
                assert prop3 != null;
                assert prop4 != null;
                assert prop1.getIntegerValue() != null;
View Full Code Here

        assertNotNull(bv1);
        ResourceGroup platformResourceGroup = createTestResourceGroup();
        assertNotNull(platformResourceGroup);
        BundleDestination dest1 = createDestination(b1, "one", "/test", platformResourceGroup);
        assertNotNull(dest1);
        Configuration config = new Configuration();
        try {
            createDeployment("one", bv1, dest1, config);
            fail("Bad config was accepted");
        } catch (Exception e) {
            // expected due to bad config
        }
        config.put(new PropertySimple("bundletest.property", "bundletest.property value"));
        assertNotNull(createDeployment("one", bv1, dest1, config));
    }
View Full Code Here

    public void testDeployBundle() throws Exception {
        Bundle b1 = createBundle("one");
        assertNotNull(b1);
        BundleVersion bv1 = createBundleVersion(b1.getName() + "-1", null, b1);
        assertNotNull(bv1);
        Configuration config = new Configuration();
        config.put(new PropertySimple("bundletest.property", "bundletest.property value"));
        ResourceGroup platformResourceGroup = createTestResourceGroup();
        assertNotNull(platformResourceGroup);
        BundleDestination dest1 = createDestination(b1, "one", "/test", platformResourceGroup);
        assertNotNull(dest1);
        BundleDeployment bd1 = createDeployment("one", bv1, dest1, config);
View Full Code Here

        // allow global
        addRolePermissions(role, Permission.DEPLOY_BUNDLES);
        BundleDestination dest1 = createDestination(subject, b1, "one", "/test", platformResourceGroup);
        assertNotNull(dest1);
        Configuration config = new Configuration();
        config.put(new PropertySimple("bundletest.property", "bundletest.property value"));
        BundleDeployment bd1;
        bd1 = createDeployment(subject, "one", bv1, dest1, config);
        assertNotNull(bd1);

        // allow group
        removeRolePermissions(role, Permission.DEPLOY_BUNDLES);
        addRolePermissions(role, Permission.DEPLOY_BUNDLES_TO_GROUP);
        BundleDestination dest2 = createDestination(subject, b1, "two", "/test2", platformResourceGroup);
        assertNotNull(dest2);
        Configuration config2 = new Configuration();
        config2.put(new PropertySimple("bundletest.property", "bundletest.property value"));
        BundleDeployment bd2;
        bd2 = createDeployment(subject, "two", bv1, dest2, config2);
        assertNotNull(bd1);

        // deny delete deployment
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.configuration.Configuration

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.