{
public void test_ParamsFileRepository() throws Exception
{
File root;
ParamFileRepository fileRepo;
// Check it defaults to the working dir...
root = new File("./");
fileRepo = new ParamFileRepository();
assertEquals(root, fileRepo.getRoot());
// Check it can pick up from the System prop...
root = new File("build/tests/");
ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
ParamFileRepository.FILE_PARAMS_REPOS_ROOT, root.getPath());
fileRepo = new ParamFileRepository();
assertEquals(root, fileRepo.getRoot());
// Check for error on invalid System prop...
ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
ParamFileRepository.FILE_PARAMS_REPOS_ROOT, "blah/blah");
try
{
new ParamFileRepository();
fail("expected IllegalStateException");
} catch (IllegalStateException e)
{
// expected
}