use of org.eclipse.ceylon.common.config.CeylonConfig in project ceylon by eclipse.
the class RepositoriesTest method setup.
@Before
public void setup() throws IOException {
testConfig = CeylonConfigFinder.loadConfigFromFile(new File("test/src/org/eclipse/ceylon/common/test/repos.config"));
if (FileUtil.getInstallDir() == null) {
// Set a fake installation folder
System.setProperty("ceylon.home", "fake-install-dir");
}
repos = Repositories.withConfig(testConfig);
CeylonConfig fakeConfig = new CeylonConfig();
defaultRepos = Repositories.withConfig(fakeConfig);
CeylonConfig overriddenConfig = CeylonConfigFinder.loadConfigFromFile(new File("test/src/org/eclipse/ceylon/common/test/overridden.config"));
overriddenRepos = Repositories.withConfig(overriddenConfig);
}
use of org.eclipse.ceylon.common.config.CeylonConfig in project ceylon by eclipse.
the class CeylonConfigTest method testRemoveOption.
@Test
public void testRemoveOption() {
CeylonConfig tmpConfig = testConfig.copy();
Assert.assertTrue(tmpConfig.isOptionDefined("test.string-hello"));
tmpConfig.removeOption("test.string-hello");
Assert.assertFalse(tmpConfig.isOptionDefined("test.string-hello"));
}
use of org.eclipse.ceylon.common.config.CeylonConfig in project ceylon by eclipse.
the class CeylonConfigTest method testSetOption.
@Test
public void testSetOption() {
CeylonConfig tmpConfig = testConfig.copy();
Assert.assertEquals("hello", tmpConfig.getOption("test.string-hello"));
tmpConfig.setOption("test.string-hello", "world");
Assert.assertEquals("world", tmpConfig.getOption("test.string-hello"));
try {
tmpConfig.setOption("hello", null);
Assert.fail();
} catch (IllegalArgumentException ex) {
// Ok
}
}
Aggregations