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

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


        public Importer<NoSingleEntity, String> getImporter() {
            return new Importer<NoSingleEntity, String>() {

                @Override
                public ConfigurationDefinition getImportConfigurationDefinition() {
                    return new ConfigurationDefinition("fake", null);
                }

                @Override
                public void configure(Configuration importConfiguration) {
                    importerConfigured = true;
View Full Code Here


        assertEquals(project.getBundleName(), "example.com (JBoss EAP 4.3)");
        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());
View Full Code Here

        assertEquals(project.getBundleName(), "example.com (JBoss EAP 4.3)");
        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());
View Full Code Here

        assertEquals(project.getBundleName(), "example.com (JBoss EAP 4.3)");
        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());
View Full Code Here

        assertEquals(project.getBundleName(), "example.com (JBoss EAP 4.3)");
        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());
View Full Code Here

        assertEquals(project.getBundleName(), "test compressed archive files");
        assertEquals(project.getBundleVersion(), "1.0");
        assertNull(project.getBundleDescription());

        // while we are here, let's see that we have 0 config props
        ConfigurationDefinition configDef = project.getConfigurationDefinition();
        assertEquals(configDef.getPropertyDefinitions().size(), 0, String.valueOf(configDef.getPropertyDefinitions()));
        Configuration config = project.getConfiguration();
        assertEquals(config.getProperties().size(), 0, String.valueOf(config.getProperties()));

        if (!dryRun) {
            assertTrue(new File(DEPLOY_DIR, "file.zip").exists(), "should be here, we told it to stay compressed");
View Full Code Here

        assertEquals(project.getBundleName(), "test compressed archive files");
        assertEquals(project.getBundleVersion(), "1.0");
        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");
View Full Code Here

        assertNotNull(bundleFiles);
        assertEquals(bundleFiles.size(), 1, String.valueOf(bundleFiles));
        assertTrue(bundleFiles.contains("test-audit.properties"), String.valueOf(bundleFiles));

        // sanity check - make sure our recipe defined this property
        ConfigurationDefinition configDef = project.getConfigurationDefinition();
        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()));
