use of org.guvnor.structure.server.config.ConfigGroup in project kie-wb-common by kiegroup.
the class AppSetup method getGlobalConfiguration.
private ConfigGroup getGlobalConfiguration() {
// Global Configurations used by many of Drools Workbench editors
final ConfigGroup group = configurationFactory.newConfigGroup(ConfigType.GLOBAL, GLOBAL_SETTINGS, "");
group.addConfigItem(configurationFactory.newConfigItem("drools.dateformat", "dd-MMM-yyyy"));
group.addConfigItem(configurationFactory.newConfigItem("drools.datetimeformat", "dd-MMM-yyyy hh:mm:ss"));
group.addConfigItem(configurationFactory.newConfigItem("drools.defaultlanguage", "en"));
group.addConfigItem(configurationFactory.newConfigItem("drools.defaultcountry", "US"));
group.addConfigItem(configurationFactory.newConfigItem("build.enable-incremental", "true"));
group.addConfigItem(configurationFactory.newConfigItem("rule-modeller-onlyShowDSLStatements", "false"));
return group;
}
use of org.guvnor.structure.server.config.ConfigGroup in project kie-wb-common by kiegroup.
the class BaseAppSetupTest method setupUndefinedConfigurationGroupTest.
@Test
public void setupUndefinedConfigurationGroupTest() {
doReturn(new ArrayList<>()).when(configurationService).getConfiguration(eq(ConfigType.GLOBAL));
final ConfigType configType = ConfigType.GLOBAL;
final String configGroupName = BaseAppSetup.GLOBAL_SETTINGS;
final ConfigGroup configGroup = setupPredefinedGlobalConfiguration();
baseAppSetup.setupConfigurationGroup(configType, configGroupName, configGroup);
verify(configurationService).addConfiguration(any(ConfigGroup.class));
verify(configurationService, never()).updateConfiguration(any(ConfigGroup.class));
}
use of org.guvnor.structure.server.config.ConfigGroup in project kie-wb-common by kiegroup.
the class BaseAppSetupTest method mockConfigurations.
private void mockConfigurations() {
// doReturn( new ArrayList<ConfigGroup>() ).when( configurationService ).getConfiguration( any( ConfigType.class ) );
doReturn(true).when(configurationService).updateConfiguration(any(ConfigGroup.class));
doReturn(true).when(configurationService).addConfiguration(any(ConfigGroup.class));
doReturn(new ConfigGroup()).when(configurationFactory).newConfigGroup(any(ConfigType.class), anyString(), anyString());
}
use of org.guvnor.structure.server.config.ConfigGroup in project kie-wb-common by kiegroup.
the class AbstractWeldBuilderIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
// Define mandatory properties
List<ConfigGroup> globalConfigGroups = configurationService.getConfiguration(ConfigType.GLOBAL);
boolean globalSettingsDefined = false;
for (ConfigGroup globalConfigGroup : globalConfigGroups) {
if (GLOBAL_SETTINGS.equals(globalConfigGroup.getName())) {
globalSettingsDefined = true;
break;
}
}
if (!globalSettingsDefined) {
configurationService.addConfiguration(getGlobalConfiguration());
}
}
use of org.guvnor.structure.server.config.ConfigGroup in project kie-wb-common by kiegroup.
the class InternalMigrationServiceTest method testGetOrgUnitsByRepo.
@Test
public void testGetOrgUnitsByRepo() {
final String repo1Name = "repo1", repo2Name = "repo2", repo3Name = "repo3", space1Name = "space1", space2Name = "space2";
final int numberOfRepositories = 3;
List<ConfigGroup> ouConfigs = new ArrayList<>();
List<String> space1Repos = Arrays.asList(new String[] { repo1Name, repo2Name });
List<String> space2Repos = Arrays.asList(new String[] { repo3Name });
ConfigItem<List<String>> space1Config = new ConfigItem<>();
space1Config.setName("repositories");
space1Config.setValue(space1Repos);
ConfigItem<List<String>> space2Config = new ConfigItem<>();
space2Config.setName("repositories");
space2Config.setValue(space2Repos);
ConfigGroup space1 = new ConfigGroup();
space1.setConfigItem(space1Config);
space1.setName(space1Name);
ConfigGroup space2 = new ConfigGroup();
space2.setConfigItem(space2Config);
space2.setName(space2Name);
ouConfigs.add(space1);
ouConfigs.add(space2);
Map<String, String> orgUnitsByRepo = internalMigrationService.getOrgUnitsByRepo(ouConfigs);
assertEquals(numberOfRepositories, orgUnitsByRepo.size());
assertEquals(space1Name, orgUnitsByRepo.get(repo1Name));
assertEquals(space1Name, orgUnitsByRepo.get(repo2Name));
assertEquals(space2Name, orgUnitsByRepo.get(repo3Name));
}
Aggregations