Search in sources :

Example 1 with PropertiesFileConfiguration

use of org.candlepin.common.config.PropertiesFileConfiguration in project candlepin by candlepin.

the class CustomizableModulesTest method shouldLoadAndParseConfigurationFile.

@Test
public void shouldLoadAndParseConfigurationFile() throws Exception {
    Configuration config = new PropertiesFileConfiguration(getAbsolutePath("customizable_modules_test.conf"));
    Set<Module> loaded = new CustomizableModules().load(config);
    assertEquals(1, loaded.size());
    assertTrue(loaded.iterator().next() instanceof DummyModuleForTesting);
}
Also used : PropertiesFileConfiguration(org.candlepin.common.config.PropertiesFileConfiguration) Configuration(org.candlepin.common.config.Configuration) PropertiesFileConfiguration(org.candlepin.common.config.PropertiesFileConfiguration) Module(com.google.inject.Module) Test(org.junit.Test)

Example 2 with PropertiesFileConfiguration

use of org.candlepin.common.config.PropertiesFileConfiguration in project candlepin by candlepin.

the class CustomizableModulesTest method shouldFailWhenConfigurationContainsMissingClass.

// TODO: We should probably be more specific...
@Test(expected = RuntimeException.class)
public void shouldFailWhenConfigurationContainsMissingClass() throws Exception {
    Configuration config = new PropertiesFileConfiguration(getAbsolutePath("customizable_modules_with_missing_class.conf"));
    new CustomizableModules().load(config);
}
Also used : PropertiesFileConfiguration(org.candlepin.common.config.PropertiesFileConfiguration) Configuration(org.candlepin.common.config.Configuration) PropertiesFileConfiguration(org.candlepin.common.config.PropertiesFileConfiguration) Test(org.junit.Test)

Aggregations

Configuration (org.candlepin.common.config.Configuration)2 PropertiesFileConfiguration (org.candlepin.common.config.PropertiesFileConfiguration)2 Test (org.junit.Test)2 Module (com.google.inject.Module)1