Examples of PluginProperty


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

        return Collections.emptyMap();
    }

    @Override
    public List<PluginProperty> getDefaultConfiguration() {
        PluginProperty url = new PluginProperty("URL", STRING, "http://localhost:1234");
        return Arrays.asList(url);
    }
View Full Code Here

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

    /**
     * {@inheritDoc}
     */
    @Override
    public List<PluginProperty> getConfiguration() {
        PluginProperty orderProperty = new PluginProperty(ORDER_PROPERTY, PluginProperty.Type.INT,
                String.valueOf(order));
        orderProperty.setHint(ORDER_HINT);
        return Arrays.asList(orderProperty);
    }
View Full Code Here

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

    /**
     * {@inheritDoc}
     */
    @Override
    public List<PluginProperty> getDefaultConfiguration() {
        PluginProperty orderProperty = new PluginProperty(ORDER_PROPERTY, PluginProperty.Type.INT,
                String.valueOf(DEFAULT_ORDER_VALUE));
        orderProperty.setHint(ORDER_HINT);
        return Arrays.asList(orderProperty);
    }
View Full Code Here

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

        return pluginProperties;
    }

    @Override
    public List<PluginProperty> getDefaultConfiguration() {
        PluginProperty width = new PluginProperty(WIDTH_PROPERTY, INT, "100");
        PluginProperty height = new PluginProperty(HEIGHT_PROPERTY, INT, "50");
        PluginProperty length = new PluginProperty(LENGTH_PROPERTY, INT, "4");
        PluginProperty possibleSymbols = new PluginProperty(POSSIBLE_SYMBOLS_PROPERTY, STRING, "0123456789");
        return Arrays.asList(width, height, length, possibleSymbols);
    }
View Full Code Here

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

        doCallRealMethod().when(plugin).getState();
    }

    @Test
    public void configureShouldApplyConfiguration() throws Exception{
        List<PluginProperty> properties = Arrays.asList(new PluginProperty());
        when(configuration.getProperties()).thenReturn(properties);
        when(plugin.applyConfiguration(properties)).thenReturn(Collections.<PluginProperty, String>emptyMap());

        plugin.configure(configuration);
        verify(plugin).applyConfiguration(properties);
View Full Code Here

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

        verify(plugin).applyConfiguration(properties);
    }

    @Test(expectedExceptions = UnexpectedErrorException.class)
    public void configureShouldThrowUnexpectedErrorExceptionWhenRuntimeExceptionOccurs() throws Exception{
        List<PluginProperty> properties = Arrays.asList(new PluginProperty());
        when(configuration.getProperties()).thenReturn(properties);
        when(plugin.applyConfiguration(properties)).thenThrow(new RuntimeException());

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

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

        plugin.configure(configuration);
    }

    @Test
    public void getStateShouldReturnEnabledStateWhenPluginConfiguredAsActive() throws Exception{
        List<PluginProperty> properties = Arrays.asList(new PluginProperty());
        when(configuration.getProperties()).thenReturn(properties);
        when(configuration.isActive()).thenReturn(true);
        when(plugin.applyConfiguration(properties)).thenReturn(Collections.<PluginProperty, String>emptyMap());

        plugin.configure(configuration);
View Full Code Here

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

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

    @Test
    public void getStateShouldReturnConfiguredStateWhenPluginConfiguredAsNotActive() throws Exception{
        List<PluginProperty> properties = Arrays.asList(new PluginProperty());
        when(configuration.getProperties()).thenReturn(properties);
        when(configuration.isActive()).thenReturn(false);
        when(plugin.applyConfiguration(properties)).thenReturn(Collections.<PluginProperty, String>emptyMap());

        plugin.configure(configuration);
View Full Code Here

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

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

    @Test
    public void getStateShouldReturnInErrorStateWhenConfigurationErrorOccurs() throws PluginConfigurationException {
        List<PluginProperty> properties = Arrays.asList(new PluginProperty());
        when(configuration.getProperties()).thenReturn(properties);
        when(plugin.applyConfiguration(properties)).thenThrow(new RuntimeException());

        try {
            plugin.configure(configuration);
View Full Code Here

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

    private static final String ORDER_PROPERTY = "label.order";

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

        plugin.configure(config);
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.