View Full Code Here

    public void testUpdateContentSourceTypes() throws Throwable {
        ContentSourceType type1;
        ContentSourceType type2;
        ContentSourceType type3;
        ContentSourceType type4;
        ConfigurationDefinition def;

        try {
            registerPlugin("./test/metadata/content-source-update-v1.xml");
            type1 = getContentSourceType("testCSPHT1");
            type2 = getContentSourceType("testCSPHT2");
            type3 = getContentSourceType("testCSPHT3");
            type4 = getContentSourceType("testCSPHT4");

            assert type1 != null;
            assert type2 != null;
            assert type3 == null;
            assert type4 != null;

            assert type1.getId() > 0;
            assert type1.getName().equals("testCSPHT1");
            assert type1.getDisplayName().equals("displayName1");
            assert type1.getDescription().equals("description1");
            assert type1.getContentSourceApiClass().equals("org.abc.ApiClass1");
            def = type1.getContentSourceConfigurationDefinition();
            assert def.getPropertyDefinitions().size() == 1;
            assert def.getPropertyDefinitionSimple("prop1").getType() == PropertySimpleType.DIRECTORY;
            assert def.getPropertyDefinitionSimple("prop1").isRequired() == true;

            assert type2.getId() > 0;
            assert type2.getName().equals("testCSPHT2");
            assert type2.getDisplayName().equals("displayName2");
            assert type2.getDescription().equals("description2");
            assert type2.getContentSourceApiClass().equals("org.abc.ApiClass2");
            def = type2.getContentSourceConfigurationDefinition();
            assert def.getPropertyDefinitions().size() == 1;
            assert def.getPropertyDefinitionSimple("prop2").getType() == PropertySimpleType.INTEGER;
            assert def.getPropertyDefinitionSimple("prop2").isRequired() == false;

            assert type4.getId() > 0;
            assert type4.getName().equals("testCSPHT4");
            assert type4.getDisplayName().equals("displayName4");
            assert type4.getDescription().equals("description4");
            assert type4.getContentSourceApiClass().equals("org.abc.ApiClass4");
            def = type4.getContentSourceConfigurationDefinition();
            assert def.getPropertyDefinitions().size() == 1;
            assert def.getPropertyDefinitionSimple("prop4").getType() == PropertySimpleType.FILE;
            assert def.getPropertyDefinitionSimple("prop4").isRequired() == false;

            // now hot deploy a new version of that plugin
            registerPlugin("./test/metadata/content-source-update-v2.xml");
            getEntityManager().clear();
            type1 = getContentSourceType("testCSPHT1");
            type2 = getContentSourceType("testCSPHT2");
            type3 = getContentSourceType("testCSPHT3");
            type4 = getContentSourceType("testCSPHT4");

            assert type1 != null;
            assert type2 == null;
            assert type3 != null;
            assert type4 != null;

            assert type1.getId() > 0;
            assert type1.getName().equals("testCSPHT1");
            assert type1.getDisplayName().equals("displayName1");
            assert type1.getDescription().equals("description1");
            assert type1.getContentSourceApiClass().equals("org.abc.ApiClass1");
            def = type1.getContentSourceConfigurationDefinition();
            assert def.getPropertyDefinitions().size() == 1;
            assert def.getPropertyDefinitionSimple("prop1").getType() == PropertySimpleType.DIRECTORY;
            assert def.getPropertyDefinitionSimple("prop1").isRequired() == true;

            assert type3.getId() > 0;
            assert type3.getName().equals("testCSPHT3");
            assert type3.getDisplayName().equals("displayName3");
            assert type3.getDescription().equals("description3");
            assert type3.getContentSourceApiClass().equals("org.abc.ApiClass3");
            def = type3.getContentSourceConfigurationDefinition();
            assert def.getPropertyDefinitions().size() == 1;
            assert def.getPropertyDefinitionSimple("prop3").getType() == PropertySimpleType.STRING;
            assert def.getPropertyDefinitionSimple("prop3").isRequired() == true;

            assert type4.getId() > 0;
            assert type4.getName().equals("testCSPHT4");
            assert type4.getDisplayName().equals("displayName4changed");
            assert type4.getDescription().equals("description4changed");
            assert type4.getContentSourceApiClass().equals("org.abc.ApiClass4changed");
            def = type4.getContentSourceConfigurationDefinition();
            assert def.getPropertyDefinitions().size() == 2;
            assert def.getPropertyDefinitionSimple("prop4_1").getType() == PropertySimpleType.INTEGER;
            assert def.getPropertyDefinitionSimple("prop4_1").isRequired() == false;
            assert def.getPropertyDefinitionSimple("prop4_2").getType() == PropertySimpleType.BOOLEAN;
            assert def.getPropertyDefinitionSimple("prop4_2").isRequired() == false;

            // Now try the other way round - our first set of asserts from before should again pass
            registerPlugin("./test/metadata/content-source-update-v1.xml");
            type1 = getContentSourceType("testCSPHT1");
            type2 = getContentSourceType("testCSPHT2");
            type3 = getContentSourceType("testCSPHT3");
            type4 = getContentSourceType("testCSPHT4");

            assert type1 != null;
            assert type2 != null;
            assert type3 == null;
            assert type4 != null;

            assert type1.getId() > 0;
            assert type1.getName().equals("testCSPHT1");
            assert type1.getDisplayName().equals("displayName1");
            assert type1.getDescription().equals("description1");
            assert type1.getContentSourceApiClass().equals("org.abc.ApiClass1");
            def = type1.getContentSourceConfigurationDefinition();
            assert def.getPropertyDefinitions().size() == 1;
            assert def.getPropertyDefinitionSimple("prop1").getType() == PropertySimpleType.DIRECTORY;
            assert def.getPropertyDefinitionSimple("prop1").isRequired() == true;

            assert type2.getId() > 0;
            assert type2.getName().equals("testCSPHT2");
            assert type2.getDisplayName().equals("displayName2");
            assert type2.getDescription().equals("description2");
            assert type2.getContentSourceApiClass().equals("org.abc.ApiClass2");
            def = type2.getContentSourceConfigurationDefinition();
            assert def.getPropertyDefinitions().size() == 1;
            assert def.getPropertyDefinitionSimple("prop2").getType() == PropertySimpleType.INTEGER;
            assert def.getPropertyDefinitionSimple("prop2").isRequired() == false;

            assert type4.getId() > 0;
            assert type4.getName().equals("testCSPHT4");
            assert type4.getDisplayName().equals("displayName4");
            assert type4.getDescription().equals("description4");
            assert type4.getContentSourceApiClass().equals("org.abc.ApiClass4");
            def = type4.getContentSourceConfigurationDefinition();
            assert def.getPropertyDefinitions().size() == 1;
            assert def.getPropertyDefinitionSimple("prop4").getType() == PropertySimpleType.FILE;
            assert def.getPropertyDefinitionSimple("prop4").isRequired() == false;
        } catch (Throwable t) {
            t.printStackTrace();
            throw t;
        } finally {
        }
View Full Code Here

        assertNotNull(bundleFiles);
        assertEquals(bundleFiles.size(), 2, String.valueOf(bundleFiles));
        assertTrue(bundleFiles.contains("prepareDatasource.cli"), String.valueOf(bundleFiles)); // handed over file
        assertTrue(bundleFiles.contains("fileToHandover.zip"), String.valueOf(bundleFiles)); // handed over archive

        ConfigurationDefinition projectConfigDef = project.getConfigurationDefinition();
        assertEquals(projectConfigDef.getPropertyDefinitions().size(), 3,
            String.valueOf(projectConfigDef.getPropertyDefinitions()));

        PropertyDefinitionSimple propDef = projectConfigDef.getPropertyDefinitionSimple("myapp.datasource.property");
        assertNotNull(propDef);
        assertEquals(propDef.getType(), PropertySimpleType.INTEGER);
        assertTrue(propDef.isRequired());

        propDef = projectConfigDef.getPropertyDefinitionSimple("myapp.listener.port");
        assertNotNull(propDef);
        assertEquals(propDef.getType(), PropertySimpleType.INTEGER);
        assertTrue(propDef.isRequired());

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

        Configuration projectConfig = project.getConfiguration();
View Full Code Here

TOP

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

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.