Examples of PluginProperty


Examples of org.jtalks.jcommune.model.entity.PluginProperty

        assertEquals(plugin.getState(), Plugin.State.ENABLED);
    }

    @Test(expectedExceptions = UnexpectedErrorException.class)
    public void configurationWithIncorrectParameterShouldThrowUnexpectedErrorException() throws Exception {
        PluginProperty property = new PluginProperty("anyProperty", PluginProperty.Type.STRING, "string");
        PluginConfiguration config = new PluginConfiguration("Questions and Answers plugin", true, Arrays.asList(property));
        QuestionsAndAnswersPlugin plugin = new QuestionsAndAnswersPlugin();

        plugin.configure(config);
    }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.PluginProperty

        plugin.configure(config);
    }

    @Test(expectedExceptions = UnexpectedErrorException.class)
    public void configurationWithIncorrectParametersNumberShouldThrowUnexpectedErrorException() throws Exception {
        PluginProperty correctProperty = new PluginProperty(ORDER_PROPERTY, PluginProperty.Type.INT, "102");
        PluginProperty incorrectProperty = new PluginProperty("anyProperty", PluginProperty.Type.STRING, "string");
        PluginConfiguration config = new PluginConfiguration("Questions and Answers plugin", true,
                Arrays.asList(correctProperty, incorrectProperty));
        QuestionsAndAnswersPlugin plugin = new QuestionsAndAnswersPlugin();

        plugin.configure(config);
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.PluginProperty

        plugin.configure(config);
    }

    @Test(expectedExceptions = UnexpectedErrorException.class)
    public void configurationWithIncorrectParameterTypeShouldThrowUnexpectedErrorException() throws Exception {
        PluginProperty property = new PluginProperty(ORDER_PROPERTY, PluginProperty.Type.INT, "string");
        PluginConfiguration config = new PluginConfiguration("Questions and Answers plugin", true, Arrays.asList(property));
        QuestionsAndAnswersPlugin plugin = new QuestionsAndAnswersPlugin();

        plugin.configure(config);
    }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.PluginProperty

        plugin.configure(config);
    }

    @Test
    public void defaultConfigurationShouldBeAppliedIfConfigureWithNullOrderValue() throws Exception {
        PluginProperty property = new PluginProperty(ORDER_PROPERTY, PluginProperty.Type.INT, null);
        PluginConfiguration config = new PluginConfiguration("Questions and Answers plugin", true, Arrays.asList(property));
        QuestionsAndAnswersPlugin plugin = new QuestionsAndAnswersPlugin();

        plugin.configure(config);
        List<PluginProperty> actualConfiguration = plugin.getConfiguration();
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.PluginProperty

        assertEquals(actualConfiguration.get(0).getValue(), "102");
    }

    @Test
    public void testApplyConfiguration() throws PluginConfigurationException {
        PluginProperty property = new PluginProperty(ORDER_PROPERTY, PluginProperty.Type.INT, "103");
        QuestionsAndAnswersPlugin plugin = new QuestionsAndAnswersPlugin();
        plugin.applyConfiguration(Arrays.asList(property));

        assertEquals(plugin.getConfiguration().size(), 1);
        assertEquals(plugin.getConfiguration().get(0).getValue(), "103");
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.PluginProperty

    }

    @Test
    public void updatePropertiesShouldUpdatePassedProperties() {
        //GIVEN
        PluginProperty property = PersistedObjectsFactory.getDefaultPluginConfigurationProperty();
        String newPropertyName = "New property name";
        property.setName(newPropertyName);
        //WHEN
        pluginConfigurationDao.updateProperties(Arrays.asList(property));
        //THEN
        session.evict(property);
        PluginProperty updatedProperty = (PluginProperty) session.get(PluginProperty.class, property.getId());
        assertEquals(updatedProperty.getName(), newPropertyName, "Property should be updated");
    }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.PluginProperty

    }

    @Test
    public void saveOrUpdateShouldSavePluginConfigurationProperties() {
        PluginConfiguration pluginConfiguration = PersistedObjectsFactory.getDefaultPluginConfiguration();
        PluginProperty property = new PluginProperty("Property", PluginProperty.Type.BOOLEAN, "true");
        List<PluginProperty> properties = Arrays.asList(property);
        pluginConfiguration.setProperties(properties);

        pluginConfigurationDao.saveOrUpdate(pluginConfiguration);
        session.flush();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.