Package org.jtalks.jcommune.model.entity

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


        assertReflectionEquals(foundPluginConfiguration, pluginConfiguration);
    }

    @Test
    public void getWithPassedIdOfNonExistingPluginShouldReturnNull() {
        PluginConfiguration nonExistPluginConfiguration = pluginConfigurationDao.get(-788888L);

        assertNull(nonExistPluginConfiguration, "PluginConfiguration doesn't exist, so get must return null");
    }
View Full Code Here


    }

    @Test
    public void saveOrUpdateShouldUpdatePluginConfiguration() {
        String newPluginName = "Poulpe pluginConfiguration";
        PluginConfiguration pluginConfiguration = PersistedObjectsFactory.getDefaultPluginConfiguration();
        pluginConfiguration.setName(newPluginName);

        pluginConfigurationDao.saveOrUpdate(pluginConfiguration);
        session.flush();
        session.clear();
        PluginConfiguration updatedPluginConfiguration = (PluginConfiguration) session.get(PluginConfiguration.class, pluginConfiguration.getId());

        assertEquals(updatedPluginConfiguration.getName(), newPluginName, "After update pluginConfiguration properties must be updated.");
    }
View Full Code Here

        assertEquals(updatedPluginConfiguration.getName(), newPluginName, "After update pluginConfiguration properties must be updated.");
    }

    @Test
    public void saveOrUpdateShouldSaveNewPluginConfiguration() {
        PluginConfiguration newPluginConfiguration = new PluginConfiguration("New PluginConfiguration", true, Collections.<PluginProperty>emptyList());

        pluginConfigurationDao.saveOrUpdate(newPluginConfiguration);
        session.evict(newPluginConfiguration);
        PluginConfiguration savedPluginConfiguration = (PluginConfiguration) session.get(PluginConfiguration.class, newPluginConfiguration.getId());

        assertReflectionEquals(newPluginConfiguration, savedPluginConfiguration);
    }
View Full Code Here

        assertReflectionEquals(newPluginConfiguration, savedPluginConfiguration);
    }

    @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();
        session.evict(pluginConfiguration);
        PluginConfiguration updatedPluginConfiguration = (PluginConfiguration) session.get(PluginConfiguration.class, pluginConfiguration.getId());

        assertEquals(updatedPluginConfiguration.getProperties(), properties, "Plugin configuration properties should be saved.");
    }
View Full Code Here

        assertEquals(updatedPluginConfiguration.getProperties(), properties, "Plugin configuration properties should be saved.");
    }

    @Test(expectedExceptions = org.hibernate.exception.ConstraintViolationException.class)
    public void saveOrUpdateWithNullValuesShouldNotSavePlugin() {
        PluginConfiguration pluginConfiguration = PersistedObjectsFactory.getDefaultPluginConfiguration();

        pluginConfiguration.setName(null);
        pluginConfigurationDao.saveOrUpdate(pluginConfiguration);
        session.flush();
    }
View Full Code Here

        session.flush();
    }

    @Test
    public void getByNameShouldReturnOnePluginConfiguration() throws NotFoundException {
        PluginConfiguration pluginConfiguration = PersistedObjectsFactory.getDefaultPluginConfiguration();

        PluginConfiguration actual = pluginConfigurationDao.get(pluginConfiguration.getName());

        assertEquals(actual, pluginConfiguration);
    }
View Full Code Here

TOP

Related Classes of org.jtalks.jcommune.model.entity.PluginConfiguration

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.